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.
- package/agents/ms-consolidator.md +4 -4
- package/agents/ms-executor.md +19 -351
- package/agents/ms-flutter-code-quality.md +7 -6
- package/agents/ms-plan-checker.md +170 -175
- package/agents/ms-plan-writer.md +121 -125
- package/agents/ms-roadmapper.md +1 -18
- package/agents/ms-verifier.md +22 -18
- package/commands/ms/check-phase.md +3 -3
- package/commands/ms/design-phase.md +2 -9
- package/commands/ms/execute-phase.md +8 -6
- package/commands/ms/help.md +0 -5
- package/commands/ms/new-project.md +3 -40
- package/commands/ms/plan-phase.md +4 -3
- package/commands/ms/review-design.md +1 -8
- package/mindsystem/references/goal-backward.md +10 -25
- package/mindsystem/references/plan-format.md +326 -247
- package/mindsystem/references/scope-estimation.md +29 -57
- package/mindsystem/references/tdd-execution.md +70 -0
- package/mindsystem/references/tdd.md +53 -194
- package/mindsystem/templates/config.json +0 -11
- package/mindsystem/templates/phase-prompt.md +51 -367
- package/mindsystem/templates/roadmap.md +2 -2
- package/mindsystem/templates/verification-report.md +2 -2
- package/mindsystem/workflows/adhoc.md +16 -21
- package/mindsystem/workflows/execute-phase.md +71 -50
- package/mindsystem/workflows/execute-plan.md +183 -1060
- package/mindsystem/workflows/mockup-generation.md +10 -4
- package/mindsystem/workflows/plan-phase.md +56 -75
- package/mindsystem/workflows/transition.md +1 -10
- package/mindsystem/workflows/verify-phase.md +16 -20
- package/package.json +1 -1
- package/scripts/update-state.sh +59 -0
- package/scripts/validate-execution-order.sh +102 -0
- package/skills/flutter-code-quality/SKILL.md +4 -3
- package/mindsystem/templates/summary.md +0 -293
|
@@ -87,16 +87,22 @@ Task(prompt=assembled_context, subagent_type="ms-mockup-designer", description="
|
|
|
87
87
|
</step>
|
|
88
88
|
|
|
89
89
|
<step name="present_mockups">
|
|
90
|
-
After all 3 agents return,
|
|
90
|
+
After all 3 agents return, generate comparison page and open it:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
uv run ~/.claude/mindsystem/scripts/compare_mockups.py "${PHASE_DIR}/mockups"
|
|
94
|
+
open "${PHASE_DIR}/mockups/comparison.html"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Display summary:
|
|
91
98
|
|
|
92
99
|
```markdown
|
|
93
|
-
3 mockup variants generated
|
|
100
|
+
3 mockup variants generated — comparison page opened in browser.
|
|
94
101
|
|
|
102
|
+
Individual variants for reference:
|
|
95
103
|
- **A: {Direction A name}** — `.planning/phases/{phase}-{slug}/mockups/variant-a.html`
|
|
96
104
|
- **B: {Direction B name}** — `.planning/phases/{phase}-{slug}/mockups/variant-b.html`
|
|
97
105
|
- **C: {Direction C name}** — `.planning/phases/{phase}-{slug}/mockups/variant-c.html`
|
|
98
|
-
|
|
99
|
-
Open these in your browser to compare.
|
|
100
106
|
```
|
|
101
107
|
|
|
102
108
|
Use AskUserQuestion:
|
|
@@ -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:**
|
|
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
|
|
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
|
|
157
|
+
**6. Create gap closure changes:**
|
|
158
158
|
|
|
159
|
-
For each gap:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
|
174
|
+
Use pure markdown plan format with gap closure context:
|
|
178
175
|
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
-
|
|
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.
|
|
@@ -494,43 +503,16 @@ External service indicators:
|
|
|
494
503
|
Note external services for risk scoring.
|
|
495
504
|
|
|
496
505
|
<output_format>
|
|
497
|
-
**
|
|
506
|
+
**Present a concise numbered task summary for the user:**
|
|
498
507
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
<creates>src/models/user.ts</creates>
|
|
506
|
-
<tdd_candidate>false</tdd_candidate>
|
|
507
|
-
<action_hint>Define User type with id, email, createdAt</action_hint>
|
|
508
|
-
<verify_hint>tsc --noEmit passes</verify_hint>
|
|
509
|
-
<done_hint>User type exportable</done_hint>
|
|
510
|
-
</task>
|
|
511
|
-
<task id="2">
|
|
512
|
-
<name>Create login endpoint</name>
|
|
513
|
-
<type>auto</type>
|
|
514
|
-
<needs>src/models/user.ts</needs>
|
|
515
|
-
<creates>src/app/api/auth/login/route.ts</creates>
|
|
516
|
-
<tdd_candidate>true</tdd_candidate>
|
|
517
|
-
<action_hint>POST endpoint with bcrypt validation</action_hint>
|
|
518
|
-
<verify_hint>curl returns 200 with valid credentials</verify_hint>
|
|
519
|
-
<done_hint>Login works with valid credentials</done_hint>
|
|
520
|
-
</task>
|
|
521
|
-
</task_list>
|
|
522
|
-
```
|
|
508
|
+
### Tasks Identified
|
|
509
|
+
|
|
510
|
+
1. **Create User model** → `src/models/user.ts` (no dependencies)
|
|
511
|
+
2. **Create login endpoint** → `src/app/api/auth/login/route.ts` (needs: Task 1) [TDD]
|
|
512
|
+
|
|
513
|
+
Format: numbered list with task name, key files, dependency hint, and `[TDD]` flag if applicable. No XML.
|
|
523
514
|
|
|
524
|
-
|
|
525
|
-
- `id`: Sequential identifier
|
|
526
|
-
- `name`: Action-oriented task name
|
|
527
|
-
- `type`: auto
|
|
528
|
-
- `needs`: Files/types this task requires (or "nothing")
|
|
529
|
-
- `creates`: Files/types this task produces (or "nothing")
|
|
530
|
-
- `tdd_candidate`: true if should be TDD plan
|
|
531
|
-
- `action_hint`: Brief implementation guidance (subagent expands)
|
|
532
|
-
- `verify_hint`: How to verify completion
|
|
533
|
-
- `done_hint`: Acceptance criteria
|
|
515
|
+
**Retain full task details internally.** For each task, maintain in your analysis: id, name, type, needs, creates, tdd_candidate, action_hint, verify_hint, done_hint. These are needed for the handoff step — they just don't need to be displayed.
|
|
534
516
|
</output_format>
|
|
535
517
|
</step>
|
|
536
518
|
|
|
@@ -545,7 +527,7 @@ Assemble handoff payload:
|
|
|
545
527
|
|
|
546
528
|
```xml
|
|
547
529
|
<task_list>
|
|
548
|
-
{
|
|
530
|
+
{Construct full task XML from your analysis. Each task needs: id, name, type, needs, creates, tdd_candidate, action_hint, verify_hint, done_hint. Use the same XML schema the plan-writer expects.}
|
|
549
531
|
</task_list>
|
|
550
532
|
|
|
551
533
|
<phase_context>
|
|
@@ -554,7 +536,6 @@ Assemble handoff payload:
|
|
|
554
536
|
<phase_dir>.planning/phases/{PHASE}-{PHASE_NAME}</phase_dir>
|
|
555
537
|
<phase_goal>{goal from ROADMAP}</phase_goal>
|
|
556
538
|
<requirements>{REQ-IDs from ROADMAP}</requirements>
|
|
557
|
-
<depth>{from config.json or "standard"}</depth>
|
|
558
539
|
<subsystem_hint>{best-match subsystem from config.json}</subsystem_hint>
|
|
559
540
|
</phase_context>
|
|
560
541
|
|
|
@@ -601,10 +582,10 @@ Task(
|
|
|
601
582
|
The subagent handles:
|
|
602
583
|
- Building dependency graph from needs/creates
|
|
603
584
|
- Assigning wave numbers
|
|
604
|
-
- Grouping tasks into plans (2-3 per plan)
|
|
605
|
-
- Deriving
|
|
585
|
+
- Grouping tasks into plans (2-3 changes per plan)
|
|
586
|
+
- Deriving Must-Haves (goal-backward)
|
|
606
587
|
- Estimating scope, splitting if needed
|
|
607
|
-
- Writing PLAN.md files
|
|
588
|
+
- Writing PLAN.md files + EXECUTION-ORDER.md
|
|
608
589
|
- Git commit
|
|
609
590
|
- Calculating risk score
|
|
610
591
|
</step>
|
|
@@ -772,10 +753,10 @@ Tasks are instructions for Claude, not Jira tickets.
|
|
|
772
753
|
- [ ] Prior decisions, issues, concerns synthesized
|
|
773
754
|
- [ ] Tasks identified with needs/creates dependencies
|
|
774
755
|
- [ ] Task list handed off to ms-plan-writer
|
|
775
|
-
- [ ] PLAN file(s) created
|
|
776
|
-
- [ ]
|
|
777
|
-
- [ ] Each plan:
|
|
778
|
-
- [ ] Each plan: 2-3
|
|
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)
|
|
779
760
|
- [ ] Wave structure maximizes parallelism
|
|
780
761
|
- [ ] PLAN file(s) committed to git
|
|
781
762
|
- [ ] Risk assessment presented (score + top factors)
|
|
@@ -787,8 +768,8 @@ Tasks are instructions for Claude, not Jira tickets.
|
|
|
787
768
|
- [ ] Existing SUMMARYs read for context
|
|
788
769
|
- [ ] Gaps clustered into focused plans
|
|
789
770
|
- [ ] Plan numbers sequential after existing (04, 05...)
|
|
790
|
-
- [ ] PLAN file(s)
|
|
791
|
-
- [ ]
|
|
771
|
+
- [ ] PLAN file(s) created with pure markdown format
|
|
772
|
+
- [ ] EXECUTION-ORDER.md updated with gap closure plans
|
|
792
773
|
- [ ] PLAN file(s) committed to git
|
|
793
774
|
- [ ] User knows to run `/ms:execute-phase {X}` next
|
|
794
775
|
</success_criteria>
|
|
@@ -50,14 +50,6 @@ ls .planning/phases/XX-current/*-SUMMARY.md 2>/dev/null | sort
|
|
|
50
50
|
- If counts match: all plans complete
|
|
51
51
|
- If counts don't match: incomplete
|
|
52
52
|
|
|
53
|
-
<config-check>
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
cat .planning/config.json 2>/dev/null
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
</config-check>
|
|
60
|
-
|
|
61
53
|
**If all plans complete:**
|
|
62
54
|
|
|
63
55
|
```
|
|
@@ -71,8 +63,7 @@ Proceed directly to cleanup_handoff step.
|
|
|
71
63
|
|
|
72
64
|
**If plans incomplete:**
|
|
73
65
|
|
|
74
|
-
**SAFETY RAIL:
|
|
75
|
-
Skipping incomplete plans is destructive — ALWAYS prompt regardless of mode.
|
|
66
|
+
**SAFETY RAIL: Skipping incomplete plans is destructive — always confirm.**
|
|
76
67
|
|
|
77
68
|
Present:
|
|
78
69
|
|
|
@@ -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
|
|
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
|
|
57
|
+
**Option A: Must-haves in plan markdown**
|
|
58
58
|
|
|
59
|
-
Check if any PLAN.md has `
|
|
59
|
+
Check if any PLAN.md has a `## Must-Haves` section:
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
grep -l "
|
|
62
|
+
grep -l "## Must-Haves" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
If found, extract
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
@@ -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
|
-
|
|
27
|
+
```bash
|
|
28
|
+
gh api /gists/edf9ea7d5adf218f45accb3411f0627c \
|
|
29
|
+
--jq '.files["flutter-code-quality-guidelines.md"].content'
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
|
|
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
|
|