rules/common/coding-style.md
ALWAYS create new objects, NEVER mutate existing ones:
// Pseudocode
WRONG: modify(original, field, value) → changes original in-place
CORRECT: update(original, field, value) → returns new copy with change
Rationale: Immutable data prevents hidden side effects, makes debugging easier, and enables safe concurrency.
MANY SMALL FILES > FEW LARGE FILES:
ALWAYS handle errors comprehensively:
ALWAYS validate at system boundaries:
camelCase with descriptive namesis, has, should, or can prefixesPascalCaseUPPER_SNAKE_CASEcamelCase with a use prefixPrefer early returns over nested conditionals once the logic starts stacking.
Use named constants for meaningful thresholds, delays, and limits.
Split large functions into focused pieces with clear responsibilities.
Before marking work complete: