maxsimcli 5.0.6 → 5.1.0

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.
Files changed (91) hide show
  1. package/README.md +316 -288
  2. package/dist/assets/CHANGELOG.md +14 -0
  3. package/dist/assets/hooks/maxsim-capture-learnings.cjs +128 -0
  4. package/dist/assets/hooks/maxsim-capture-learnings.cjs.map +1 -0
  5. package/dist/assets/hooks/maxsim-check-update.cjs +126 -88
  6. package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -1
  7. package/dist/assets/hooks/maxsim-notification-sound.cjs +87 -43
  8. package/dist/assets/hooks/maxsim-notification-sound.cjs.map +1 -1
  9. package/dist/assets/hooks/maxsim-statusline.cjs +45 -171
  10. package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -1
  11. package/dist/assets/hooks/maxsim-stop-sound.cjs +86 -43
  12. package/dist/assets/hooks/maxsim-stop-sound.cjs.map +1 -1
  13. package/dist/assets/hooks/maxsim-sync-reminder.cjs +72 -21
  14. package/dist/assets/hooks/maxsim-sync-reminder.cjs.map +1 -1
  15. package/dist/assets/templates/agents/AGENTS.md +62 -51
  16. package/dist/assets/templates/agents/executor.md +44 -59
  17. package/dist/assets/templates/agents/planner.md +36 -31
  18. package/dist/assets/templates/agents/researcher.md +35 -43
  19. package/dist/assets/templates/agents/verifier.md +29 -31
  20. package/dist/assets/templates/commands/maxsim/debug.md +20 -154
  21. package/dist/assets/templates/commands/maxsim/execute.md +19 -33
  22. package/dist/assets/templates/commands/maxsim/go.md +21 -20
  23. package/dist/assets/templates/commands/maxsim/help.md +5 -14
  24. package/dist/assets/templates/commands/maxsim/init.md +18 -40
  25. package/dist/assets/templates/commands/maxsim/plan.md +22 -37
  26. package/dist/assets/templates/commands/maxsim/progress.md +15 -16
  27. package/dist/assets/templates/commands/maxsim/quick.md +18 -29
  28. package/dist/assets/templates/commands/maxsim/settings.md +18 -26
  29. package/dist/assets/templates/references/continuation-format.md +2 -4
  30. package/dist/assets/templates/references/model-profiles.md +2 -2
  31. package/dist/assets/templates/references/planning-config.md +10 -11
  32. package/dist/assets/templates/references/self-improvement.md +120 -0
  33. package/dist/assets/templates/rules/conventions.md +1 -1
  34. package/dist/assets/templates/rules/verification-protocol.md +1 -1
  35. package/dist/assets/templates/skills/brainstorming/SKILL.md +35 -26
  36. package/dist/assets/templates/skills/code-review/SKILL.md +78 -55
  37. package/dist/assets/templates/skills/commit-conventions/SKILL.md +70 -36
  38. package/dist/assets/templates/skills/github-operations/SKILL.md +142 -0
  39. package/dist/assets/templates/skills/handoff-contract/SKILL.md +62 -28
  40. package/dist/assets/templates/skills/maxsim-batch/SKILL.md +68 -42
  41. package/dist/assets/templates/skills/maxsim-simplify/SKILL.md +65 -40
  42. package/dist/assets/templates/skills/project-memory/SKILL.md +121 -0
  43. package/dist/assets/templates/skills/research/SKILL.md +126 -0
  44. package/dist/assets/templates/skills/roadmap-writing/SKILL.md +71 -68
  45. package/dist/assets/templates/skills/systematic-debugging/SKILL.md +37 -25
  46. package/dist/assets/templates/skills/tdd/SKILL.md +36 -39
  47. package/dist/assets/templates/skills/using-maxsim/SKILL.md +69 -55
  48. package/dist/assets/templates/skills/verification/SKILL.md +167 -0
  49. package/dist/assets/templates/workflows/batch.md +249 -268
  50. package/dist/assets/templates/workflows/diagnose-issues.md +225 -151
  51. package/dist/assets/templates/workflows/execute-plan.md +191 -981
  52. package/dist/assets/templates/workflows/execute.md +350 -309
  53. package/dist/assets/templates/workflows/go.md +119 -138
  54. package/dist/assets/templates/workflows/health.md +71 -114
  55. package/dist/assets/templates/workflows/help.md +85 -147
  56. package/dist/assets/templates/workflows/init-existing.md +180 -1373
  57. package/dist/assets/templates/workflows/init.md +53 -165
  58. package/dist/assets/templates/workflows/new-milestone.md +91 -334
  59. package/dist/assets/templates/workflows/new-project.md +165 -1384
  60. package/dist/assets/templates/workflows/plan-create.md +182 -73
  61. package/dist/assets/templates/workflows/plan-discuss.md +89 -82
  62. package/dist/assets/templates/workflows/plan-research.md +191 -85
  63. package/dist/assets/templates/workflows/plan.md +122 -58
  64. package/dist/assets/templates/workflows/progress.md +76 -310
  65. package/dist/assets/templates/workflows/quick.md +70 -495
  66. package/dist/assets/templates/workflows/sdd.md +231 -221
  67. package/dist/assets/templates/workflows/settings.md +90 -120
  68. package/dist/assets/templates/workflows/verify-phase.md +296 -258
  69. package/dist/cli.cjs +17 -23465
  70. package/dist/cli.cjs.map +1 -1
  71. package/dist/install.cjs +356 -8358
  72. package/dist/install.cjs.map +1 -1
  73. package/package.json +16 -22
  74. package/dist/assets/templates/skills/agent-system-map/SKILL.md +0 -92
  75. package/dist/assets/templates/skills/evidence-collection/SKILL.md +0 -87
  76. package/dist/assets/templates/skills/github-artifact-protocol/SKILL.md +0 -67
  77. package/dist/assets/templates/skills/github-tools-guide/SKILL.md +0 -89
  78. package/dist/assets/templates/skills/input-validation/SKILL.md +0 -51
  79. package/dist/assets/templates/skills/memory-management/SKILL.md +0 -75
  80. package/dist/assets/templates/skills/research-methodology/SKILL.md +0 -137
  81. package/dist/assets/templates/skills/sdd/SKILL.md +0 -91
  82. package/dist/assets/templates/skills/tool-priority-guide/SKILL.md +0 -80
  83. package/dist/assets/templates/skills/verification-before-completion/SKILL.md +0 -71
  84. package/dist/assets/templates/skills/verification-gates/SKILL.md +0 -169
  85. package/dist/assets/templates/workflows/discuss-phase.md +0 -683
  86. package/dist/assets/templates/workflows/research-phase.md +0 -73
  87. package/dist/assets/templates/workflows/verify-work.md +0 -572
  88. package/dist/core-D5zUr9cb.cjs +0 -4305
  89. package/dist/core-D5zUr9cb.cjs.map +0 -1
  90. package/dist/skills-CjFWZIGM.cjs +0 -6824
  91. package/dist/skills-CjFWZIGM.cjs.map +0 -1
@@ -1,358 +1,396 @@
1
- <sanity_check>
2
- Before executing any step in this workflow, verify:
3
- 1. The current directory contains a `.planning/` folder — if not, stop and tell the user to run `/maxsim:init` first.
4
- 2. `.planning/ROADMAP.md` exists — if not, stop and tell the user to initialize the project.
5
- </sanity_check>
6
-
7
1
  <purpose>
8
- Verify phase goal achievement through goal-backward analysis. Check that the codebase delivers what the phase promised, not just that tasks completed. Posts verification results as GitHub comments on the phase issue (no local VERIFICATION.md or UAT.md files are written).
2
+ Verify that a completed phase achieved its GOAL not just that tasks were marked done. Spawns parallel review agents (security, quality, efficiency), aggregates results into evidence blocks, posts verification results as a GitHub Issue comment, and returns PASS/FAIL to the orchestrator.
9
3
 
10
- Executed by a verification subagent spawned from execute-phase.md.
4
+ Task completion does not equal goal achievement. This workflow checks the codebase against observable, testable criteria.
11
5
  </purpose>
12
6
 
13
7
  <core_principle>
14
- **Task completion Goal achievement**
15
-
16
- A task "create chat component" can be marked complete when the component is a placeholder. The task was done — but the goal "working chat interface" was not achieved.
17
-
18
- Goal-backward verification:
19
- 1. What must be TRUE for the goal to be achieved?
20
- 2. What must EXIST for those truths to hold?
21
- 3. What must be WIRED for those artifacts to function?
8
+ Verify goal achievement, not task completion. A task "create chat component" can be marked done when the component is a placeholder. The task is done — the goal "working chat interface" is not.
22
9
 
23
- Then verify each level against the actual codebase.
10
+ Evidence-first: every PASS or FAIL verdict must cite specific file paths, line numbers, or command output.
24
11
  </core_principle>
25
12
 
26
- <required_reading>
27
- @~/.claude/maxsim/references/verification-patterns.md
28
- @~/.claude/maxsim/templates/verification-report.md
29
- </required_reading>
30
-
31
13
  <process>
32
14
 
33
- <step name="load_context" priority="first">
34
- Load phase operation context:
15
+ ## Step 1 — Load Phase Context
35
16
 
36
17
  ```bash
37
18
  INIT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs init phase-op "${PHASE_ARG}")
38
19
  ```
39
20
 
40
- Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`, `has_plans`, `plan_count`.
21
+ Extract: `phase_dir`, `phase_number`, `phase_name`, `has_plans`, `plan_count`.
41
22
 
42
- Then load phase details:
23
+ Get the phase issue number from GitHub:
43
24
  ```bash
44
- node ~/.claude/maxsim/bin/maxsim-tools.cjs roadmap get-phase "${phase_number}"
45
- grep -E "^| ${phase_number}" .planning/REQUIREMENTS.md 2>/dev/null
25
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github all-progress
46
26
  ```
27
+ Find entry where `phase_number` matches. Extract `issue_number` — all verification results are posted here as comments.
47
28
 
48
- **Get the phase issue number from GitHub (live):**
49
-
50
- Run `github all-progress` and find the entry where `phase_number` matches. Extract `issue_number` — this is used for posting all verification results as GitHub comments.
51
-
29
+ Load phase goal and requirements:
52
30
  ```bash
53
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github all-progress
31
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs roadmap get-phase "${PHASE_NUMBER}"
54
32
  ```
55
33
 
56
- Extract **phase goal** from ROADMAP.md (the outcome to verify, not tasks) and **requirements** from REQUIREMENTS.md if it exists.
57
- </step>
34
+ Extract `success_criteria` array and `goal` from ROADMAP.md. These are the contract.
58
35
 
59
- <step name="establish_must_haves">
60
- **Option A: Must-haves in PLAN frontmatter**
36
+ ## Step 2 — Establish Must-Haves
61
37
 
62
- Use maxsim-tools to extract must_haves from each PLAN:
38
+ **Priority order:**
63
39
 
64
- ```bash
65
- for plan in "$PHASE_DIR"/*-PLAN.md; do
66
- MUST_HAVES=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs frontmatter get "$plan" --field must_haves)
67
- echo "=== $plan ===" && echo "$MUST_HAVES"
68
- done
69
- ```
40
+ 1. **Success Criteria from ROADMAP.md** — if `success_criteria` array is non-empty, use it directly. Each criterion is an observable, testable truth. These override plan-level must_haves.
70
41
 
71
- Returns JSON: `{ truths: [...], artifacts: [...], key_links: [...] }`
42
+ 2. **Must-haves from plan frontmatter** if no ROADMAP success criteria, extract from each plan comment on the phase issue:
43
+ ```bash
44
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github get-issue \
45
+ --issue-number $PHASE_ISSUE_NUMBER --include-comments
46
+ ```
47
+ For each plan comment, parse frontmatter `must_haves` field: `{ truths, artifacts, key_links }`.
72
48
 
73
- Aggregate all must_haves across plans for phase-level verification.
49
+ 3. **Derive from phase goal (fallback)** — if neither source has must-haves, derive:
50
+ - 3–7 observable truths (each testable without human interaction)
51
+ - Concrete artifact file paths per truth
52
+ - Critical wiring points where stubs commonly hide
74
53
 
75
- **Option B: Use Success Criteria from ROADMAP.md**
54
+ Document the must-haves before running any checks.
76
55
 
77
- If no must_haves in frontmatter (MUST_HAVES returns error or empty), check for Success Criteria:
56
+ ## Step 3 Run Automated Checks
57
+
58
+ ### 3a — Detect and run test suite
78
59
 
79
60
  ```bash
80
- PHASE_DATA=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs roadmap get-phase "${phase_number}" --raw)
61
+ # Detect test runner
62
+ if [ -f package.json ]; then
63
+ TEST_SCRIPT=$(node -e "const p=require('./package.json'); console.log(p.scripts?.test || '')")
64
+ [ -n "$TEST_SCRIPT" ] && npm test 2>&1
65
+ elif [ -f pytest.ini ] || [ -f pyproject.toml ]; then
66
+ python -m pytest 2>&1
67
+ elif [ -f Cargo.toml ]; then
68
+ cargo test 2>&1
69
+ fi
81
70
  ```
82
71
 
83
- Parse the `success_criteria` array from the JSON output. If non-empty:
84
- 1. Use each Success Criterion directly as a **truth** (they are already written as observable, testable behaviors)
85
- 2. Derive **artifacts** (concrete file paths for each truth)
86
- 3. Derive **key links** (critical wiring where stubs hide)
87
- 4. Document the must-haves before proceeding
72
+ Record: PASS / FAIL + output excerpt (last 30 lines if failure).
73
+
74
+ ### 3b Detect and run build
75
+
76
+ ```bash
77
+ if [ -f package.json ]; then
78
+ BUILD_SCRIPT=$(node -e "const p=require('./package.json'); console.log(p.scripts?.build || '')")
79
+ [ -n "$BUILD_SCRIPT" ] && npm run build 2>&1
80
+ elif [ -f Cargo.toml ]; then
81
+ cargo build 2>&1
82
+ fi
83
+ ```
88
84
 
89
- Success Criteria from ROADMAP.md are the contract — they override PLAN-level must_haves when both exist.
85
+ Record: PASS / FAIL + error output.
90
86
 
91
- **Option C: Derive from phase goal (fallback)**
87
+ ### 3c Detect and run linter
92
88
 
93
- If no must_haves in frontmatter AND no Success Criteria in ROADMAP:
94
- 1. State the goal from ROADMAP.md
95
- 2. Derive **truths** (3-7 observable behaviors, each testable)
96
- 3. Derive **artifacts** (concrete file paths for each truth)
97
- 4. Derive **key links** (critical wiring where stubs hide)
98
- 5. Document derived must-haves before proceeding
99
- </step>
89
+ ```bash
90
+ if [ -f biome.json ]; then
91
+ npx biome check . 2>&1 | tail -20
92
+ elif [ -f .eslintrc* ] || [ -f eslint.config* ]; then
93
+ npx eslint . 2>&1 | tail -20
94
+ elif [ -f .ruff.toml ] || grep -q ruff pyproject.toml 2>/dev/null; then
95
+ ruff check . 2>&1 | tail -20
96
+ fi
97
+ ```
100
98
 
101
- <step name="verify_truths">
102
- For each observable truth, determine if the codebase enables it.
99
+ Record: PASS / FAIL + lint violations count.
103
100
 
104
- **Status:** VERIFIED (all supporting artifacts pass) | ✗ FAILED (artifact missing/stub/unwired) | ? UNCERTAIN (needs human)
101
+ ### 3d Verify artifacts
105
102
 
106
- For each truth: identify supporting artifacts → check artifact status → check wiring → determine truth status.
103
+ For each artifact in must-haves:
107
104
 
108
- **Example:** Truth "User can see existing messages" depends on Chat.tsx (renders), /api/chat GET (provides), Message model (schema). If Chat.tsx is a stub or API returns hardcoded [] → FAILED. If all exist, are substantive, and connected → VERIFIED.
109
- </step>
105
+ | Level | Check | Method |
106
+ |-------|-------|--------|
107
+ | 1 — Exists | File present on disk | `[ -f {path} ]` |
108
+ | 2 — Substantive | File has real content | Line count > threshold, no placeholder patterns |
109
+ | 3 — Wired | File is imported and used | `grep -r "import.*{name}" src/` AND used outside import |
110
110
 
111
- <step name="verify_artifacts">
112
- Use maxsim-tools for artifact verification against must_haves in each PLAN:
111
+ Status matrix:
112
+ | Exists | Substantive | Wired | Status |
113
+ |--------|-------------|-------|--------|
114
+ | yes | yes | yes | VERIFIED |
115
+ | yes | yes | no | ORPHANED |
116
+ | yes | no | — | STUB |
117
+ | no | — | — | MISSING |
113
118
 
119
+ Scan for anti-patterns in modified files:
114
120
  ```bash
115
- for plan in "$PHASE_DIR"/*-PLAN.md; do
116
- ARTIFACT_RESULT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs verify artifacts "$plan")
117
- echo "=== $plan ===" && echo "$ARTIFACT_RESULT"
118
- done
121
+ grep -n -E "TODO|FIXME|XXX|HACK" {modified_files} 2>/dev/null
122
+ grep -n -iE "placeholder|coming soon|will be here" {modified_files} 2>/dev/null
123
+ grep -n -E "return null|return \{\}|return \[\]" {modified_files} 2>/dev/null
119
124
  ```
120
125
 
121
- Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`
126
+ Categorize: Blocker (prevents goal achievement) or Warning (incomplete but not blocking).
127
+
128
+ ### 3e — Verify key links (wiring)
122
129
 
123
- **Artifact status from result:**
124
- - `exists=false` → MISSING
125
- - `issues` not empty → STUB (check issues for "Only N lines" or "Missing pattern")
126
- - `passed=true` → VERIFIED (Levels 1-2 pass)
130
+ For each key link in must-haves:
131
+
132
+ | Pattern | Check |
133
+ |---------|-------|
134
+ | Component → API | fetch/axios call to API path, response used |
135
+ | API → Database | Prisma/DB query on model, result returned |
136
+ | Form → Handler | onSubmit with real implementation (not console.log) |
137
+ | State → Render | useState variable appears in JSX |
127
138
 
128
- **Level 3 — Wired (manual check for artifacts that pass Levels 1-2):**
129
139
  ```bash
130
- grep -r "import.*$artifact_name" src/ --include="*.ts" --include="*.tsx" # IMPORTED
131
- grep -r "$artifact_name" src/ --include="*.ts" --include="*.tsx" | grep -v "import" # USED
140
+ # Example: component imports and uses API endpoint
141
+ grep -r "fetch.*{api_path}\|axios.*{api_path}" src/ --include="*.ts" --include="*.tsx"
132
142
  ```
133
- WIRED = imported AND used. ORPHANED = exists but not imported/used.
134
143
 
135
- | Exists | Substantive | Wired | Status |
136
- |--------|-------------|-------|--------|
137
- | ✓ | ✓ | ✓ | ✓ VERIFIED |
138
- | ✓ | ✓ | ✗ | ⚠️ ORPHANED |
139
- | ✓ | ✗ | - | ✗ STUB |
140
- | ✗ | - | - | ✗ MISSING |
141
- </step>
144
+ Record: WIRED / PARTIAL / NOT_WIRED with evidence.
142
145
 
143
- <step name="verify_wiring">
144
- Use maxsim-tools for key link verification against must_haves in each PLAN:
146
+ ## Step 4 — Spawn Parallel Review Agents
145
147
 
146
- ```bash
147
- for plan in "$PHASE_DIR"/*-PLAN.md; do
148
- LINKS_RESULT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs verify key-links "$plan")
149
- echo "=== $plan ===" && echo "$LINKS_RESULT"
150
- done
151
- ```
148
+ Spawn three review agents simultaneously in a SINGLE message block (foreground, no worktree needed):
152
149
 
153
- Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, verified, detail}] }`
150
+ ```
151
+ Agent(
152
+ subagent_type="verifier",
153
+ model="{verifier_model}",
154
+ prompt="
155
+ Security review for phase {phase_number}: {phase_name}.
156
+
157
+ Read the files modified in this phase (from summary comments on issue #{phase_issue_number}).
158
+ Check for:
159
+ - Unsanitized user input (injection risks)
160
+ - Exposed secrets or credentials
161
+ - Missing authentication/authorization checks
162
+ - Insecure data handling or transmission
163
+ - Dependency vulnerabilities (if package.json changed)
164
+
165
+ Evidence format:
166
+ CLAIM: {what was checked}
167
+ EVIDENCE: {file:line or command run}
168
+ OUTPUT: {actual result}
169
+ VERDICT: PASS | FAIL — {reason}
170
+
171
+ Return: SECURITY REVIEW: PASS or SECURITY REVIEW: FAIL — {issues list}
172
+ "
173
+ )
174
+
175
+ Agent(
176
+ subagent_type="verifier",
177
+ model="{verifier_model}",
178
+ prompt="
179
+ Code quality review for phase {phase_number}: {phase_name}.
180
+
181
+ Read the files modified in this phase (from summary comments on issue #{phase_issue_number}).
182
+ Check for:
183
+ - Bugs and logical errors
184
+ - Unhandled edge cases and error paths
185
+ - Missing or inadequate error handling
186
+ - Dead code or unreachable branches
187
+ - Overly complex logic that could be simplified
188
+
189
+ Evidence format:
190
+ CLAIM: {what was checked}
191
+ EVIDENCE: {file:line or command run}
192
+ OUTPUT: {actual result}
193
+ VERDICT: PASS | FAIL — {reason}
194
+
195
+ Return: QUALITY REVIEW: PASS or QUALITY REVIEW: FAIL — {issues list}
196
+ "
197
+ )
198
+
199
+ Agent(
200
+ subagent_type="verifier",
201
+ model="{verifier_model}",
202
+ prompt="
203
+ Efficiency review for phase {phase_number}: {phase_name}.
204
+
205
+ Read the files modified in this phase (from summary comments on issue #{phase_issue_number}).
206
+ Check for:
207
+ - Obvious N+1 query patterns
208
+ - Unnecessary re-renders or recomputations
209
+ - Missing memoization for expensive operations
210
+ - Unbounded loops or recursion
211
+ - Large bundle additions without justification
212
+
213
+ Evidence format:
214
+ CLAIM: {what was checked}
215
+ EVIDENCE: {file:line or command run}
216
+ OUTPUT: {actual result}
217
+ VERDICT: PASS | FAIL — {reason}
218
+
219
+ Return: EFFICIENCY REVIEW: PASS or EFFICIENCY REVIEW: FAIL — {issues list}
220
+ "
221
+ )
222
+ ```
154
223
 
155
- **Link status from result:**
156
- - `verified=true` → WIRED
157
- - `verified=false` with "not found" → NOT_WIRED
158
- - `verified=false` with "Pattern not found" → PARTIAL
224
+ Wait for all three review agents to complete before proceeding.
159
225
 
160
- **Fallback patterns (if key_links not in must_haves):**
226
+ ## Step 5 Identify Human Verification Items
161
227
 
162
- | Pattern | Check | Status |
163
- |---------|-------|--------|
164
- | Component → API | fetch/axios call to API path, response used (await/.then/setState) | WIRED / PARTIAL (call but unused response) / NOT_WIRED |
165
- | API → Database | Prisma/DB query on model, result returned via res.json() | WIRED / PARTIAL (query but not returned) / NOT_WIRED |
166
- | Form → Handler | onSubmit with real implementation (fetch/axios/mutate/dispatch), not console.log/empty | WIRED / STUB (log-only/empty) / NOT_WIRED |
167
- | State → Render | useState variable appears in JSX (`{stateVar}` or `{stateVar.property}`) | WIRED / NOT_WIRED |
228
+ Some checks cannot be automated. Flag these for human review:
168
229
 
169
- Record status and evidence for each key link.
170
- </step>
230
+ - Visual appearance and layout
231
+ - User flow completion (multi-step interactions)
232
+ - Real-time behavior (WebSocket, SSE, animations)
233
+ - External service integrations
234
+ - Performance feel under real conditions
235
+ - Accessibility
171
236
 
172
- <step name="verify_requirements">
173
- If REQUIREMENTS.md exists:
174
- ```bash
175
- grep -E "Phase ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null
237
+ Format each item:
238
+ ```
239
+ Test: {name}
240
+ Steps: {what to do}
241
+ Expected: {what should happen}
242
+ Why manual: {why automated checks cannot cover this}
176
243
  ```
177
244
 
178
- For each requirement: parse description identify supporting truths/artifacts → status: ✓ SATISFIED / ✗ BLOCKED / ? NEEDS HUMAN.
179
- </step>
245
+ ## Step 6 Determine Overall Status
180
246
 
181
- <step name="scan_antipatterns">
182
- Extract files modified in this phase from local plan files, scan each:
247
+ **PASS** — All of the following:
248
+ - All must-have truths: VERIFIED
249
+ - All artifacts: not MISSING or STUB
250
+ - All key links: WIRED or ORPHANED (not NOT_WIRED)
251
+ - Tests: PASS
252
+ - Build: PASS
253
+ - Lint: PASS or warnings only (no errors)
254
+ - No Blocker anti-patterns
255
+ - Security review: PASS
256
+ - Quality review: PASS (no blockers)
257
+ - Efficiency review: PASS (no blockers)
183
258
 
184
- | Pattern | Search | Severity |
185
- |---------|--------|----------|
186
- | TODO/FIXME/XXX/HACK | `grep -n -E "TODO\|FIXME\|XXX\|HACK"` | ⚠️ Warning |
187
- | Placeholder content | `grep -n -iE "placeholder\|coming soon\|will be here"` | 🛑 Blocker |
188
- | Empty returns | `grep -n -E "return null\|return \{\}\|return \[\]\|=> \{\}"` | ⚠️ Warning |
189
- | Log-only functions | Functions containing only console.log | ⚠️ Warning |
259
+ **FAIL** Any of:
260
+ - Any must-have truth: FAILED
261
+ - Any artifact: MISSING or STUB
262
+ - Any key link: NOT_WIRED
263
+ - Tests: FAIL
264
+ - Build: FAIL
265
+ - Any Blocker anti-pattern
266
+ - Security or Quality review: FAIL with blockers
190
267
 
191
- Categorize: 🛑 Blocker (prevents goal) | ⚠️ Warning (incomplete) | ℹ️ Info (notable).
192
- </step>
268
+ **HUMAN_NEEDED** All automated checks PASS but human verification items remain unreviewed.
193
269
 
194
- <step name="identify_human_verification">
195
- **Always needs human:** Visual appearance, user flow completion, real-time behavior (WebSocket/SSE), external service integration, performance feel, error message clarity.
270
+ Score: `{verified_truths}/{total_truths} must-haves verified`
196
271
 
197
- **Needs human if uncertain:** Complex wiring grep can't trace, dynamic state-dependent behavior, edge cases.
272
+ ## Step 7 Post Verification Result to GitHub
198
273
 
199
- Format each as: Test Name What to do Expected result Why can't verify programmatically.
200
- </step>
274
+ Build the verification content in memory and post as a comment. This is the canonical record — no local VERIFICATION.md is written.
201
275
 
202
- <step name="determine_status">
203
- **passed:** All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns.
276
+ ```bash
277
+ VERIFY_FILE=$(mktemp)
278
+ cat > "$VERIFY_FILE" << 'VERIFY_EOF'
279
+ ---
280
+ phase: {phase_number}
281
+ plan: all
282
+ status: passed | fail | human_needed
283
+ score: {verified}/{total}
284
+ timestamp: {ISO timestamp}
285
+ checks:
286
+ tests: pass | fail | skipped
287
+ build: pass | fail | skipped
288
+ lint: pass | fail | skipped
289
+ security_review: pass | fail
290
+ quality_review: pass | fail
291
+ efficiency_review: pass | fail
292
+ ---
204
293
 
205
- **gaps_found:** Any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, or blocker found.
294
+ ## Verification: Phase {phase_number} {phase_name}
206
295
 
207
- **human_needed:** All automated checks pass but human verification items remain.
296
+ **Status:** {PASS | FAIL | HUMAN NEEDED}
297
+ **Score:** {verified}/{total} must-haves verified
298
+ **Timestamp:** {ISO timestamp}
208
299
 
209
- **Score:** `verified_truths / total_truths`
210
- </step>
300
+ ## Must-Have Verification
211
301
 
212
- <step name="generate_fix_plans">
213
- If gaps_found:
302
+ | Truth | Status | Evidence |
303
+ |-------|--------|----------|
304
+ | {truth} | VERIFIED / FAILED / UNCERTAIN | {file:line or command output} |
214
305
 
215
- 1. **Cluster related gaps:** API stub + component unwired → "Wire frontend to backend". Multiple missing → "Complete core implementation". Wiring only → "Connect existing components".
306
+ ## Artifact Status
216
307
 
217
- 2. **Generate plan per cluster:** Objective, 2-3 tasks (files/action/verify each), re-verify step. Keep focused: single concern per plan.
308
+ | Artifact | Exists | Substantive | Wired | Status |
309
+ |----------|--------|-------------|-------|--------|
310
+ | {path} | yes/no | yes/no | yes/no | VERIFIED/STUB/MISSING/ORPHANED |
218
311
 
219
- 3. **Order by dependency:** Fix missing → fix stubs → fix wiring → verify.
220
- </step>
312
+ ## Key Links
221
313
 
222
- <step name="post_verification_to_github">
223
- **Post verification results as a GitHub comment (primary output — no local file written).**
314
+ | From | To | Via | Status | Evidence |
315
+ |------|----|-----|--------|----------|
316
+ | {component} | {api} | fetch | WIRED | {grep output} |
224
317
 
225
- Build the verification content in memory using the same structured format as the verification report template. Then run `github post-comment` with `type: 'verification'` on the phase issue.
318
+ ## Automated Checks
226
319
 
227
- Write the body content to a tmpfile first, then post:
320
+ | Check | Status | Notes |
321
+ |-------|--------|-------|
322
+ | Tests | {PASS/FAIL/SKIPPED} | {runner used, error if fail} |
323
+ | Build | {PASS/FAIL/SKIPPED} | {error if fail} |
324
+ | Lint | {PASS/FAIL/SKIPPED} | {violation count} |
325
+ | Security | {PASS/FAIL} | {issues if fail} |
326
+ | Quality | {PASS/FAIL} | {blockers if fail} |
327
+ | Efficiency | {PASS/FAIL} | {blockers if fail} |
228
328
 
229
- ```bash
230
- # Write body to tmpfile (JSON with status, score, phase, timestamp, truths_checked, artifacts_verified, etc.)
231
- BODY_FILE=$(mktemp)
232
- cat > "$BODY_FILE" << 'VERIFICATION_EOF'
233
- {
234
- "status": "passed | gaps_found | human_needed",
235
- "score": "{verified}/{total}",
236
- "phase": "{phase_number} — {phase_name}",
237
- "timestamp": "{ISO timestamp}",
238
- "truths_checked": [
239
- { "truth": "...", "status": "VERIFIED | FAILED | UNCERTAIN", "evidence": "..." }
240
- ],
241
- "artifacts_verified": [
242
- { "path": "...", "exists": true, "substantive": true, "wired": true, "status": "VERIFIED | STUB | MISSING | ORPHANED" }
243
- ],
244
- "key_links_validated": [
245
- { "from": "...", "to": "...", "via": "...", "status": "WIRED | PARTIAL | NOT_WIRED" }
246
- ],
247
- "antipatterns": [
248
- { "file": "...", "line": 0, "pattern": "...", "severity": "Blocker | Warning | Info" }
249
- ],
250
- "human_verification_items": [
251
- { "name": "...", "steps": "...", "expected": "...", "reason": "..." }
252
- ],
253
- "gaps": [
254
- { "description": "...", "fix_plan": "..." }
255
- ],
256
- "fix_plans": [
257
- { "name": "...", "objective": "...", "tasks": ["..."] }
258
- ]
259
- }
260
- VERIFICATION_EOF
261
-
262
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github post-comment --issue-number {PHASE_ISSUE_NUMBER} --body-file "$BODY_FILE" --type verification
263
- ```
329
+ ## Anti-Patterns Found
264
330
 
265
- The comment is the canonical record of this verification run.
266
- </step>
331
+ {Blocker anti-patterns with file:line}
332
+ {Warning anti-patterns with file:line}
333
+ {"None." if clean}
267
334
 
268
- <step name="run_uat">
269
- **User Acceptance Testing (UAT):**
335
+ ## Human Verification Items
270
336
 
271
- Present the human verification items to the user and walk through each one. After the user completes UAT:
337
+ {numbered list of items requiring human testing}
338
+ {"None." if fully automated}
272
339
 
273
- Build the UAT results in memory, then post as a GitHub comment by running `github post-comment` with `type: 'uat'` on the phase issue:
340
+ ## Gaps (if status = fail)
274
341
 
275
- ```bash
276
- # Write UAT body to tmpfile
277
- UAT_FILE=$(mktemp)
278
- cat > "$UAT_FILE" << 'UAT_EOF'
279
- {
280
- "status": "passed | gaps_found",
281
- "phase": "{phase_number} — {phase_name}",
282
- "timestamp": "{ISO timestamp}",
283
- "items": [
284
- { "name": "...", "result": "pass | fail", "notes": "..." }
285
- ],
286
- "gaps": [
287
- { "description": "...", "severity": "Blocker | Warning" }
288
- ]
289
- }
290
- UAT_EOF
291
-
292
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github post-comment --issue-number {PHASE_ISSUE_NUMBER} --body-file "$UAT_FILE" --type uat
293
- ```
342
+ {numbered list of gaps with fix recommendations}
294
343
 
295
- Do NOT write a UAT.md file to `.planning/phases/`.
296
- </step>
344
+ <!-- maxsim:type=verification -->
345
+ VERIFY_EOF
297
346
 
298
- <step name="board_transition">
299
- **Update GitHub board based on verification outcome.**
347
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github post-comment \
348
+ --issue-number {PHASE_ISSUE_NUMBER} \
349
+ --body-file "$VERIFY_FILE" \
350
+ --type verification
351
+ ```
300
352
 
301
- **If verification passes AND PR is merged:**
302
- 1. Run `github move-issue` to move the phase issue to the "Done" column on the board
303
- 2. Run `github close-issue` to close the phase issue
304
- 3. Report to orchestrator: phase complete, issue closed
353
+ ## Step 8 Update Board and Return
305
354
 
355
+ **If PASS:**
306
356
  ```bash
307
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github move-issue --issue-number N --status "Done"
308
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github close-issue --issue-number N
357
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github move-issue \
358
+ --issue-number $PHASE_ISSUE_NUMBER --status "Done"
359
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github close-issue \
360
+ --issue-number $PHASE_ISSUE_NUMBER
309
361
  ```
310
362
 
311
- **If verification passes but PR not yet merged:**
312
- 1. Keep the phase issue in "In Review" on the board
313
- 2. Note: board will be updated when PR merges
314
-
315
- **If verification fails (gaps_found):**
316
- 1. Check current board column for the phase issue
317
- 2. If in "In Review": run `github move-issue` to move back to "In Progress"
318
- 3. Post failure details as a verification comment (already done in post_verification_to_github step)
319
- 4. Note which gaps need fixing before re-verification
320
-
363
+ **If FAIL:**
321
364
  ```bash
322
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github move-issue --issue-number N --status "In Progress"
365
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github move-issue \
366
+ --issue-number $PHASE_ISSUE_NUMBER --status "In Progress"
323
367
  ```
324
368
 
325
- **If human_needed:**
326
- 1. Keep the phase issue in its current column (do not move)
327
- 2. The UAT comment posted above documents what needs human testing
328
- </step>
329
-
330
- <step name="return_to_orchestrator">
331
- Return status (`passed` | `gaps_found` | `human_needed`), score (N/M must-haves), GitHub issue number and comment URL.
332
-
333
- If gaps_found: list gaps + recommended fix plan names. Phase issue has been moved back to "In Progress" on the board.
334
- If human_needed: list items requiring human testing. UAT comment posted to GitHub issue.
335
- If passed: phase issue moved to "Done" and closed on GitHub.
369
+ **If HUMAN_NEEDED:** Leave issue in current column. The verification comment documents what needs testing.
336
370
 
337
- Orchestrator routes: `passed` → update_roadmap | `gaps_found` → create/execute fixes, re-verify | `human_needed` → present to user.
338
- </step>
371
+ Return to orchestrator:
372
+ - Status: `passed` | `gaps_found` | `human_needed`
373
+ - Score: N/M must-haves verified
374
+ - GitHub issue number and comment URL
375
+ - If gaps_found: gap list and recommended fix plan names
376
+ - If human_needed: items requiring human testing
339
377
 
340
378
  </process>
341
379
 
342
380
  <success_criteria>
343
- - [ ] Phase issue number retrieved from live GitHub via `github all-progress`
344
- - [ ] Must-haves established (from frontmatter or derived)
345
- - [ ] All truths verified with status and evidence
346
- - [ ] All artifacts checked at all three levels
347
- - [ ] All key links verified
348
- - [ ] Requirements coverage assessed (if applicable)
349
- - [ ] Anti-patterns scanned and categorized
381
+ - [ ] Phase issue number retrieved from GitHub via all-progress
382
+ - [ ] Must-haves established from ROADMAP success_criteria, plan frontmatter, or derived from goal
383
+ - [ ] All must-have truths verified with status and evidence
384
+ - [ ] All artifacts checked at three levels (exists, substantive, wired)
385
+ - [ ] All key links verified with grep evidence
386
+ - [ ] Tests, build, and lint detected and executed
387
+ - [ ] Anti-patterns scanned and categorized as Blocker or Warning
388
+ - [ ] Three review agents (security, quality, efficiency) spawned in a SINGLE message block using Agent tool
389
+ - [ ] All review agent results aggregated before determining overall status
350
390
  - [ ] Human verification items identified
351
- - [ ] Overall status determined
352
- - [ ] Fix plans generated (if gaps_found)
353
- - [ ] Verification results posted as GitHub comment via `github post-comment` (type: 'verification') — NO local VERIFICATION.md written
354
- - [ ] UAT results posted as GitHub comment via `github post-comment` (type: 'uat') — NO local UAT.md written
355
- - [ ] Board transition executed: `github move-issue` + `github close-issue` on pass; `github move-issue` back to In Progress on fail
356
- - [ ] Results returned to orchestrator
391
+ - [ ] Overall status determined (PASS / FAIL / HUMAN_NEEDED)
392
+ - [ ] Verification result posted as GitHub comment: <!-- maxsim:type=verification -->
393
+ - [ ] No local VERIFICATION.md written
394
+ - [ ] Board transition executed: Done + closed on pass, In Progress on fail
395
+ - [ ] Results returned to orchestrator with status, score, and gap details
357
396
  </success_criteria>
358
- </output>