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.
@@ -36,7 +36,7 @@ PLAN.md IS the prompt that Claude executes. Plans are grouped into execution wav
36
36
 
37
37
  **Vertical slices over horizontal layers:** Group by feature (User: model + API + UI) not by type (all models → all APIs → all UIs).
38
38
 
39
- **Explicit dependencies:** Every plan declares what it needs (`depends_on`) and what it touches (`files_modified`). Empty dependencies = parallel candidate.
39
+ **Explicit dependencies:** EXECUTION-ORDER.md centralizes dependency and parallelism tracking. Plans with no dependencies = parallel candidates.
40
40
 
41
41
  **Secure by design:** Assume hostile input on every boundary. Validate, parameterize, authenticate, fail closed.
42
42
 
@@ -120,7 +120,7 @@ grep -l "status: diagnosed" "$PHASE_DIR"/*-UAT.md 2>/dev/null
120
120
 
121
121
  **2. Parse gaps:**
122
122
 
123
- **From VERIFICATION.md** (if exists): Parse `gaps:` from YAML frontmatter.
123
+ **From VERIFICATION.md** (if exists): Parse gaps from `## Gaps Summary` section (markdown format with `### Critical Gaps` and `### Non-Critical Gaps` subsections).
124
124
 
125
125
  **From UAT.md** (if exists with status: diagnosed): Parse gaps from `## Gaps` section (YAML format).
126
126
 
@@ -154,40 +154,49 @@ Cluster related gaps by:
154
154
  - Same concern (fetch + render → one "wire frontend" plan)
155
155
  - Dependency order (can't wire if artifact is stub → fix stub first)
156
156
 
157
- **6. Create gap closure tasks:**
157
+ **6. Create gap closure changes:**
158
158
 
159
- For each gap:
160
- ```xml
161
- <task name="{fix_description}" type="auto">
162
- <files>{artifact.path}</files>
163
- <action>
164
- {For each item in gap.missing:}
165
- - {missing item}
166
-
167
- Reference existing code: {from SUMMARYs}
168
- Gap reason: {gap.reason}
169
- </action>
170
- <verify>{How to confirm gap is closed}</verify>
171
- <done>{Observable truth now achievable}</done>
172
- </task>
159
+ For each gap, create a markdown change subsection:
160
+
161
+ ```markdown
162
+ ### N. {Fix description}
163
+ **Files:** `{artifact.path}`
164
+
165
+ {For each item in gap.missing:}
166
+ - {missing item}
167
+
168
+ Reference existing code: {from SUMMARYs}
169
+ Gap reason: {gap.reason}
173
170
  ```
174
171
 
175
172
  **7. Write PLAN.md files:**
176
173
 
177
- Use standard template but note gap closure context:
174
+ Use pure markdown plan format with gap closure context:
178
175
 
179
- ```yaml
180
- ---
181
- phase: XX-name
182
- plan: NN # Sequential after existing
183
- type: execute
184
- wave: 1 # Gap closures typically single wave
185
- depends_on: [] # Usually independent of each other
186
- files_modified: [...]
187
- gap_closure: true # Flag for tracking
188
- ---
176
+ ```markdown
177
+ # Plan NN: {Gap closure description}
178
+
179
+ **Subsystem:** {subsystem} | **Type:** execute
180
+
181
+ ## Context
182
+ Gap closure for phase XX. Addresses gaps identified by verification.
183
+
184
+ ## Changes
185
+
186
+ ### 1. {Fix description}
187
+ **Files:** `{artifact.path}`
188
+
189
+ {Implementation details from gap.missing items}
190
+
191
+ ## Verification
192
+ - {How to confirm gap is closed}
193
+
194
+ ## Must-Haves
195
+ - [ ] {Observable truth now achievable}
189
196
  ```
190
197
 
198
+ Also create or update EXECUTION-ORDER.md to include gap closure plans (typically single wave, independent of each other).
199
+
191
200
  **9. Present gap closure summary:**
192
201
 
193
202
  ```markdown
@@ -432,7 +441,7 @@ cat .planning/phases/XX-name/${PHASE}-DESIGN.md 2>/dev/null
432
441
  **If DESIGN.md exists:**
433
442
  - Tasks reference specific screens/components from design
434
443
  - Verification criteria include design verification items
435
- - must_haves include design-specified observable behaviors
444
+ - Must-Haves include design-specified observable behaviors
436
445
  - Task actions specify exact values (colors, spacing) from design
437
446
 
438
447
  **If none exist:** Suggest /ms:research-phase for niche domains, /ms:discuss-phase for simpler domains, or proceed with roadmap only.
@@ -573,10 +582,10 @@ Task(
573
582
  The subagent handles:
574
583
  - Building dependency graph from needs/creates
575
584
  - Assigning wave numbers
576
- - Grouping tasks into plans (2-3 per plan)
577
- - Deriving must_haves (goal-backward)
585
+ - Grouping tasks into plans (2-3 changes per plan)
586
+ - Deriving Must-Haves (goal-backward)
578
587
  - Estimating scope, splitting if needed
579
- - Writing PLAN.md files
588
+ - Writing PLAN.md files + EXECUTION-ORDER.md
580
589
  - Git commit
581
590
  - Calculating risk score
582
591
  </step>
@@ -744,10 +753,10 @@ Tasks are instructions for Claude, not Jira tickets.
744
753
  - [ ] Prior decisions, issues, concerns synthesized
745
754
  - [ ] Tasks identified with needs/creates dependencies
746
755
  - [ ] Task list handed off to ms-plan-writer
747
- - [ ] PLAN file(s) created by subagent with XML structure
748
- - [ ] Each plan: depends_on, files_modified in frontmatter
749
- - [ ] Each plan: must_haves derived (truths, artifacts, key_links)
750
- - [ ] Each plan: 2-3 tasks (~50% context)
756
+ - [ ] PLAN file(s) created with pure markdown format
757
+ - [ ] EXECUTION-ORDER.md created with wave groups
758
+ - [ ] Each plan: Must-Haves section with observable truths
759
+ - [ ] Each plan: 2-3 changes (~50% context)
751
760
  - [ ] Wave structure maximizes parallelism
752
761
  - [ ] PLAN file(s) committed to git
753
762
  - [ ] Risk assessment presented (score + top factors)
@@ -759,8 +768,8 @@ Tasks are instructions for Claude, not Jira tickets.
759
768
  - [ ] Existing SUMMARYs read for context
760
769
  - [ ] Gaps clustered into focused plans
761
770
  - [ ] Plan numbers sequential after existing (04, 05...)
762
- - [ ] PLAN file(s) exist with gap_closure: true
763
- - [ ] Each plan: tasks derived from gap.missing items
771
+ - [ ] PLAN file(s) created with pure markdown format
772
+ - [ ] EXECUTION-ORDER.md updated with gap closure plans
764
773
  - [ ] PLAN file(s) committed to git
765
774
  - [ ] User knows to run `/ms:execute-phase {X}` next
766
775
  </success_criteria>
@@ -42,7 +42,7 @@ grep -E "^| ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null
42
42
  # All SUMMARY files (claims to verify)
43
43
  ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
44
44
 
45
- # All PLAN files (for must_haves in frontmatter)
45
+ # All PLAN files (for Must-Haves in plan markdown)
46
46
  ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
47
47
  ```
48
48
 
@@ -54,32 +54,28 @@ ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
54
54
  <step name="establish_must_haves">
55
55
  **Determine what must be verified.**
56
56
 
57
- **Option A: Must-haves in PLAN frontmatter**
57
+ **Option A: Must-haves in plan markdown**
58
58
 
59
- Check if any PLAN.md has `must_haves` in frontmatter:
59
+ Check if any PLAN.md has a `## Must-Haves` section:
60
60
 
61
61
  ```bash
62
- grep -l "must_haves:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
62
+ grep -l "## Must-Haves" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
63
63
  ```
64
64
 
65
- If found, extract and use:
66
- ```yaml
67
- must_haves:
68
- truths:
69
- - "User can see existing messages"
70
- - "User can send a message"
71
- artifacts:
72
- - path: "src/components/Chat.tsx"
73
- provides: "Message list rendering"
74
- key_links:
75
- - from: "Chat.tsx"
76
- to: "api/chat"
77
- via: "fetch in useEffect"
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
78
72
  ```
79
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
+
80
76
  **Option B: Derive from phase goal**
81
77
 
82
- If no must_haves in frontmatter, derive using goal-backward process:
78
+ If no `## Must-Haves` section found in plans, derive using goal-backward process:
83
79
 
84
80
  1. **State the goal:** Take phase goal from ROADMAP.md
85
81
 
@@ -370,7 +366,7 @@ verify_state_render_link() {
370
366
 
371
367
  ### Aggregate key link results
372
368
 
373
- For each key link in must_haves:
369
+ For each key link derived from plan `## Changes` and `## Must-Haves` sections:
374
370
  - Run appropriate verification function
375
371
  - Record status and evidence
376
372
  - WIRED / PARTIAL / STUB / NOT_WIRED
@@ -615,7 +611,7 @@ The orchestrator will:
615
611
  </process>
616
612
 
617
613
  <success_criteria>
618
- - [ ] Must-haves established (from frontmatter or derived)
614
+ - [ ] Must-haves established (from plan ## Must-Haves section or derived)
619
615
  - [ ] All truths verified with status and evidence
620
616
  - [ ] All artifacts checked at all three levels
621
617
  - [ ] All key links verified
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindsystem-cc",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.",
5
5
  "bin": {
6
6
  "mindsystem-cc": "bin/install.js"
@@ -0,0 +1,59 @@
1
+ #!/bin/bash
2
+ #
3
+ # update-state.sh
4
+ # Updates .planning/STATE.md Plan and Status lines based on plan progress.
5
+ # Idempotent — same arguments produce the same result.
6
+ #
7
+ # Usage: ./scripts/update-state.sh <completed_plan_count> <total_plans>
8
+ # Example: ./scripts/update-state.sh 2 4
9
+ # (2 of 4 plans complete)
10
+ #
11
+
12
+ set -e
13
+
14
+ # --- Validation ---
15
+ if [ -z "$1" ] || [ -z "$2" ]; then
16
+ echo "Error: Two arguments required"
17
+ echo "Usage: $0 <completed_plan_count> <total_plans>"
18
+ exit 1
19
+ fi
20
+
21
+ COMPLETED="$1"
22
+ TOTAL="$2"
23
+
24
+ if ! [[ "$COMPLETED" =~ ^[0-9]+$ ]] || ! [[ "$TOTAL" =~ ^[0-9]+$ ]]; then
25
+ echo "Error: Both arguments must be numeric"
26
+ echo "Usage: $0 <completed_plan_count> <total_plans>"
27
+ exit 1
28
+ fi
29
+
30
+ if [ "$COMPLETED" -gt "$TOTAL" ]; then
31
+ echo "Error: Completed ($COMPLETED) cannot exceed total ($TOTAL)"
32
+ exit 1
33
+ fi
34
+
35
+ # --- Find STATE.md from git root ---
36
+ GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
37
+ if [ -z "$GIT_ROOT" ]; then
38
+ echo "Error: Not in a git repository"
39
+ exit 1
40
+ fi
41
+
42
+ STATE_FILE="$GIT_ROOT/.planning/STATE.md"
43
+ if [ ! -f "$STATE_FILE" ]; then
44
+ echo "Error: STATE.md not found at $STATE_FILE"
45
+ exit 1
46
+ fi
47
+
48
+ # --- Update Plan line ---
49
+ sed -i '' "s/^Plan:.*/Plan: $COMPLETED of $TOTAL complete in current phase/" "$STATE_FILE"
50
+
51
+ # --- Update Status line ---
52
+ if [ "$COMPLETED" -eq "$TOTAL" ]; then
53
+ sed -i '' "s/^Status:.*/Status: All plans executed, pending verification/" "$STATE_FILE"
54
+ else
55
+ sed -i '' "s/^Status:.*/Status: In progress — plan $COMPLETED of $TOTAL complete/" "$STATE_FILE"
56
+ fi
57
+
58
+ echo "STATE.md updated: $COMPLETED of $TOTAL plans complete"
59
+ exit 0
@@ -0,0 +1,102 @@
1
+ #!/bin/bash
2
+ #
3
+ # validate-execution-order.sh
4
+ # Validates EXECUTION-ORDER.md against plan files in a phase directory.
5
+ # Checks bidirectional consistency and warns about file conflicts within waves.
6
+ #
7
+ # Usage: ./scripts/validate-execution-order.sh <phase_directory>
8
+ # Example: ./scripts/validate-execution-order.sh .planning/phases/03-auth
9
+ #
10
+
11
+ set -e
12
+
13
+ # --- Validation ---
14
+ if [ -z "$1" ]; then
15
+ echo "Error: Phase directory required"
16
+ echo "Usage: $0 <phase_directory>"
17
+ exit 1
18
+ fi
19
+
20
+ PHASE_DIR="$1"
21
+
22
+ if [ ! -d "$PHASE_DIR" ]; then
23
+ echo "FAIL: Directory does not exist: $PHASE_DIR"
24
+ exit 1
25
+ fi
26
+
27
+ EXEC_ORDER="$PHASE_DIR/EXECUTION-ORDER.md"
28
+ if [ ! -f "$EXEC_ORDER" ]; then
29
+ echo "FAIL: EXECUTION-ORDER.md not found in $PHASE_DIR"
30
+ exit 1
31
+ fi
32
+
33
+ # --- Collect plan files on disk ---
34
+ DISK_PLANS=$(ls -1 "$PHASE_DIR"/*-PLAN.md 2>/dev/null | xargs -I{} basename {} | sort)
35
+ DISK_COUNT=$(echo "$DISK_PLANS" | grep -c . 2>/dev/null || echo 0)
36
+
37
+ if [ "$DISK_COUNT" -eq 0 ]; then
38
+ echo "FAIL: No *-PLAN.md files found in $PHASE_DIR"
39
+ exit 1
40
+ fi
41
+
42
+ # --- Parse EXECUTION-ORDER.md for plan filenames ---
43
+ ORDER_PLANS=$(grep -oE '[0-9]+-PLAN\.md' "$EXEC_ORDER" | sort -u)
44
+ ORDER_COUNT=$(echo "$ORDER_PLANS" | grep -c . 2>/dev/null || echo 0)
45
+
46
+ # --- Check 1: Every disk plan is listed in EXECUTION-ORDER.md ---
47
+ ERRORS=""
48
+ while IFS= read -r plan; do
49
+ if ! echo "$ORDER_PLANS" | grep -qx "$plan"; then
50
+ ERRORS="${ERRORS} Missing from EXECUTION-ORDER.md: $plan\n"
51
+ fi
52
+ done <<< "$DISK_PLANS"
53
+
54
+ # --- Check 2: Every plan in EXECUTION-ORDER.md exists on disk ---
55
+ while IFS= read -r plan; do
56
+ if ! echo "$DISK_PLANS" | grep -qx "$plan"; then
57
+ ERRORS="${ERRORS} Listed in EXECUTION-ORDER.md but file missing: $plan\n"
58
+ fi
59
+ done <<< "$ORDER_PLANS"
60
+
61
+ if [ -n "$ERRORS" ]; then
62
+ echo "FAIL: Plan/execution-order mismatch"
63
+ printf "%b" "$ERRORS"
64
+ exit 1
65
+ fi
66
+
67
+ # --- Check 3 (warning): File conflicts within waves ---
68
+ CURRENT_WAVE=""
69
+ WAVE_COUNT=0
70
+ declare -A WAVE_FILES
71
+
72
+ while IFS= read -r line; do
73
+ if echo "$line" | grep -qE '^## Wave [0-9]+'; then
74
+ CURRENT_WAVE=$(echo "$line" | grep -oE '[0-9]+')
75
+ WAVE_COUNT=$((WAVE_COUNT + 1))
76
+ WAVE_FILES[$CURRENT_WAVE]=""
77
+ elif [ -n "$CURRENT_WAVE" ]; then
78
+ PLAN_FILE=$(echo "$line" | grep -oE '[0-9]+-PLAN\.md' || true)
79
+ if [ -n "$PLAN_FILE" ] && [ -f "$PHASE_DIR/$PLAN_FILE" ]; then
80
+ # Extract **Files:** lines from plan
81
+ FILE_PATHS=$(grep -E '^\*\*Files:\*\*' "$PHASE_DIR/$PLAN_FILE" | sed 's/\*\*Files:\*\*//g' | tr ',' '\n' | sed 's/`//g; s/^[[:space:]]*//; s/[[:space:]]*$//' | grep -v '^$' || true)
82
+ while IFS= read -r fpath; do
83
+ [ -z "$fpath" ] && continue
84
+ EXISTING="${WAVE_FILES[$CURRENT_WAVE]}"
85
+ if echo "$EXISTING" | grep -qF "|$fpath|"; then
86
+ echo "WARNING: File '$fpath' appears in multiple plans within Wave $CURRENT_WAVE"
87
+ else
88
+ WAVE_FILES[$CURRENT_WAVE]="${EXISTING}|$fpath|"
89
+ fi
90
+ done <<< "$FILE_PATHS"
91
+ fi
92
+ fi
93
+ done < "$EXEC_ORDER"
94
+
95
+ # --- Handle edge case: no waves parsed ---
96
+ if [ "$WAVE_COUNT" -eq 0 ]; then
97
+ echo "FAIL: No '## Wave N' headers found in EXECUTION-ORDER.md"
98
+ exit 1
99
+ fi
100
+
101
+ echo "PASS: $DISK_COUNT plans across $WAVE_COUNT waves"
102
+ exit 0
@@ -24,11 +24,12 @@ Comprehensive guidelines for Flutter/Dart code quality, widget organization, and
24
24
 
25
25
  Fetch fresh guidelines before each review:
26
26
 
27
- ```
28
- https://gist.githubusercontent.com/rolandtolnay/edf9ea7d5adf218f45accb3411f0627c/raw/flutter-code-quality-guidelines.md
27
+ ```bash
28
+ gh api /gists/edf9ea7d5adf218f45accb3411f0627c \
29
+ --jq '.files["flutter-code-quality-guidelines.md"].content'
29
30
  ```
30
31
 
31
- Use WebFetch to retrieve. Contains: anti-patterns, widget patterns, state management, collections, hooks, theme/styling, etc.
32
+ Never use WebFetch for gist content — it summarizes instead of returning raw text. Contains: anti-patterns, widget patterns, state management, collections, hooks, theme/styling, etc.
32
33
 
33
34
  ## Widget Organization Guidelines (Embedded)
34
35