feat(analyze-before-plan): read-before bookend — scan memory (+code) before planning

Shared include lib/analyze-before-plan.md (two-pass on '## <PREFIX>-' headings, disposition-not-reading invariant, guarded no-op). Wired into the dev flows: ship-feature STEP 0d (analyzer code+memory, INPUT INJECTION into brainstorm/plan + STEP 3 reconciliation gate), bugfix STEP 2.5 (blockers-first), feat STEP 0.6 (decisions-first, MINI-PLAN names in-force or states none), hotfix opt-in. analyzer gains a RELATED MEMORY output section pointing at the include (DRY). init-project / onboard no-op by construction (guarded scan on absent/empty registries).

Mirror of the coupled-capitalize write-after (BDR-034): read-before / write-after bookend.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ho5EQCFTSvYamuRtVZpp2d
This commit is contained in:
Bastien Chanot
2026-06-26 23:46:41 +02:00
co-authored by Claude Opus 4.8
parent 07e846f0a6
commit 67c6a8165d
6 changed files with 228 additions and 2 deletions
+12
View File
@@ -60,6 +60,18 @@ Trace the bug from symptom to root cause:
# grep for the same pattern to assess blast radius
```
## STEP 2.5 — MEMORY READ-BEFORE (blockers-first)
Run the scan per `$HOME/.claude/lib/analyze-before-plan.md`, blockers-weighted: a resolved
BLK may already name THIS exact root cause; an in-force BDR may constrain the fix. Emit
RELATED MEMORY. Consumption is NATURAL — the agent emitting this IS the one writing STEP 3's
diagnosis (reader = planner, no external skill to inject into).
TEETH: STEP 3's DIAGNOSIS must name any binding prior (`PRIOR: BLK-xxx — known cause/fix`,
or `honors BDR-xxx`) OR the RELATED MEMORY line states none bears. Reading blockers then
diagnosing without naming a match is the read-then-ignore failure this prevents.
`.claude/memory/` absent → guarded no-op, proceed.
## STEP 3 — HYPOTHESIZE + PLAN
Present findings before fixing: