Loop Invariants
A loop is only "good" if every iteration satisfies all of these invariants.
- Single increment of real value: Avoid scope creep; ship something a user notices. (Phase 0 value hypothesis).
- Spec before code (SDD): No code without a
PLAN.md. (Phase 1). - Eval defined up front: Define success before building.
- Surgical diff: Touch only what the request needs.
- 100% codebase-rule adherence: Follow Repository Pattern, clean architecture, specific guardrails.
- Quality gate green:
npm run version:validateMUST exit 0. No exceptions. - PR open + CI green: Nothing is "done" until CI says so.
- Learning captured: Never repeat a fixed error. Update
ITERATION_LOG.md. - Automate the second time: Extract reusable assets so the loop compounds, never repeats toil (Create Skills, Subagents, Scripts).