claude-prism 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,159 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.2.6] — 2026-02-28
9
+
10
+ ### Fixed
11
+ - CHANGELOG.md added to npm package `files` (was missing from published tarball)
12
+
13
+ ## [1.2.5] — 2026-02-28
14
+
15
+ ### Fixed
16
+ - **Global skill missing Essence phase** — `~/.claude/commands/claude-prism/prism.md` was still UDEC (no Essence). `/claude-prism:prism` and `/prism` now correctly start from ESSENCE.
17
+ - **E/E header collision** — `## E — EXECUTE` → `## X — EXECUTE` in slash command/skill files to disambiguate from `## E — ESSENCE`
18
+ - **SKILL.md step numbering** — was `3,2,3,4...`, now continuous `0-32`
19
+
20
+ ### Added
21
+ - **Analysis-only branch** in UNDERSTAND — skip D/E/C when no code change is needed
22
+ - **Verification scoping** in EXECUTE — filter build output to changed files only
23
+ - **Agent failure recovery** in EXECUTE — 3-step protocol (verify → complete → retry)
24
+ - Backported Git-as-Memory, Goal Recitation, Thrashing Detector, quality gates, Plan-Reality sync to `templates/commands/prism.md` (was only in SKILL.md)
25
+
26
+ ### Changed
27
+ - All 4 EUDEC entry points fully synchronized (rules.md, commands/prism.md, SKILL.md, CLAUDE.md)
28
+ - README: updated EUDEC Core Cycle diagram, added v1.2.5 feature highlights, documented global install file tree
29
+
30
+ ## [1.2.4] — 2026-02-25
31
+
32
+ ### Fixed
33
+ - `prism update` in source repo now updates commands/hooks/lib (was early-returning after rules only)
34
+ - All Korean labels → English across all templates (prism.md, SKILL.md, hud.md, omc-hud.mjs)
35
+
36
+ ## [1.2.2] — 2026-02-25
37
+
38
+ ### Fixed
39
+ - HUD statusline Korean labels → English (주간→Wkly, day names)
40
+
41
+ ## [1.2.1] — 2026-02-25
42
+
43
+ ### Fixed
44
+ - Stats template version now matches package.json (was stuck at v0.1.0)
45
+
46
+ ### Changed
47
+ - HUD statusline now fetches usage data directly from Anthropic OAuth API (30s cache TTL)
48
+ - No longer depends on OMC for usage cache refresh
49
+ - Stale cache fallback when API is unreachable
50
+
51
+ ## [1.0.0] — 2026-02-24
52
+
53
+ ### Added
54
+ - `prism analytics [--detail]` CLI command and slash command for usage statistics
55
+ - Session event logging in hook pipeline (blocks/warns automatically recorded)
56
+ - session.mjs included in installed lib files
57
+ - CHANGELOG.md (this file)
58
+ - GitHub Actions CI workflow (test on push/PR)
59
+ - Config schema versioning (`.claude-prism.json` version field)
60
+ - Verification Fallback Ladder (7-level, from automated tests to manual diff)
61
+ - Quality Gates between DECOMPOSE→EXECUTE and EXECUTE→CHECKPOINT
62
+ - Goal Recitation mechanism at batch boundaries
63
+ - Thrashing Detector (oscillation, scope creep, symptom chasing)
64
+ - Git-as-Memory protocol (commit per batch as rollback point)
65
+ - Environment Validation in UNDERSTAND phase
66
+ - Agent Delegation Verification with resource ownership
67
+ - Project-type verification examples (PHP, Static Sites, Scripts, Infra)
68
+ - Negative testing requirement for high-risk changes
69
+ - Project Memory (persistent docs/PROJECT-MEMORY.md)
70
+
71
+ ### Changed
72
+ - SKILL.md fully synchronized with rules.md v3 features (10 items)
73
+ - doctor.md updated to reflect current file structure (was referencing deleted files)
74
+ - plan.md template now includes Related Plans, Codebase Audit, Files in Scope
75
+ - checkpoint.md now includes Plan-Reality sync and freshness verification
76
+ - prism.md + SKILL.md EXECUTE step numbers fixed (no longer collide with DECOMPOSE)
77
+ - Batch size guidance unified to 5-8 for simple/mechanical changes
78
+ - OMC Scope Guard thresholds explained (4 warn / 7 block standalone vs 8/12 with OMC)
79
+ - Section numbering: Assumption Detection now 2-5 (was duplicate 2-4)
80
+ - Command count increased from 7 to 8 (added analytics.md)
81
+
82
+ ### Fixed
83
+ - Self-update detection: source repo now uses local templates instead of npx cache (v0.8.1)
84
+
85
+ ## [0.8.0] — 2026-02-22
86
+
87
+ ### Added
88
+ - UDEC v3 methodology upgrade based on field feedback and research
89
+ - Plan freshness validation and auto/manual verify separation
90
+ - Codebase Audit section in plan template
91
+ - Related Plans section for cross-plan dependency tracking
92
+ - No-test-infra verification row (legacy PHP, WordPress support)
93
+ - [S]-only batch size rule (up to 8 per batch)
94
+ - Advisory decomposition thresholds (coupling-aware)
95
+ - Rationalization Defense entries (4 new)
96
+ - Auto-counting in checkpoint command
97
+
98
+ ### Changed
99
+ - Verification strategy now risk-based (not path-based)
100
+ - Auto vs Manual verification explicitly separated
101
+
102
+ ## [0.7.2] — 2026-02-22
103
+
104
+ ### Added
105
+ - Plan freshness validation at checkpoints
106
+ - Cross-plan overlap detection
107
+
108
+ ## [0.7.0] — 2026-02-20
109
+
110
+ ### Added
111
+ - plan-enforcement hook (warns when editing 6+ files without a plan)
112
+ - Reverted from premature 1.0.0 release
113
+
114
+ ### Changed
115
+ - Restored 3-hook model (commit-guard, test-tracker, plan-enforcement)
116
+
117
+ ## [0.6.0] — 2026-02-19
118
+
119
+ ### Added
120
+ - UDEC v2 methodology
121
+ - Scope guard, debug loop, alignment detection hooks
122
+
123
+ ### Removed
124
+ - Hooks with high false-positive rate (scope-guard, debug-loop, alignment)
125
+
126
+ ## [0.5.0] — 2026-02-18
127
+
128
+ ### Changed
129
+ - English-only base (removed i18n support for simplicity)
130
+ - Unified pipeline runners (pre-tool.mjs, post-tool.mjs)
131
+
132
+ ## [0.4.0] — 2026-02-17
133
+
134
+ ### Added
135
+ - Pipeline engine for running multiple rules per hook
136
+ - Session logging infrastructure
137
+ - Alignment detection hook
138
+ - i18n support (later removed in 0.5.0)
139
+
140
+ ## [0.3.0] — 2026-02-16
141
+
142
+ ### Added
143
+ - Context-aware verification (TDD for logic, build for UI)
144
+ - Adaptive batch sizes
145
+
146
+ ## [0.2.2] — 2026-02-15
147
+
148
+ ### Added
149
+ - Global install (`prism init --global`)
150
+ - OMC skill support
151
+
152
+ ## [0.1.0] — 2026-02-14
153
+
154
+ ### Added
155
+ - Initial release
156
+ - UDEC methodology framework (Understand, Decompose, Execute, Checkpoint)
157
+ - Commit guard hook
158
+ - Test tracker hook
159
+ - 6 slash commands (prism, checkpoint, plan, doctor, stats, help)
package/README.md CHANGED
@@ -46,18 +46,22 @@ AI coding agents fail in predictable ways:
46
46
  Injected into `CLAUDE.md`, EUDEC is a behavioral framework that corrects how AI agents approach tasks:
47
47
 
48
48
  ```
49
- ┌─────────────────── EUDEC Core Cycle ──────────────────┐
50
- │ ESSENCE ── Extract core problem → simplify → expand
51
- │ │ Task type derivation from essence
52
- │ UNDERSTAND ── Sufficiency assessment → ask → align
53
- │ │ Environment validation
54
- DECOMPOSE ── Batches plan file → quality gate
55
- │ │ Codebase audit → cross-plan check
56
- EXECUTE ── Adaptive batchesrisk-based verification
57
- │ │ Goal recitationthrashing detection
58
- CHECKPOINT ── Report with evidence plan-reality sync
59
- (loops back for next batch)
60
- └────────────────────────────────────────────────────────┘
49
+ ┌──────────────────── EUDEC Core Cycle ───────────────────┐
50
+ │ ESSENCE ── Extract core problem → simplify → expand
51
+ │ │ Task type derivation from essence
52
+ │ UNDERSTAND ── Sufficiency assessment → ask → align
53
+ │ │ Environment validation
54
+ │ Analysis-only branch (skip D/E/C if no code
55
+ │ │ change needed)
56
+ DECOMPOSE ── Batches plan file quality gate
57
+ │ │ Codebase auditcross-plan check
58
+ EXECUTE ── Adaptive batchesGit-as-Memory (commit per
59
+ │ batch) risk-based verification
60
+ │ │ Goal recitation → thrashing detection │
61
+ │ │ Verification scoping (changed files only) │
62
+ │ CHECKPOINT ── Report with evidence → plan-reality sync │
63
+ │ (loops back for next batch) │
64
+ └──────────────────────────────────────────────────────────┘
61
65
 
62
66
 
63
67
  HANDOFF ── Session transition doc + Project Memory
@@ -75,6 +79,12 @@ Injected into `CLAUDE.md`, EUDEC is a behavioral framework that corrects how AI
75
79
 
76
80
  **Quality gates** between phases prevent executing on broken baselines.
77
81
 
82
+ **New in v1.2.5:**
83
+ - **Analysis-only branch**: When no code change is needed, UNDERSTAND reports findings without entering DECOMPOSE/EXECUTE/CHECKPOINT
84
+ - **Git-as-Memory**: Commits after each batch as rollback points; `git diff` summaries maintain context in long sessions
85
+ - **Verification scoping**: Build check output filtered to changed files only — pre-existing errors are ignored
86
+ - **Agent failure recovery**: 3-step protocol when delegated agents produce incomplete results
87
+
78
88
  ### 2. Three Focused Hooks
79
89
 
80
90
  Hooks enforce the methodology at critical points. All three are deterministic (no heuristics, no state accumulation issues):
@@ -162,8 +172,10 @@ your-project/
162
172
  │ └── settings.json # Hook registration
163
173
  └── docs/plans/ # Plan files (created during work)
164
174
 
165
- ~/.claude/ # (HUD global, opt-in)
166
- └── hud/omc-hud.mjs # Statusline script
175
+ ~/.claude/ # (global install / HUD)
176
+ ├── commands/claude-prism/ # 9 slash commands (--global)
177
+ ├── skills/prism/SKILL.md # /prism skill (--global)
178
+ └── hud/omc-hud.mjs # Statusline script (--hud)
167
179
  ```
168
180
 
169
181
  ## Configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-prism",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "EUDEC methodology framework for AI coding agents — Essence, Understand, Decompose, Execute, Checkpoint.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,7 +31,8 @@
31
31
  "lib/",
32
32
  "hooks/",
33
33
  "templates/",
34
- "README.md"
34
+ "README.md",
35
+ "CHANGELOG.md"
35
36
  ],
36
37
  "repository": {
37
38
  "type": "git",
@@ -5,7 +5,7 @@ When this command is invoked, follow the EUDEC framework strictly:
5
5
  ## E — ESSENCE
6
6
 
7
7
  0. **Extract the essence**: Before exploring code, ask: "What is the core problem here — in one sentence, without naming specific tools?"
8
- - Output: `Essence: [one sentence]`
8
+ - Output: `Essence: [one sentence — no technology/tool names]`
9
9
  - Output: `Minimal case: [simplest working version]`
10
10
  - Output: `Expansion path: minimal → [step1] → [step2] → [complete]`
11
11
  1. **Verify essence quality**:
@@ -30,7 +30,8 @@ When this command is invoked, follow the EUDEC framework strictly:
30
30
  - [Sufficient] Specific file, function, symptom mentioned → skip to DECOMPOSE
31
31
  - [Partial] Direction clear but details missing → explore then ask 1-2 questions
32
32
  - [Insufficient] Abstract, vague, multiple interpretations → must ask questions first
33
- 5. **Check for hidden assumptions** (Red Flag Detection):
33
+ 5. **Environment validation**: Verify project builds, dependencies match, env config identified. If any fail → resolve first.
34
+ 6. **Check for hidden assumptions** (Red Flag Detection):
34
35
 
35
36
  | Red Flag | Question to Ask Yourself |
36
37
  |----------|-------------------------|
@@ -42,63 +43,74 @@ When this command is invoked, follow the EUDEC framework strictly:
42
43
  | No file/function names | [Insufficient]. Must ask. |
43
44
  | "just", "simply" | Complexity being underestimated |
44
45
 
45
- 6. **Question rules** (if questions needed):
46
+ 7. **Question rules** (if questions needed):
46
47
  - One question at a time
47
48
  - Multiple choice with 2-3 options + recommendation
48
49
  - Include reasoning based on code exploration
49
50
  - Maximum 3 rounds of questions
50
- 7. **Confirm alignment**: Summarize goal in one sentence, get user approval
51
- 8. **Analysis-only requests**: If no code change is needed (architecture review, cause analysis, investigation), report findings and ask: "Further action needed?" Do NOT proceed to D/E/C unless the user requests implementation.
51
+ 8. **Confirm alignment**: Summarize goal in one sentence, get user approval
52
+ 9. **Analysis-only requests**: If no code change is needed, report findings and ask: "Further action needed?" Do NOT proceed to D/E/C unless the user requests implementation.
52
53
 
53
54
  ## D — DECOMPOSE
54
55
 
55
- 9. **Assess complexity** (consider BOTH file count AND logic complexity):
56
- - [Simple] 1-2 files, minor changes (<50 LOC) → execute directly, no decomposition needed
57
- - [Medium] 3-5 files, OR 1-2 files with significant logic changes (50-150 LOC) → 2-3 batches
58
- - [Complex] 6+ files, OR substantial architectural changes → 5+ batches, must create plan file
59
- - [Complex system] Unclear scope → reduce scope first, then decompose
60
- 10. **Create batches** following the 5 principles:
56
+ 10. **Assess complexity** (consider BOTH file count AND logic complexity):
57
+ - [Simple] 1-2 files, minor changes (<50 LOC) → execute directly, no decomposition needed
58
+ - [Medium] 3-5 files, OR 1-2 files with significant logic changes (50-150 LOC) → 2-3 batches
59
+ - [Complex] 6+ files, OR substantial architectural changes → 5+ batches, must create plan file
60
+ - [Complex system] Unclear scope → reduce scope first, then decompose
61
+ 11. **Create batches** following the 5 principles:
61
62
  - Unit size: 2-5 minutes each (test/implement/verify as separate steps)
62
63
  - Test first: test before implementation in each unit
63
64
  - Independent verification: each unit has a pass criterion
64
65
  - Files specified: list files to create/modify per unit
65
66
  - Dependencies noted: mark if unit depends on a previous one
66
- 11. **Assign size tags** to every task: [S] <30 LOC, [M] 30-100 LOC, [L] >100 LOC
67
+ 12. **Assign size tags** to every task: [S] <30 LOC, [M] 30-100 LOC, [L] >100 LOC
67
68
  - Batch composition: S+S+M = 1 batch, L = 1 batch alone
68
- 12. **Assign verification strategy** per task: `| Verify: TDD` or `| Verify: Build` or `| Verify: Visual`
69
- 13. **Pre-decomposition checklist**:
69
+ 13. **Assign verification strategy** per task: `| Verify: TDD` or `| Verify: Build` or `| Verify: Visual`
70
+ 14. **Pre-decomposition checklist**:
71
+ - **Codebase audit**: grep/search to verify targets actually exist in code
72
+ - **Cross-plan check**: if other plans exist in `docs/plans/`, identify overlapping files
70
73
  - Required types/interfaces have the necessary fields?
71
74
  - External package APIs behave as expected?
72
75
  - Cross-package dependencies identified and noted as prerequisites?
73
- 14. **Save plan** to `docs/plans/YYYY-MM-DD-<topic>.md`
74
- 15. **Get approval**: "Proceed with this plan?"
76
+ 15. **Quality gate**: Plan file exists and targets verified, project builds, dependencies resolved, environment validated. All must pass before execution.
77
+ 16. **Save plan** to `docs/plans/YYYY-MM-DD-<topic>.md`
78
+ 17. **Get approval**: "Proceed with this plan?"
75
79
 
76
- ## E — EXECUTE
80
+ ## X — EXECUTE
77
81
 
78
- 16. Execute in adaptive batches:
82
+ 18. Execute in adaptive batches:
79
83
  - Simple changes (imports, types, config): 5-8 per batch
80
84
  - Standard changes (feature add/modify): 3-4 per batch
81
85
  - Complex changes (new module, architecture): 1-2 per batch
82
- 17. Apply context-aware verification:
83
- - `lib/`, `utils/`, `store/`, `hooks/`, `services/` → TDD (failing test → implement → verify)
84
- - `components/`, `pages/`, `views/` Build verification (escalate to TDD if complex logic)
85
- - `config/`, `styles/`, `types/` Build/lint only
86
- 18. **Scope Guard**: Before each change, ask: "Was this requested?" If no → don't do it
87
- 19. **Self-correction triggers**:
88
- - Same file edited 3+ times **on the same region/logic**stop, investigate root cause (progressive edits across different regions imports, logic, JSX — are normal)
86
+ 19. **Git-as-Memory**: commit after each completed batch as a rollback point. Use `git diff` summaries to maintain context in long sessions.
87
+ 20. Apply risk-based verification:
88
+ - **High risk** (business logic, auth, data mutation): TDD failing test → implement → pass. Include negative tests.
89
+ - **Medium risk** (new components with logic, API integration): Build + lint pass
90
+ - **Low risk** (imports, types, style, renaming): Build/lint passes
91
+ - **No test infra** (legacy PHP, WordPress, etc.): Grep-based static check + syntax validation
92
+ - Use **Verification Fallback Ladder**: Automated Tests Approval TestingBuild Lint Smoke Check Manual Diff Review (use highest available level)
93
+ 21. **Scope Guard**: Before each change, ask: "Was this requested?" If no → don't do it
94
+ 22. **Goal Recitation**: At every batch boundary, re-read the plan and confirm: "Current work aligns with: [original goal]"
95
+ 23. **Self-correction triggers (Thrashing Detector)**:
96
+ - Same file edited 3+ times **on the same region/logic** → stop, investigate root cause
89
97
  - File not in plan → pause, ask about scope change
90
98
  - 3 consecutive test failures → stop, reconsider approach
91
99
  - New package needed → ask user first
92
100
  - Adding workarounds on workarounds → design problem, step back
93
- 20. **Verification scoping**: When running build checks (tsc, lint, etc.), filter output to only changed files. Pre-existing errors in other files are not your concern. Example: `tsc --noEmit 2>&1 | grep -i "<changed-file>"`
94
- 21. **Agent failure recovery**: If a delegated agent partially fails or produces incomplete results:
101
+ - Successive edits reverting previous changes (oscillation) wrong approach
102
+ - Scope expanding beyond plan scope creep, return to DECOMPOSE
103
+ - Error messages changing type across fixes → chasing symptoms, back to UNDERSTAND
104
+ 24. **Verification scoping**: Filter build output to only changed files. Pre-existing errors are not your concern.
105
+ 25. **Agent failure recovery**: If a delegated agent partially fails:
95
106
  1. Verify actual file state (read the file, not just the agent's report)
96
107
  2. If partially correct → complete the remaining work directly
97
108
  3. If fully wrong → retry with clearer instructions or execute directly
98
109
 
99
110
  ## C — CHECKPOINT
100
111
 
101
- 22. After each batch, report using this format:
112
+ 26. **Quality gate**: All batch tasks terminal, build passes with zero new errors, no uncommitted changes, plan file updated with `[x]` status. If any fail → continue in EXECUTE.
113
+ 27. After each batch, report using this format:
102
114
 
103
115
  | Item | Before | After |
104
116
  |------|--------|-------|
@@ -107,12 +119,14 @@ When this command is invoked, follow the EUDEC framework strictly:
107
119
  ```
108
120
  Phase: [current] | Batch: [N/M] | Tasks: [done/total] ([%])
109
121
  [████████░░] 80% — Next: [next batch name]
122
+ Plan freshness: verified [date] | Remaining targets: [N] confirmed in code
110
123
  ```
111
124
 
112
- 23. Include: verification results, files modified, tests status
113
- 24. **Checkpoint policy**: after 3 consecutive approvals, increase batch size to 5-8 for the rest of the phase
114
- 25. Ask: "Continue to next batch?"
115
- 26. User can redirect, adjust scope, or stop at any checkpoint
125
+ 28. **Plan-Reality sync**: Grep for plan targets, mark vanished targets as "already completed", add newly discovered targets.
126
+ 29. Include: verification results, files modified, tests status
127
+ 30. **Checkpoint policy**: after 3 consecutive approvals, increase batch size to 5-8 for the rest of the phase
128
+ 31. Ask: "Continue to next batch?"
129
+ 32. User can redirect, adjust scope, or stop at any checkpoint
116
130
 
117
131
  ## OMC Integration
118
132
 
@@ -121,6 +121,10 @@ Before moving to DECOMPOSE:
121
121
  - No file/function names mentioned → [Insufficient]. Must ask.
122
122
  - Words like "just", "simply", "quickly" → complexity is being underestimated.
123
123
 
124
+ ### 2-6. Analysis-Only Requests
125
+
126
+ If no code change is needed (architecture review, cause analysis, investigation), report findings and ask: "Further action needed?" Do NOT proceed to DECOMPOSE/EXECUTE/CHECKPOINT unless the user requests implementation.
127
+
124
128
  ---
125
129
 
126
130
  ## EUDEC 3. DECOMPOSE — Planning Protocol
@@ -254,6 +258,8 @@ Choose verification proportional to the **risk of the change**, not the file pat
254
258
 
255
259
  **Every change must have SOME verification.** If no tooling exists, `git diff` review is the minimum.
256
260
 
261
+ **Verification scoping**: When running build checks (tsc, lint, etc.), filter output to only changed files. Pre-existing errors in other files are not your concern. Example: `tsc --noEmit 2>&1 | grep -i "<changed-file>"`
262
+
257
263
  **Core Rules:**
258
264
  1. Never claim completion without fresh **auto** verification evidence
259
265
  2. Never commit code that doesn't build
@@ -314,6 +320,11 @@ When delegating work to sub-agents:
314
320
  4. **Run build/test** to verify the agent's changes work
315
321
  5. **Fix or retry** if incomplete
316
322
 
323
+ **Agent failure recovery**: If a delegated agent partially fails or produces incomplete results:
324
+ 1. Verify actual file state (read the file, not just the agent's report)
325
+ 2. If partially correct → complete the remaining work directly
326
+ 3. If fully wrong → retry with clearer instructions or execute directly
327
+
317
328
  **Never mark a delegated task as complete without reading the actual file state.**
318
329
 
319
330
  ### 4-7. Project-Type Verification Examples
@@ -56,12 +56,12 @@ AI agents optimize for speed, not correctness. Without structure, they skip unde
56
56
  ## U — UNDERSTAND
57
57
 
58
58
  3. **Explore first**: Read package.json, project structure, related files before asking anything
59
- 2. **Assess information sufficiency**:
59
+ 4. **Assess information sufficiency**:
60
60
  - [Sufficient] Specific file, function, symptom mentioned → skip to DECOMPOSE
61
61
  - [Partial] Direction clear but details missing → explore then ask 1-2 questions
62
62
  - [Insufficient] Abstract, vague, multiple interpretations → must ask questions first
63
- 3. **Environment validation**: Verify project builds, dependencies match, env config identified. If any fail → resolve first.
64
- 4. **Check for hidden assumptions** (Red Flag Detection):
63
+ 5. **Environment validation**: Verify project builds, dependencies match, env config identified. If any fail → resolve first.
64
+ 6. **Check for hidden assumptions** (Red Flag Detection):
65
65
 
66
66
  | Red Flag | Question to Ask Yourself |
67
67
  |----------|-------------------------|
@@ -73,56 +73,56 @@ AI agents optimize for speed, not correctness. Without structure, they skip unde
73
73
  | No file/function names | [Insufficient]. Must ask. |
74
74
  | "just", "simply" | Complexity being underestimated |
75
75
 
76
- 5. **Question rules** (if questions needed):
76
+ 7. **Question rules** (if questions needed):
77
77
  - One question at a time
78
78
  - Multiple choice with 2-3 options + recommendation
79
79
  - Include reasoning based on code exploration
80
80
  - Maximum 3 rounds of questions
81
- 6. **Confirm alignment**: Summarize goal in one sentence, get user approval
82
- 7. **Analysis-only requests**: If no code change is needed, report findings and ask: "Further action needed?" Do NOT proceed to D/E/C unless the user requests implementation.
81
+ 8. **Confirm alignment**: Summarize goal in one sentence, get user approval
82
+ 9. **Analysis-only requests**: If no code change is needed, report findings and ask: "Further action needed?" Do NOT proceed to D/E/C unless the user requests implementation.
83
83
 
84
84
  ## D — DECOMPOSE
85
85
 
86
- 8. **Assess complexity** (consider BOTH file count AND logic complexity):
87
- - [Simple] 1-2 files, minor changes (<50 LOC) → execute directly, no decomposition needed
88
- - [Medium] 3-5 files, OR 1-2 files with significant logic changes (50-150 LOC) → 2-3 batches
89
- - [Complex] 6+ files, OR substantial architectural changes → 5+ batches, must create plan file
90
- - [Complex system] Unclear scope → reduce scope first, then decompose
91
- 9. **Create batches** following the 5 principles:
92
- - Unit size: 2-5 minutes each (test/implement/verify as separate steps)
93
- - Test first: test before implementation in each unit
94
- - Independent verification: each unit has a pass criterion
95
- - Files specified: list files to create/modify per unit
96
- - Dependencies noted: mark if unit depends on a previous one
97
- 10. **Assign size tags** to every task: [S] <30 LOC, [M] 30-100 LOC, [L] >100 LOC
86
+ 10. **Assess complexity** (consider BOTH file count AND logic complexity):
87
+ - [Simple] 1-2 files, minor changes (<50 LOC) → execute directly, no decomposition needed
88
+ - [Medium] 3-5 files, OR 1-2 files with significant logic changes (50-150 LOC) → 2-3 batches
89
+ - [Complex] 6+ files, OR substantial architectural changes → 5+ batches, must create plan file
90
+ - [Complex system] Unclear scope → reduce scope first, then decompose
91
+ 11. **Create batches** following the 5 principles:
92
+ - Unit size: 2-5 minutes each (test/implement/verify as separate steps)
93
+ - Test first: test before implementation in each unit
94
+ - Independent verification: each unit has a pass criterion
95
+ - Files specified: list files to create/modify per unit
96
+ - Dependencies noted: mark if unit depends on a previous one
97
+ 12. **Assign size tags** to every task: [S] <30 LOC, [M] 30-100 LOC, [L] >100 LOC
98
98
  - Batch composition: S+S+M = 1 batch, L = 1 batch alone
99
- 11. **Assign verification strategy** per task: `| Verify: TDD` or `| Verify: Build` or `| Verify: Visual`
100
- 12. **Pre-decomposition checklist**:
99
+ 13. **Assign verification strategy** per task: `| Verify: TDD` or `| Verify: Build` or `| Verify: Visual`
100
+ 14. **Pre-decomposition checklist**:
101
101
  - **Codebase audit**: grep/search to verify targets actually exist in code
102
102
  - **Cross-plan check**: if other plans exist in `docs/plans/`, identify overlapping files
103
103
  - Required types/interfaces have the necessary fields?
104
104
  - External package APIs behave as expected?
105
105
  - Cross-package dependencies identified and noted as prerequisites?
106
- 13. **Quality gate**: Plan file exists and targets verified, project builds, dependencies resolved, environment validated. All must pass before execution.
107
- 14. **Save plan** to `docs/plans/YYYY-MM-DD-<topic>.md`
108
- 15. **Get approval**: "Proceed with this plan?"
106
+ 15. **Quality gate**: Plan file exists and targets verified, project builds, dependencies resolved, environment validated. All must pass before execution.
107
+ 16. **Save plan** to `docs/plans/YYYY-MM-DD-<topic>.md`
108
+ 17. **Get approval**: "Proceed with this plan?"
109
109
 
110
- ## E — EXECUTE
110
+ ## X — EXECUTE
111
111
 
112
- 16. Execute in adaptive batches:
112
+ 18. Execute in adaptive batches:
113
113
  - Simple changes (imports, types, config): 5-8 per batch
114
114
  - Standard changes (feature add/modify): 3-4 per batch
115
115
  - Complex changes (new module, architecture): 1-2 per batch
116
- 17. **Git-as-Memory**: commit after each completed batch as a rollback point. Use `git diff` summaries to maintain context in long sessions.
117
- 18. Apply risk-based verification:
116
+ 19. **Git-as-Memory**: commit after each completed batch as a rollback point. Use `git diff` summaries to maintain context in long sessions.
117
+ 20. Apply risk-based verification:
118
118
  - **High risk** (business logic, auth, data mutation): TDD — failing test → implement → pass. Include negative tests.
119
119
  - **Medium risk** (new components with logic, API integration): Build + lint pass
120
120
  - **Low risk** (imports, types, style, renaming): Build/lint passes
121
121
  - **No test infra** (legacy PHP, WordPress, etc.): Grep-based static check + syntax validation
122
122
  - Use **Verification Fallback Ladder**: Automated Tests → Approval Testing → Build → Lint → Smoke Check → Manual Diff Review (use highest available level)
123
- 19. **Scope Guard**: Before each change, ask: "Was this requested?" If no → don't do it
124
- 20. **Goal Recitation**: At every batch boundary, re-read the plan and confirm: "Current work aligns with: [original goal]"
125
- 21. **Self-correction triggers (Thrashing Detector)**:
123
+ 21. **Scope Guard**: Before each change, ask: "Was this requested?" If no → don't do it
124
+ 22. **Goal Recitation**: At every batch boundary, re-read the plan and confirm: "Current work aligns with: [original goal]"
125
+ 23. **Self-correction triggers (Thrashing Detector)**:
126
126
  - Same file edited 3+ times **on the same region/logic** → stop, investigate root cause
127
127
  - File not in plan → pause, ask about scope change
128
128
  - 3 consecutive test failures → stop, reconsider approach
@@ -131,16 +131,16 @@ AI agents optimize for speed, not correctness. Without structure, they skip unde
131
131
  - Successive edits reverting previous changes (oscillation) → wrong approach
132
132
  - Scope expanding beyond plan → scope creep, return to DECOMPOSE
133
133
  - Error messages changing type across fixes → chasing symptoms, back to UNDERSTAND
134
- 22. **Verification scoping**: Filter build output to only changed files. Pre-existing errors are not your concern.
135
- 23. **Agent failure recovery**: If a delegated agent partially fails:
134
+ 24. **Verification scoping**: Filter build output to only changed files. Pre-existing errors are not your concern.
135
+ 25. **Agent failure recovery**: If a delegated agent partially fails:
136
136
  1. Verify actual file state (read the file, not just the agent's report)
137
137
  2. If partially correct → complete the remaining work directly
138
138
  3. If fully wrong → retry with clearer instructions or execute directly
139
139
 
140
140
  ## C — CHECKPOINT
141
141
 
142
- 24. **Quality gate**: All batch tasks terminal, build passes with zero new errors, no uncommitted changes, plan file updated with `[x]` status. If any fail → continue in EXECUTE.
143
- 25. After each batch, report using this format:
142
+ 26. **Quality gate**: All batch tasks terminal, build passes with zero new errors, no uncommitted changes, plan file updated with `[x]` status. If any fail → continue in EXECUTE.
143
+ 27. After each batch, report using this format:
144
144
 
145
145
  | Item | Before | After |
146
146
  |------|--------|-------|
@@ -152,11 +152,11 @@ AI agents optimize for speed, not correctness. Without structure, they skip unde
152
152
  Plan freshness: verified [date] | Remaining targets: [N] confirmed in code
153
153
  ```
154
154
 
155
- 26. **Plan-Reality sync**: Grep for plan targets, mark vanished targets as "already completed", add newly discovered targets.
156
- 27. Include: verification results, files modified, tests status
157
- 28. **Checkpoint policy**: after 3 consecutive approvals, increase batch size to 5-8 for the rest of the phase
158
- 29. Ask: "Continue to next batch?"
159
- 30. User can redirect, adjust scope, or stop at any checkpoint
155
+ 28. **Plan-Reality sync**: Grep for plan targets, mark vanished targets as "already completed", add newly discovered targets.
156
+ 29. Include: verification results, files modified, tests status
157
+ 30. **Checkpoint policy**: after 3 consecutive approvals, increase batch size to 5-8 for the rest of the phase
158
+ 31. Ask: "Continue to next batch?"
159
+ 32. User can redirect, adjust scope, or stop at any checkpoint
160
160
 
161
161
  ## OMC Integration
162
162