mindsystem-cc 3.11.0 → 3.13.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 (35) hide show
  1. package/agents/ms-consolidator.md +4 -4
  2. package/agents/ms-executor.md +19 -351
  3. package/agents/ms-flutter-code-quality.md +7 -6
  4. package/agents/ms-plan-checker.md +170 -175
  5. package/agents/ms-plan-writer.md +121 -125
  6. package/agents/ms-roadmapper.md +1 -18
  7. package/agents/ms-verifier.md +22 -18
  8. package/commands/ms/check-phase.md +3 -3
  9. package/commands/ms/design-phase.md +2 -9
  10. package/commands/ms/execute-phase.md +8 -6
  11. package/commands/ms/help.md +0 -5
  12. package/commands/ms/new-project.md +3 -40
  13. package/commands/ms/plan-phase.md +4 -3
  14. package/commands/ms/review-design.md +1 -8
  15. package/mindsystem/references/goal-backward.md +10 -25
  16. package/mindsystem/references/plan-format.md +326 -247
  17. package/mindsystem/references/scope-estimation.md +29 -57
  18. package/mindsystem/references/tdd-execution.md +70 -0
  19. package/mindsystem/references/tdd.md +53 -194
  20. package/mindsystem/templates/config.json +0 -11
  21. package/mindsystem/templates/phase-prompt.md +51 -367
  22. package/mindsystem/templates/roadmap.md +2 -2
  23. package/mindsystem/templates/verification-report.md +2 -2
  24. package/mindsystem/workflows/adhoc.md +16 -21
  25. package/mindsystem/workflows/execute-phase.md +71 -50
  26. package/mindsystem/workflows/execute-plan.md +183 -1060
  27. package/mindsystem/workflows/mockup-generation.md +10 -4
  28. package/mindsystem/workflows/plan-phase.md +56 -75
  29. package/mindsystem/workflows/transition.md +1 -10
  30. package/mindsystem/workflows/verify-phase.md +16 -20
  31. package/package.json +1 -1
  32. package/scripts/update-state.sh +59 -0
  33. package/scripts/validate-execution-order.sh +102 -0
  34. package/skills/flutter-code-quality/SKILL.md +4 -3
  35. package/mindsystem/templates/summary.md +0 -293
@@ -3,7 +3,7 @@ Execute all plans in a phase using wave-based parallel execution. Orchestrator s
3
3
  </purpose>
4
4
 
5
5
  <core_principle>
6
- The orchestrator's job is coordination, not execution. Each subagent loads the full execute-plan context itself. Orchestrator discovers plans, analyzes dependencies, groups into waves, spawns agents, collects results.
6
+ The orchestrator's job is coordination, not execution. Each subagent loads the full execute-plan context itself. Orchestrator discovers plans, reads execution order from EXECUTION-ORDER.md, spawns agents in waves, collects results.
7
7
  </core_principle>
8
8
 
9
9
  <required_reading>
@@ -56,7 +56,7 @@ Report: "Found {N} plans in {phase_dir}"
56
56
  </step>
57
57
 
58
58
  <step name="discover_plans">
59
- List all plans and extract metadata:
59
+ List all plans and check completion:
60
60
 
61
61
  ```bash
62
62
  # Get all plans
@@ -64,32 +64,35 @@ ls -1 "$PHASE_DIR"/*-PLAN.md 2>/dev/null | sort
64
64
 
65
65
  # Get completed plans (have SUMMARY.md)
66
66
  ls -1 "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null | sort
67
- ```
68
67
 
69
- For each plan, read frontmatter to extract:
70
- - `wave: N` - Execution wave (pre-computed)
68
+ # Verify EXECUTION-ORDER.md exists
69
+ ls "$PHASE_DIR"/EXECUTION-ORDER.md
70
+ ```
71
71
 
72
72
  Build plan inventory:
73
73
  - Plan path
74
74
  - Plan ID (e.g., "03-01")
75
- - Wave number
76
75
  - Completion status (SUMMARY exists = complete)
77
76
 
78
77
  Skip completed plans. If all complete, report "Phase already executed" and exit.
79
78
  </step>
80
79
 
81
- <step name="group_by_wave">
82
- Read `wave` from each plan's frontmatter and group by wave number:
80
+ <step name="validate_execution_order">
81
+ Run validation before launching executors:
83
82
 
84
83
  ```bash
85
- # For each plan, extract wave from frontmatter
86
- for plan in $PHASE_DIR/*-PLAN.md; do
87
- wave=$(grep "^wave:" "$plan" | cut -d: -f2 | tr -d ' ')
88
- echo "$plan:$wave"
89
- done
84
+ ~/.claude/mindsystem/scripts/validate-execution-order.sh "$PHASE_DIR"
90
85
  ```
91
86
 
92
- **Group plans:**
87
+ If validation fails (exit 1), stop execution and report the mismatch to user.
88
+ If validation passes, proceed with wave execution.
89
+ </step>
90
+
91
+ <step name="read_execution_order">
92
+ Read EXECUTION-ORDER.md and parse wave structure:
93
+
94
+ Parse `## Wave N` headers with `- XX-PLAN.md` items under each. Build wave groups:
95
+
93
96
  ```
94
97
  waves = {
95
98
  1: [plan-01, plan-02],
@@ -98,7 +101,9 @@ waves = {
98
101
  }
99
102
  ```
100
103
 
101
- **No dependency analysis needed.** Wave numbers are pre-computed during `/ms:plan-phase`.
104
+ Filter out completed plans (those with existing SUMMARY.md).
105
+
106
+ **Wave assignments come from EXECUTION-ORDER.md**, produced during `/ms:plan-phase`.
102
107
 
103
108
  Report wave structure with context:
104
109
  ```
@@ -124,7 +129,7 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel.
124
129
 
125
130
  1. **Describe what's being built (BEFORE spawning):**
126
131
 
127
- Read each plan's `<objective>` section. Extract what's being built and why it matters.
132
+ Read each plan's `## Context` section. Extract what's being built and why it matters.
128
133
 
129
134
  **Output:**
130
135
  ```
@@ -155,31 +160,7 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel.
155
160
  ```
156
161
  Task(
157
162
  subagent_type="ms-executor",
158
- prompt="
159
- <objective>
160
- Execute plan {plan_number} of phase {phase_number}-{phase_name}.
161
- Commit each task atomically. Create SUMMARY.md. Update STATE.md.
162
- </objective>
163
-
164
- <execution_context>
165
- @~/.claude/mindsystem/workflows/execute-plan.md
166
- @~/.claude/mindsystem/templates/summary.md
167
- @~/.claude/mindsystem/references/tdd.md
168
- </execution_context>
169
-
170
- <context>
171
- Plan: @{plan_path}
172
- Project state: @.planning/STATE.md
173
- Config: @.planning/config.json (if exists)
174
- </context>
175
-
176
- <success_criteria>
177
- - [ ] All tasks executed
178
- - [ ] Each task committed individually
179
- - [ ] SUMMARY.md created in plan directory
180
- - [ ] STATE.md updated with position and decisions
181
- </success_criteria>
182
- "
163
+ prompt="Execute plan at {plan_path}\n\nPlan: @{plan_path}\nProject state: @.planning/STATE.md"
183
164
  )
184
165
  ```
185
166
 
@@ -216,7 +197,14 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel.
216
197
  - Bad: "Wave 2 complete. Proceeding to Wave 3."
217
198
  - Good: "Terrain system complete — 3 biome types, height-based texturing, physics collision meshes. Vehicle physics (Wave 3) can now reference ground surfaces."
218
199
 
219
- 4. **Handle failures:**
200
+ 4. **Update state:**
201
+
202
+ After reporting wave completion, update STATE.md with progress:
203
+ ```bash
204
+ ~/.claude/mindsystem/scripts/update-state.sh {completed_count} {total_count}
205
+ ```
206
+
207
+ 5. **Handle failures:**
220
208
 
221
209
  If any agent in wave fails:
222
210
  - Report which plan failed and why
@@ -224,7 +212,7 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel.
224
212
  - If continue: proceed to next wave (dependent plans may also fail)
225
213
  - If stop: exit with partial completion report
226
214
 
227
- 5. **Proceed to next wave**
215
+ 6. **Proceed to next wave**
228
216
 
229
217
  </step>
230
218
 
@@ -335,7 +323,7 @@ Task(
335
323
  Phase directory: {phase_dir}
336
324
  Phase goal: {goal from ROADMAP.md}
337
325
 
338
- Check must_haves against actual codebase. Create VERIFICATION.md.
326
+ Check Must-Haves against actual codebase. Create VERIFICATION.md.
339
327
  Verify what actually exists in the code.",
340
328
  subagent_type="ms-verifier"
341
329
  )
@@ -464,12 +452,46 @@ Update ROADMAP.md to reflect phase completion:
464
452
 
465
453
  Commit phase completion (roadmap, state, verification):
466
454
  ```bash
467
- git add .planning/ROADMAP.md .planning/STATE.md .planning/phases/{phase_dir}/*-VERIFICATION.md
455
+ git add .planning/ROADMAP.md .planning/STATE.md .planning/phases/{phase_dir}/*-VERIFICATION.md .planning/phases/{phase_dir}/*-SUMMARY.md
468
456
  git add .planning/REQUIREMENTS.md # if updated
469
457
  git commit -m "docs(phase-{X}): complete phase execution"
470
458
  ```
471
459
  </step>
472
460
 
461
+ <step name="update_codebase_map">
462
+ **If `.planning/codebase/` exists:**
463
+
464
+ Check what changed during this phase:
465
+
466
+ ```bash
467
+ # Get all source changes from this phase's commits
468
+ PHASE_COMMITS=$(git log --oneline --grep="({phase_number}-" --format="%H" | head -20)
469
+ if [ -n "$PHASE_COMMITS" ]; then
470
+ FIRST=$(echo "$PHASE_COMMITS" | tail -1)
471
+ git diff --name-only ${FIRST}^..HEAD 2>/dev/null | grep -v "^\.planning/"
472
+ fi
473
+ ```
474
+
475
+ **Update only if structural changes occurred:**
476
+
477
+ | Change Detected | Update Action |
478
+ |-----------------|---------------|
479
+ | New directory in src/ | STRUCTURE.md: Add to directory layout |
480
+ | package.json deps changed | STACK.md: Add/remove from dependencies list |
481
+ | New file pattern (e.g., first .test.ts) | CONVENTIONS.md: Note new pattern |
482
+ | New external API client | INTEGRATIONS.md: Add service entry |
483
+ | Config file added/changed | STACK.md: Update configuration section |
484
+
485
+ **Skip update if only:** Code changes within existing files, bug fixes, content changes.
486
+
487
+ Make single targeted edits — add a bullet, update a path, remove a stale entry.
488
+
489
+ ```bash
490
+ git add .planning/codebase/*.md
491
+ git commit -m "docs: update codebase map after phase {X}"
492
+ ```
493
+ </step>
494
+
473
495
  <step name="offer_next">
474
496
  Present next steps based on milestone status.
475
497
 
@@ -494,9 +516,8 @@ Read `~/.claude/mindsystem/references/routing/milestone-complete-routing.md` and
494
516
  **Why this works:**
495
517
 
496
518
  Orchestrator context usage: ~10-15%
497
- - Read plan frontmatter (small)
498
- - Analyze dependencies (logic, no heavy reads)
499
- - Fill template strings
519
+ - Read EXECUTION-ORDER.md (one small file)
520
+ - Parse wave structure
500
521
  - Spawn Task calls
501
522
  - Collect results
502
523
 
@@ -504,7 +525,7 @@ Each subagent: Fresh 200k context
504
525
  - Loads full execute-plan workflow
505
526
  - Loads templates, references
506
527
  - Executes plan with full capacity
507
- - Creates SUMMARY, commits
528
+ - Creates SUMMARY (orchestrator commits)
508
529
 
509
530
  **No polling.** Task tool blocks until completion. No TaskOutput loops.
510
531
 
@@ -543,5 +564,5 @@ If phase execution was interrupted (context limit, user exit, error):
543
564
 
544
565
  **STATE.md tracks:**
545
566
  - Last completed plan
546
- - Current wave
567
+ - Completed plans (via SUMMARY.md existence)
547
568
  </resumption>