mindsystem-cc 3.21.0 → 3.22.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 (66) hide show
  1. package/README.md +4 -12
  2. package/agents/ms-plan-checker.md +30 -30
  3. package/agents/ms-plan-writer.md +1 -1
  4. package/agents/ms-product-researcher.md +4 -2
  5. package/agents/ms-verifier.md +25 -117
  6. package/commands/ms/add-phase.md +3 -4
  7. package/commands/ms/add-todo.md +3 -4
  8. package/commands/ms/adhoc.md +3 -4
  9. package/commands/ms/audit-milestone.md +4 -3
  10. package/commands/ms/complete-milestone.md +2 -2
  11. package/commands/ms/config.md +36 -9
  12. package/commands/ms/create-roadmap.md +3 -4
  13. package/commands/ms/debug.md +3 -4
  14. package/commands/ms/design-phase.md +8 -5
  15. package/commands/ms/discuss-phase.md +2 -2
  16. package/commands/ms/doctor.md +9 -6
  17. package/commands/ms/execute-phase.md +2 -5
  18. package/commands/ms/help.md +2 -2
  19. package/commands/ms/insert-phase.md +3 -4
  20. package/commands/ms/map-codebase.md +1 -2
  21. package/commands/ms/new-milestone.md +1 -3
  22. package/commands/ms/new-project.md +3 -5
  23. package/commands/ms/plan-milestone-gaps.md +3 -4
  24. package/commands/ms/plan-phase.md +2 -3
  25. package/commands/ms/progress.md +1 -0
  26. package/commands/ms/remove-phase.md +3 -4
  27. package/commands/ms/research-phase.md +4 -4
  28. package/commands/ms/research-project.md +9 -16
  29. package/commands/ms/review-design.md +4 -2
  30. package/commands/ms/verify-work.md +6 -8
  31. package/mindsystem/references/verification-patterns.md +0 -37
  32. package/mindsystem/templates/config.json +2 -1
  33. package/mindsystem/templates/roadmap.md +1 -1
  34. package/mindsystem/templates/state.md +2 -2
  35. package/mindsystem/templates/verification-report.md +3 -26
  36. package/mindsystem/workflows/discuss-phase.md +7 -3
  37. package/mindsystem/workflows/execute-phase.md +2 -18
  38. package/mindsystem/workflows/map-codebase.md +6 -12
  39. package/mindsystem/workflows/mockup-generation.md +46 -22
  40. package/mindsystem/workflows/plan-phase.md +12 -5
  41. package/mindsystem/workflows/verify-work.md +96 -69
  42. package/package.json +1 -1
  43. package/scripts/__pycache__/ms-tools.cpython-314.pyc +0 -0
  44. package/scripts/__pycache__/test_ms_tools.cpython-314-pytest-9.0.2.pyc +0 -0
  45. package/scripts/ms-tools.py +751 -6
  46. package/scripts/test_ms_tools.py +786 -0
  47. package/agents/ms-flutter-code-quality.md +0 -169
  48. package/agents/ms-flutter-reviewer.md +0 -211
  49. package/agents/ms-flutter-simplifier.md +0 -79
  50. package/mindsystem/workflows/verify-phase.md +0 -625
  51. package/skills/flutter-code-quality/SKILL.md +0 -143
  52. package/skills/flutter-code-simplification/SKILL.md +0 -102
  53. package/skills/flutter-senior-review/AGENTS.md +0 -869
  54. package/skills/flutter-senior-review/SKILL.md +0 -205
  55. package/skills/flutter-senior-review/principles/dependencies-data-not-callbacks.md +0 -75
  56. package/skills/flutter-senior-review/principles/dependencies-provider-tree.md +0 -85
  57. package/skills/flutter-senior-review/principles/dependencies-temporal-coupling.md +0 -97
  58. package/skills/flutter-senior-review/principles/pragmatism-consistent-error-handling.md +0 -130
  59. package/skills/flutter-senior-review/principles/pragmatism-speculative-generality.md +0 -91
  60. package/skills/flutter-senior-review/principles/state-data-clumps.md +0 -64
  61. package/skills/flutter-senior-review/principles/state-invalid-states.md +0 -53
  62. package/skills/flutter-senior-review/principles/state-single-source-of-truth.md +0 -68
  63. package/skills/flutter-senior-review/principles/state-type-hierarchies.md +0 -75
  64. package/skills/flutter-senior-review/principles/structure-composition-over-config.md +0 -105
  65. package/skills/flutter-senior-review/principles/structure-shared-visual-patterns.md +0 -107
  66. package/skills/flutter-senior-review/principles/structure-wrapper-pattern.md +0 -90
@@ -1,625 +0,0 @@
1
- <purpose>
2
- Verify phase goal achievement through goal-backward analysis. Check that the codebase actually delivers what the phase promised, not just that tasks were completed.
3
-
4
- This workflow is executed by a verification subagent spawned from execute-phase.md.
5
- </purpose>
6
-
7
- <core_principle>
8
- **Task completion ≠ Goal achievement**
9
-
10
- A task "create chat component" can be marked complete when the component is a placeholder. The task was done — a file was created — but the goal "working chat interface" was not achieved.
11
-
12
- Goal-backward verification starts from the outcome and works backwards:
13
- 1. What must be TRUE for the goal to be achieved?
14
- 2. What must EXIST for those truths to hold?
15
- 3. What must be WIRED for those artifacts to function?
16
-
17
- Then verify each level against the actual codebase.
18
- </core_principle>
19
-
20
- <required_reading>
21
- **Load these references:**
22
- - ~/.claude/mindsystem/references/goal-backward.md (derivation process)
23
- - ~/.claude/mindsystem/references/verification-patterns.md (detection patterns)
24
- - ~/.claude/mindsystem/templates/verification-report.md (output format)
25
- </required_reading>
26
-
27
- <process>
28
-
29
- <step name="load_context" priority="first">
30
- **Gather all verification context:**
31
-
32
- ```bash
33
- # Phase directory
34
- PHASE_DIR=$(ls -d .planning/phases/${PHASE_ARG}* 2>/dev/null | head -1)
35
-
36
- # Phase goal from ROADMAP
37
- grep -A 5 "Phase ${PHASE_NUM}" .planning/ROADMAP.md
38
-
39
- # Requirements mapped to this phase
40
- grep -E "^| ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null
41
-
42
- # All SUMMARY files (claims to verify)
43
- ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
44
-
45
- # All PLAN files (for Must-Haves in plan markdown)
46
- ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
47
- ```
48
-
49
- **Extract phase goal:** Parse ROADMAP.md for this phase's goal/description. This is the outcome to verify, not the tasks.
50
-
51
- **Extract requirements:** If REQUIREMENTS.md exists, find requirements mapped to this phase. These become additional verification targets.
52
- </step>
53
-
54
- <step name="establish_must_haves">
55
- **Determine what must be verified.**
56
-
57
- **Option A: Must-haves in plan markdown**
58
-
59
- Check if any PLAN.md has a `## Must-Haves` section:
60
-
61
- ```bash
62
- grep -l "## Must-Haves" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
63
- ```
64
-
65
- If found, extract checklist items. Must-haves are markdown checklist entries:
66
-
67
- ```markdown
68
- ## Must-Haves
69
- - [ ] User can see existing messages
70
- - [ ] User can send a message
71
- - [ ] Messages persist after refresh
72
- ```
73
-
74
- Each `- [ ]` item is an observable truth to verify. Derive artifacts from `**Files:**` lines in `## Changes` sections and key links from the implementation details.
75
-
76
- **Option B: Derive from phase goal**
77
-
78
- If no `## Must-Haves` section found in plans, derive using goal-backward process:
79
-
80
- 1. **State the goal:** Take phase goal from ROADMAP.md
81
-
82
- 2. **Derive truths:** Ask "What must be TRUE for this goal to be achieved?"
83
- - List 3-7 observable behaviors from user perspective
84
- - Each truth should be testable by a human using the app
85
-
86
- 3. **Derive artifacts:** For each truth, ask "What must EXIST?"
87
- - Map truths to concrete files (components, routes, schemas)
88
- - Be specific: `src/components/Chat.tsx`, not "chat component"
89
-
90
- 4. **Derive key links:** For each artifact, ask "What must be CONNECTED?"
91
- - Identify critical wiring (component calls API, API queries DB)
92
- - These are where stubs hide
93
-
94
- 5. **Document derived must-haves** before proceeding to verification.
95
-
96
- See ~/.claude/mindsystem/references/goal-backward.md for detailed derivation guidance.
97
- </step>
98
-
99
- <step name="verify_truths">
100
- **For each observable truth, determine if codebase enables it.**
101
-
102
- A truth is achievable if the supporting artifacts exist, are substantive, and are wired correctly.
103
-
104
- **Verification status:**
105
- - ✓ VERIFIED: All supporting artifacts pass all checks
106
- - ✗ FAILED: One or more supporting artifacts missing, stub, or unwired
107
- - ? UNCERTAIN: Can't verify programmatically (needs human)
108
-
109
- **For each truth:**
110
-
111
- 1. Identify supporting artifacts (which files make this truth possible?)
112
- 2. Check artifact status (see verify_artifacts step)
113
- 3. Check wiring status (see verify_wiring step)
114
- 4. Determine truth status based on supporting infrastructure
115
-
116
- **Example:**
117
-
118
- Truth: "User can see existing messages"
119
-
120
- Supporting artifacts:
121
- - Chat.tsx (renders messages)
122
- - /api/chat GET (provides messages)
123
- - Message model (defines schema)
124
-
125
- If Chat.tsx is a stub → Truth FAILED
126
- If /api/chat GET returns hardcoded [] → Truth FAILED
127
- If Chat.tsx exists, is substantive, calls API, renders response → Truth VERIFIED
128
- </step>
129
-
130
- <step name="verify_artifacts">
131
- **For each required artifact, verify three levels:**
132
-
133
- ### Level 1: Existence
134
-
135
- ```bash
136
- check_exists() {
137
- local path="$1"
138
- if [ -f "$path" ]; then
139
- echo "EXISTS"
140
- elif [ -d "$path" ]; then
141
- echo "EXISTS (directory)"
142
- else
143
- echo "MISSING"
144
- fi
145
- }
146
- ```
147
-
148
- If MISSING → artifact fails, record and continue to next artifact.
149
-
150
- ### Level 2: Substantive
151
-
152
- Check that the file has real implementation, not a stub.
153
-
154
- **Line count check:**
155
- ```bash
156
- check_length() {
157
- local path="$1"
158
- local min_lines="$2"
159
- local lines=$(wc -l < "$path" 2>/dev/null || echo 0)
160
- [ "$lines" -ge "$min_lines" ] && echo "SUBSTANTIVE ($lines lines)" || echo "THIN ($lines lines)"
161
- }
162
- ```
163
-
164
- Minimum lines by type:
165
- - Component: 15+ lines
166
- - API route: 10+ lines
167
- - Hook/util: 10+ lines
168
- - Schema model: 5+ lines
169
-
170
- **Stub pattern check:**
171
- ```bash
172
- check_stubs() {
173
- local path="$1"
174
-
175
- # Universal stub patterns
176
- local stubs=$(grep -c -E "TODO|FIXME|placeholder|not implemented|coming soon" "$path" 2>/dev/null || echo 0)
177
-
178
- # Empty returns
179
- local empty=$(grep -c -E "return null|return undefined|return \{\}|return \[\]" "$path" 2>/dev/null || echo 0)
180
-
181
- # Placeholder content
182
- local placeholder=$(grep -c -E "will be here|placeholder|lorem ipsum" "$path" 2>/dev/null || echo 0)
183
-
184
- local total=$((stubs + empty + placeholder))
185
- [ "$total" -gt 0 ] && echo "STUB_PATTERNS ($total found)" || echo "NO_STUBS"
186
- }
187
- ```
188
-
189
- **Export check (for components/hooks):**
190
- ```bash
191
- check_exports() {
192
- local path="$1"
193
- grep -E "^export (default )?(function|const|class)" "$path" && echo "HAS_EXPORTS" || echo "NO_EXPORTS"
194
- }
195
- ```
196
-
197
- **Combine level 2 results:**
198
- - SUBSTANTIVE: Adequate length + no stubs + has exports
199
- - STUB: Too short OR has stub patterns OR no exports
200
- - PARTIAL: Mixed signals (length OK but has some stubs)
201
-
202
- ### Level 3: Wired
203
-
204
- Check that the artifact is connected to the system.
205
-
206
- **Import check (is it used?):**
207
- ```bash
208
- check_imported() {
209
- local artifact_name="$1"
210
- local search_path="${2:-src/}"
211
-
212
- # Find imports of this artifact
213
- local imports=$(grep -r "import.*$artifact_name" "$search_path" --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l)
214
-
215
- [ "$imports" -gt 0 ] && echo "IMPORTED ($imports times)" || echo "NOT_IMPORTED"
216
- }
217
- ```
218
-
219
- **Usage check (is it called?):**
220
- ```bash
221
- check_used() {
222
- local artifact_name="$1"
223
- local search_path="${2:-src/}"
224
-
225
- # Find usages (function calls, component renders, etc.)
226
- local uses=$(grep -r "$artifact_name" "$search_path" --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "import" | wc -l)
227
-
228
- [ "$uses" -gt 0 ] && echo "USED ($uses times)" || echo "NOT_USED"
229
- }
230
- ```
231
-
232
- **Combine level 3 results:**
233
- - WIRED: Imported AND used
234
- - ORPHANED: Exists but not imported/used
235
- - PARTIAL: Imported but not used (or vice versa)
236
-
237
- ### Final artifact status
238
-
239
- | Exists | Substantive | Wired | Status |
240
- |--------|-------------|-------|--------|
241
- | ✓ | ✓ | ✓ | ✓ VERIFIED |
242
- | ✓ | ✓ | ✗ | ⚠️ ORPHANED |
243
- | ✓ | ✗ | - | ✗ STUB |
244
- | ✗ | - | - | ✗ MISSING |
245
-
246
- Record status and evidence for each artifact.
247
- </step>
248
-
249
- <step name="verify_wiring">
250
- **Verify key links between artifacts.**
251
-
252
- Key links are critical connections. If broken, the goal fails even with all artifacts present.
253
-
254
- ### Pattern: Component → API
255
-
256
- Check if component actually calls the API:
257
-
258
- ```bash
259
- verify_component_api_link() {
260
- local component="$1"
261
- local api_path="$2"
262
-
263
- # Check for fetch/axios call to the API
264
- local has_call=$(grep -E "fetch\(['\"].*$api_path|axios\.(get|post).*$api_path" "$component" 2>/dev/null)
265
-
266
- if [ -n "$has_call" ]; then
267
- # Check if response is used
268
- local uses_response=$(grep -A 5 "fetch\|axios" "$component" | grep -E "await|\.then|setData|setState" 2>/dev/null)
269
-
270
- if [ -n "$uses_response" ]; then
271
- echo "WIRED: $component → $api_path (call + response handling)"
272
- else
273
- echo "PARTIAL: $component → $api_path (call exists but response not used)"
274
- fi
275
- else
276
- echo "NOT_WIRED: $component → $api_path (no call found)"
277
- fi
278
- }
279
- ```
280
-
281
- ### Pattern: API → Database
282
-
283
- Check if API route queries database:
284
-
285
- ```bash
286
- verify_api_db_link() {
287
- local route="$1"
288
- local model="$2"
289
-
290
- # Check for Prisma/DB call
291
- local has_query=$(grep -E "prisma\.$model|db\.$model|$model\.(find|create|update|delete)" "$route" 2>/dev/null)
292
-
293
- if [ -n "$has_query" ]; then
294
- # Check if result is returned
295
- local returns_result=$(grep -E "return.*json.*\w+|res\.json\(\w+" "$route" 2>/dev/null)
296
-
297
- if [ -n "$returns_result" ]; then
298
- echo "WIRED: $route → database ($model)"
299
- else
300
- echo "PARTIAL: $route → database (query exists but result not returned)"
301
- fi
302
- else
303
- echo "NOT_WIRED: $route → database (no query for $model)"
304
- fi
305
- }
306
- ```
307
-
308
- ### Pattern: Form → Handler
309
-
310
- Check if form submission does something:
311
-
312
- ```bash
313
- verify_form_handler_link() {
314
- local component="$1"
315
-
316
- # Find onSubmit handler
317
- local has_handler=$(grep -E "onSubmit=\{|handleSubmit" "$component" 2>/dev/null)
318
-
319
- if [ -n "$has_handler" ]; then
320
- # Check if handler has real implementation
321
- local handler_content=$(grep -A 10 "onSubmit.*=" "$component" | grep -E "fetch|axios|mutate|dispatch" 2>/dev/null)
322
-
323
- if [ -n "$handler_content" ]; then
324
- echo "WIRED: form → handler (has API call)"
325
- else
326
- # Check for stub patterns
327
- local is_stub=$(grep -A 5 "onSubmit" "$component" | grep -E "console\.log|preventDefault\(\)$|\{\}" 2>/dev/null)
328
- if [ -n "$is_stub" ]; then
329
- echo "STUB: form → handler (only logs or empty)"
330
- else
331
- echo "PARTIAL: form → handler (exists but unclear implementation)"
332
- fi
333
- fi
334
- else
335
- echo "NOT_WIRED: form → handler (no onSubmit found)"
336
- fi
337
- }
338
- ```
339
-
340
- ### Pattern: State → Render
341
-
342
- Check if state is actually rendered:
343
-
344
- ```bash
345
- verify_state_render_link() {
346
- local component="$1"
347
- local state_var="$2"
348
-
349
- # Check if state variable exists
350
- local has_state=$(grep -E "useState.*$state_var|\[$state_var," "$component" 2>/dev/null)
351
-
352
- if [ -n "$has_state" ]; then
353
- # Check if state is used in JSX
354
- local renders_state=$(grep -E "\{.*$state_var.*\}|\{$state_var\." "$component" 2>/dev/null)
355
-
356
- if [ -n "$renders_state" ]; then
357
- echo "WIRED: state → render ($state_var displayed)"
358
- else
359
- echo "NOT_WIRED: state → render ($state_var exists but not displayed)"
360
- fi
361
- else
362
- echo "N/A: state → render (no state var $state_var)"
363
- fi
364
- }
365
- ```
366
-
367
- ### Aggregate key link results
368
-
369
- For each key link derived from plan `## Changes` and `## Must-Haves` sections:
370
- - Run appropriate verification function
371
- - Record status and evidence
372
- - WIRED / PARTIAL / STUB / NOT_WIRED
373
- </step>
374
-
375
- <step name="verify_requirements">
376
- **Check requirements coverage if REQUIREMENTS.md exists.**
377
-
378
- ```bash
379
- # Find requirements mapped to this phase
380
- grep -E "Phase ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null
381
- ```
382
-
383
- For each requirement:
384
- 1. Parse requirement description
385
- 2. Identify which truths/artifacts support it
386
- 3. Determine status based on supporting infrastructure
387
-
388
- **Requirement status:**
389
- - ✓ SATISFIED: All supporting truths verified
390
- - ✗ BLOCKED: One or more supporting truths failed
391
- - ? NEEDS HUMAN: Can't verify requirement programmatically
392
- </step>
393
-
394
- <step name="scan_antipatterns">
395
- **Scan for anti-patterns across phase files.**
396
-
397
- Identify files modified in this phase:
398
- ```bash
399
- # Extract files from SUMMARY.md
400
- grep -E "^\- \`" "$PHASE_DIR"/*-SUMMARY.md | sed 's/.*`\([^`]*\)`.*/\1/' | sort -u
401
- ```
402
-
403
- Run anti-pattern detection:
404
- ```bash
405
- scan_antipatterns() {
406
- local files="$@"
407
-
408
- echo "## Anti-Patterns Found"
409
- echo ""
410
-
411
- for file in $files; do
412
- [ -f "$file" ] || continue
413
-
414
- # TODO/FIXME comments
415
- grep -n -E "TODO|FIXME|XXX|HACK" "$file" 2>/dev/null | while read line; do
416
- echo "| $file | $(echo $line | cut -d: -f1) | TODO/FIXME | ⚠️ Warning |"
417
- done
418
-
419
- # Placeholder content
420
- grep -n -E "placeholder|coming soon|will be here" "$file" -i 2>/dev/null | while read line; do
421
- echo "| $file | $(echo $line | cut -d: -f1) | Placeholder | 🛑 Blocker |"
422
- done
423
-
424
- # Empty implementations
425
- grep -n -E "return null|return \{\}|return \[\]|=> \{\}" "$file" 2>/dev/null | while read line; do
426
- echo "| $file | $(echo $line | cut -d: -f1) | Empty return | ⚠️ Warning |"
427
- done
428
-
429
- # Console.log only implementations
430
- grep -n -B 2 -A 2 "console\.log" "$file" 2>/dev/null | grep -E "^\s*(const|function|=>)" | while read line; do
431
- echo "| $file | - | Log-only function | ⚠️ Warning |"
432
- done
433
- done
434
- }
435
- ```
436
-
437
- Categorize findings:
438
- - 🛑 Blocker: Prevents goal achievement (placeholder renders, empty handlers)
439
- - ⚠️ Warning: Indicates incomplete (TODO comments, console.log)
440
- - ℹ️ Info: Notable but not problematic
441
- </step>
442
-
443
- <step name="identify_human_verification">
444
- **Flag items that need human verification.**
445
-
446
- Some things can't be verified programmatically:
447
-
448
- **Always needs human:**
449
- - Visual appearance (does it look right?)
450
- - User flow completion (can you do the full task?)
451
- - Real-time behavior (WebSocket, SSE updates)
452
- - External service integration (payments, email)
453
- - Performance feel (does it feel fast?)
454
- - Error message clarity
455
-
456
- **Needs human if uncertain:**
457
- - Complex wiring that grep can't trace
458
- - Dynamic behavior depending on state
459
- - Edge cases and error states
460
-
461
- **Format for human verification:**
462
- ```markdown
463
- ## Human Verification Required
464
-
465
- ### 1. {Test Name}
466
- **Test:** {What to do}
467
- **Expected:** {What should happen}
468
- **Why human:** {Why can't verify programmatically}
469
- ```
470
- </step>
471
-
472
- <step name="determine_status">
473
- **Calculate overall verification status.**
474
-
475
- **Status: passed**
476
- - All truths VERIFIED
477
- - All artifacts pass level 1-3
478
- - All key links WIRED
479
- - No blocker anti-patterns
480
- - (Human verification items are OK — will be prompted)
481
-
482
- **Status: gaps_found**
483
- - One or more truths FAILED
484
- - OR one or more artifacts MISSING/STUB
485
- - OR one or more key links NOT_WIRED
486
- - OR blocker anti-patterns found
487
-
488
- **Status: human_needed**
489
- - All automated checks pass
490
- - BUT items flagged for human verification
491
- - Can't determine goal achievement without human
492
-
493
- **Calculate score:**
494
- ```
495
- score = (verified_truths / total_truths)
496
- ```
497
- </step>
498
-
499
- <step name="generate_fix_plans">
500
- **If gaps_found, recommend fix plans.**
501
-
502
- Group related gaps into fix plans:
503
-
504
- 1. **Identify gap clusters:**
505
- - API stub + component not wired → "Wire frontend to backend"
506
- - Multiple artifacts missing → "Complete core implementation"
507
- - Wiring issues only → "Connect existing components"
508
-
509
- 2. **Generate plan recommendations:**
510
-
511
- ```markdown
512
- ### {phase}-{next}-PLAN.md: {Fix Name}
513
-
514
- **Objective:** {What this fixes}
515
-
516
- **Tasks:**
517
- 1. {Task to fix gap 1}
518
- - Files: {files to modify}
519
- - Action: {specific fix}
520
- - Verify: {how to confirm fix}
521
-
522
- 2. {Task to fix gap 2}
523
- - Files: {files to modify}
524
- - Action: {specific fix}
525
- - Verify: {how to confirm fix}
526
-
527
- 3. Re-verify phase goal
528
- - Run verification again
529
- - Confirm all must-haves pass
530
-
531
- **Estimated scope:** {Small / Medium}
532
- ```
533
-
534
- 3. **Keep plans focused:**
535
- - Budget-aware grouping (target 25-45% per plan)
536
- - Single concern per plan
537
- - Include verification task
538
-
539
- 4. **Order by dependency:**
540
- - Fix missing artifacts before wiring
541
- - Fix stubs before integration
542
- - Verify after all fixes
543
- </step>
544
-
545
- <step name="create_report">
546
- **Generate VERIFICATION.md using template.**
547
-
548
- ```bash
549
- REPORT_PATH="$PHASE_DIR/${PHASE_NUM}-VERIFICATION.md"
550
- ```
551
-
552
- Fill template sections:
553
- 1. **Frontmatter:** phase, verified timestamp, status, score
554
- 2. **Goal Achievement:** Truth verification table
555
- 3. **Required Artifacts:** Artifact verification table
556
- 4. **Key Link Verification:** Wiring verification table
557
- 5. **Requirements Coverage:** If REQUIREMENTS.md exists
558
- 6. **Anti-Patterns Found:** Scan results table
559
- 7. **Human Verification Required:** Items needing human
560
- 8. **Gaps Summary:** Critical and non-critical gaps
561
- 9. **Recommended Fix Plans:** If gaps_found
562
- 10. **Verification Metadata:** Approach, timing, counts
563
-
564
- See ~/.claude/mindsystem/templates/verification-report.md for complete template.
565
- </step>
566
-
567
- <step name="return_to_orchestrator">
568
- **Return results to execute-phase orchestrator.**
569
-
570
- **Return format:**
571
-
572
- ```markdown
573
- ## Verification Complete
574
-
575
- **Status:** {passed | gaps_found | human_needed}
576
- **Score:** {N}/{M} must-haves verified
577
- **Report:** .planning/phases/{phase_dir}/{phase}-VERIFICATION.md
578
-
579
- {If passed:}
580
- All must-haves verified. Phase goal achieved. Ready to proceed.
581
-
582
- {If gaps_found:}
583
- ### Gaps Found
584
-
585
- {N} critical gaps blocking goal achievement:
586
- 1. {Gap 1 summary}
587
- 2. {Gap 2 summary}
588
-
589
- ### Recommended Fixes
590
-
591
- {N} fix plans recommended:
592
- 1. {phase}-{next}-PLAN.md: {name}
593
- 2. {phase}-{next+1}-PLAN.md: {name}
594
-
595
- {If human_needed:}
596
- ### Human Verification Required
597
-
598
- {N} items need human testing:
599
- 1. {Item 1}
600
- 2. {Item 2}
601
-
602
- Automated checks passed. Awaiting human verification.
603
- ```
604
-
605
- The orchestrator will:
606
- - If `passed`: Continue to update_roadmap
607
- - If `gaps_found`: Create and execute fix plans, then re-verify
608
- - If `human_needed`: Present items to user, collect responses
609
- </step>
610
-
611
- </process>
612
-
613
- <success_criteria>
614
- - [ ] Must-haves established (from plan ## Must-Haves section or derived)
615
- - [ ] All truths verified with status and evidence
616
- - [ ] All artifacts checked at all three levels
617
- - [ ] All key links verified
618
- - [ ] Requirements coverage assessed (if applicable)
619
- - [ ] Anti-patterns scanned and categorized
620
- - [ ] Human verification items identified
621
- - [ ] Overall status determined
622
- - [ ] Fix plans generated (if gaps_found)
623
- - [ ] VERIFICATION.md created with complete report
624
- - [ ] Results returned to orchestrator
625
- </success_criteria>