mindsystem-cc 3.12.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.
@@ -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,30 +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
- </context>
174
-
175
- <success_criteria>
176
- - [ ] All tasks executed
177
- - [ ] Each task committed individually
178
- - [ ] SUMMARY.md created in plan directory
179
- - [ ] STATE.md updated with position and decisions
180
- </success_criteria>
181
- "
163
+ prompt="Execute plan at {plan_path}\n\nPlan: @{plan_path}\nProject state: @.planning/STATE.md"
182
164
  )
183
165
  ```
184
166
 
@@ -215,7 +197,14 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel.
215
197
  - Bad: "Wave 2 complete. Proceeding to Wave 3."
216
198
  - Good: "Terrain system complete — 3 biome types, height-based texturing, physics collision meshes. Vehicle physics (Wave 3) can now reference ground surfaces."
217
199
 
218
- 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:**
219
208
 
220
209
  If any agent in wave fails:
221
210
  - Report which plan failed and why
@@ -223,7 +212,7 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel.
223
212
  - If continue: proceed to next wave (dependent plans may also fail)
224
213
  - If stop: exit with partial completion report
225
214
 
226
- 5. **Proceed to next wave**
215
+ 6. **Proceed to next wave**
227
216
 
228
217
  </step>
229
218
 
@@ -334,7 +323,7 @@ Task(
334
323
  Phase directory: {phase_dir}
335
324
  Phase goal: {goal from ROADMAP.md}
336
325
 
337
- Check must_haves against actual codebase. Create VERIFICATION.md.
326
+ Check Must-Haves against actual codebase. Create VERIFICATION.md.
338
327
  Verify what actually exists in the code.",
339
328
  subagent_type="ms-verifier"
340
329
  )
@@ -463,12 +452,46 @@ Update ROADMAP.md to reflect phase completion:
463
452
 
464
453
  Commit phase completion (roadmap, state, verification):
465
454
  ```bash
466
- 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
467
456
  git add .planning/REQUIREMENTS.md # if updated
468
457
  git commit -m "docs(phase-{X}): complete phase execution"
469
458
  ```
470
459
  </step>
471
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
+
472
495
  <step name="offer_next">
473
496
  Present next steps based on milestone status.
474
497
 
@@ -493,9 +516,8 @@ Read `~/.claude/mindsystem/references/routing/milestone-complete-routing.md` and
493
516
  **Why this works:**
494
517
 
495
518
  Orchestrator context usage: ~10-15%
496
- - Read plan frontmatter (small)
497
- - Analyze dependencies (logic, no heavy reads)
498
- - Fill template strings
519
+ - Read EXECUTION-ORDER.md (one small file)
520
+ - Parse wave structure
499
521
  - Spawn Task calls
500
522
  - Collect results
501
523
 
@@ -503,7 +525,7 @@ Each subagent: Fresh 200k context
503
525
  - Loads full execute-plan workflow
504
526
  - Loads templates, references
505
527
  - Executes plan with full capacity
506
- - Creates SUMMARY, commits
528
+ - Creates SUMMARY (orchestrator commits)
507
529
 
508
530
  **No polling.** Task tool blocks until completion. No TaskOutput loops.
509
531
 
@@ -542,5 +564,5 @@ If phase execution was interrupted (context limit, user exit, error):
542
564
 
543
565
  **STATE.md tracks:**
544
566
  - Last completed plan
545
- - Current wave
567
+ - Completed plans (via SUMMARY.md existence)
546
568
  </resumption>