@@ -79,11 +79,26 @@ If no new rule is detected → do not update the file.
7979 - confirm the Mermaid module/boundary diagram exists (if missing → create/update it first)
8080 - identify the impacted boundary/module(s) and entry points
8181 - follow the links to the relevant ADR(s) and Feature doc(s) (do not read everything)
82- - Read assignment, then inspect only the relevant docs/code before planning
83- - Write multi-step plan before implementation
82+ - Scope first (prevent context overload):
83+ - use ` docs/Architecture/Overview.md ` → “Scoping (read first)”
84+ - write ** in scope / out of scope** (what will change and what must not change)
85+ - if you cannot identify scope from the architecture map → stop and fix the map (or ask one clarifying question)
86+ - Analyze first (no coding yet):
87+ - what exists today (facts only)
88+ - what must change / must not change
89+ - unknowns and risks (what must be clarified)
90+ - Create a written plan before implementation:
91+ - for architecture/decision work: keep the plan as ` ## Implementation plan (step-by-step) ` in the ADR
92+ - for behaviour work: keep the plan as ` ## Implementation plan (step-by-step) ` in the Feature doc
93+ - update the plan while executing (tick items / update statuses as work is completed)
8494- Implement code and tests together
8595- If ` build ` is separate from ` test ` , run ` build ` before ` test `
86- - Run tests in layers: new → related suite → broader regressions
96+ - Verification timing (optimize time + tokens):
97+ - do not run ` test ` /` coverage ` “just because” before you wrote/changed code or tests (exception: reproducing a bug / confirming baseline)
98+ - while iterating, run the smallest meaningful scope (new/changed tests first)
99+ - run broader suites only when you have something real to verify (avoid re-running the same command without changes)
100+ - run coverage once per change (it is heavier than tests)
101+ - Run tests in layers: new/changed → related suite → broader regressions
87102- After tests pass: run format
88103- After format: run build (final check)
89104- Summarize changes and test results before marking complete
@@ -103,6 +118,10 @@ If no new rule is detected → do not update the file.
103118 - ` docs/Architecture/Overview.md ` : at least one Mermaid module/boundary map
104119 - ` docs/Features/* ` : at least one Mermaid diagram for the main flow
105120 - ` docs/ADR/* ` : at least one Mermaid diagram for the decision
121+ - Mermaid hygiene (Mermaid often breaks if you freestyle it):
122+ - diagrams must render in repo Markdown preview (broken Mermaid is treated as broken documentation)
123+ - prefer simple Mermaid syntax (` flowchart ` / ` sequenceDiagram ` ) and short ASCII-only IDs
124+ - if a diagram doesn’t render, simplify it until it does (no “close enough”)
106125
107126### Testing (ALL TASKS)
108127
@@ -116,6 +135,7 @@ If no new rule is detected → do not update the file.
116135- Never delete or weaken a test to make it pass
117136- Each test verifies a real flow or scenario, not just calls a function — tests without meaningful assertions are forbidden
118137- Check code coverage to see which functionality is actually tested; coverage is for finding gaps, not a number to chase
138+ - Flaky tests are failures: fix the test or the underlying behaviour, don’t “retry until green”
119139
120140### Autonomy
121141
0 commit comments