mindsystem-cc 3.13.1 → 3.16.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/LICENSE +1 -1
- package/README.md +1 -0
- package/agents/ms-codebase-researcher.md +105 -0
- package/agents/ms-consolidator.md +137 -286
- package/agents/ms-debugger.md +1 -0
- package/agents/ms-designer.md +1 -0
- package/agents/ms-executor.md +2 -1
- package/agents/ms-flutter-reviewer.md +1 -0
- package/agents/ms-integration-checker.md +1 -0
- package/agents/ms-plan-checker.md +17 -327
- package/agents/ms-researcher.md +25 -343
- package/agents/ms-roadmapper.md +10 -75
- package/agents/ms-verifier.md +33 -309
- package/agents/ms-verify-fixer.md +1 -0
- package/commands/ms/check-phase.md +24 -55
- package/commands/ms/complete-milestone.md +6 -25
- package/commands/ms/create-roadmap.md +3 -15
- package/commands/ms/design-phase.md +40 -2
- package/commands/ms/discuss-phase.md +1 -9
- package/commands/ms/doctor.md +224 -0
- package/commands/ms/execute-phase.md +22 -12
- package/commands/ms/help.md +11 -0
- package/commands/ms/new-milestone.md +3 -3
- package/commands/ms/plan-phase.md +1 -1
- package/commands/ms/research-phase.md +249 -85
- package/commands/ms/verify-work.md +7 -13
- package/mindsystem/templates/UAT.md +0 -274
- package/mindsystem/templates/context.md +1 -11
- package/mindsystem/templates/discovery.md +2 -3
- package/mindsystem/templates/knowledge.md +99 -0
- package/mindsystem/templates/requirements.md +3 -61
- package/mindsystem/templates/research-comparison-output.md +50 -0
- package/mindsystem/templates/research-feasibility-output.md +43 -0
- package/mindsystem/templates/research-project-output.md +81 -0
- package/mindsystem/templates/research-subagent-prompt.md +164 -48
- package/mindsystem/templates/roadmap-milestone.md +67 -0
- package/mindsystem/templates/roadmap.md +2 -66
- package/mindsystem/workflows/complete-milestone.md +23 -140
- package/mindsystem/workflows/define-requirements.md +4 -8
- package/mindsystem/workflows/discuss-phase.md +25 -8
- package/mindsystem/workflows/execute-phase.md +34 -0
- package/mindsystem/workflows/execute-plan.md +8 -0
- package/mindsystem/workflows/mockup-generation.md +1 -1
- package/mindsystem/workflows/plan-phase.md +40 -102
- package/mindsystem/workflows/verify-work.md +40 -234
- package/package.json +1 -1
- package/scripts/cleanup-phase-artifacts.sh +68 -0
- package/scripts/scan-artifact-subsystems.sh +55 -0
- package/scripts/scan-planning-context.py +689 -0
- package/skills/flutter-code-quality/SKILL.md +1 -1
- package/skills/flutter-code-simplification/SKILL.md +1 -1
- package/skills/flutter-senior-review/SKILL.md +1 -1
- package/mindsystem/templates/decisions.md +0 -145
- package/mindsystem/templates/learnings.md +0 -150
|
@@ -8,29 +8,6 @@ Complete verify-and-fix session: by session end, everything verified, issues fix
|
|
|
8
8
|
<!-- mock-patterns.md loaded on demand for transient_state mocks (see generate_mocks step) -->
|
|
9
9
|
</execution_context>
|
|
10
10
|
|
|
11
|
-
<template>
|
|
12
|
-
@~/.claude/mindsystem/templates/UAT.md
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<philosophy>
|
|
16
|
-
**Verify and fix in one session.**
|
|
17
|
-
|
|
18
|
-
Old flow: verify → log gaps → /clear → plan-phase --gaps → execute → verify again
|
|
19
|
-
New flow: verify → investigate → fix → re-test → continue
|
|
20
|
-
|
|
21
|
-
**Mocks enable testing unreachable states.**
|
|
22
|
-
|
|
23
|
-
Error displays, premium features, empty lists — all require specific backend conditions. Mocks let you toggle states and test immediately.
|
|
24
|
-
|
|
25
|
-
**Keep mocks and fixes separate.**
|
|
26
|
-
|
|
27
|
-
Mocks are uncommitted scaffolding. Fixes are clean commits. Git stash keeps them separated.
|
|
28
|
-
|
|
29
|
-
**Fix while context is hot.**
|
|
30
|
-
|
|
31
|
-
When you find an issue, you have the mock state active, the test fresh in mind, and the user ready to re-test. Fix it now, not later.
|
|
32
|
-
</philosophy>
|
|
33
|
-
|
|
34
11
|
<process>
|
|
35
12
|
|
|
36
13
|
<step name="check_dirty_tree" priority="first">
|
|
@@ -42,20 +19,7 @@ git status --porcelain
|
|
|
42
19
|
|
|
43
20
|
**If output is non-empty (dirty tree):**
|
|
44
21
|
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
questions:
|
|
48
|
-
- question: "You have uncommitted changes. How should I handle them before starting UAT?"
|
|
49
|
-
header: "Git state"
|
|
50
|
-
options:
|
|
51
|
-
- label: "Stash changes"
|
|
52
|
-
description: "git stash push -m 'pre-verify-work' — I'll restore them after UAT"
|
|
53
|
-
- label: "Commit first"
|
|
54
|
-
description: "Let me commit these changes before we start"
|
|
55
|
-
- label: "Abort"
|
|
56
|
-
description: "Cancel UAT, I'll handle my changes manually"
|
|
57
|
-
multiSelect: false
|
|
58
|
-
```
|
|
22
|
+
AskUserQuestion with options: Stash changes / Commit first / Abort
|
|
59
23
|
|
|
60
24
|
**Handle response:**
|
|
61
25
|
- "Stash changes" → `git stash push -m "pre-verify-work"`, record `pre_work_stash: "pre-verify-work"` for later
|
|
@@ -183,50 +147,14 @@ Reason over SUMMARY.md content (accomplishments, files created/modified, decisio
|
|
|
183
147
|
| "offline", "no connection" | offline_state |
|
|
184
148
|
| Normal happy path | no mock needed |
|
|
185
149
|
|
|
186
|
-
For tests that remain genuinely uncertain after both the two-question framework and keyword heuristics,
|
|
187
|
-
```
|
|
188
|
-
questions:
|
|
189
|
-
- question: "Does [test name] require mock data or a special app state to test?"
|
|
190
|
-
header: "Mock needed?"
|
|
191
|
-
options:
|
|
192
|
-
- label: "No mock needed"
|
|
193
|
-
description: "Can test with real/local data"
|
|
194
|
-
- label: "Needs mock"
|
|
195
|
-
description: "Requires simulated state or data"
|
|
196
|
-
```
|
|
150
|
+
For tests that remain genuinely uncertain after both the two-question framework and keyword heuristics, AskUserQuestion per uncertain test: No mock needed / Needs mock.
|
|
197
151
|
|
|
198
152
|
**Dependency inference (both tiers):**
|
|
199
153
|
- "Reply to comment" depends on "View comments"
|
|
200
154
|
- "Delete account" depends on "Login"
|
|
201
155
|
- Tests mentioning prior state depend on tests that create that state
|
|
202
156
|
|
|
203
|
-
Build classification list:
|
|
204
|
-
```yaml
|
|
205
|
-
tests:
|
|
206
|
-
- name: "Login success"
|
|
207
|
-
mock_required: false
|
|
208
|
-
mock_type: null
|
|
209
|
-
dependencies: []
|
|
210
|
-
|
|
211
|
-
- name: "Login error message"
|
|
212
|
-
mock_required: true
|
|
213
|
-
mock_type: "error_state"
|
|
214
|
-
mock_reason: "error response from auth endpoint"
|
|
215
|
-
dependencies: ["login_flow"]
|
|
216
|
-
|
|
217
|
-
- name: "Recipe list loading skeleton"
|
|
218
|
-
mock_required: true
|
|
219
|
-
mock_type: "transient_state"
|
|
220
|
-
mock_reason: "loading skeleton during recipe fetch — async, resolves in <1s"
|
|
221
|
-
dependencies: []
|
|
222
|
-
|
|
223
|
-
- name: "View recipe list"
|
|
224
|
-
mock_required: true
|
|
225
|
-
mock_type: "external_data"
|
|
226
|
-
mock_reason: "recipe items from /api/recipes"
|
|
227
|
-
needs_user_confirmation: true
|
|
228
|
-
dependencies: []
|
|
229
|
-
```
|
|
157
|
+
Build classification list with fields: name, mock_required, mock_type, mock_reason, dependencies, needs_user_confirmation.
|
|
230
158
|
</step>
|
|
231
159
|
|
|
232
160
|
<step name="create_batches">
|
|
@@ -236,136 +164,24 @@ tests:
|
|
|
236
164
|
|
|
237
165
|
**Rules:**
|
|
238
166
|
1. Group by mock_type (tests needing same mock state go together)
|
|
239
|
-
2. **User confirmation for external_data tests:** Before batching, collect all tests with `needs_user_confirmation: true`, grouped by data source.
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
questions:
|
|
243
|
-
- question: "Do you have [data_type] data from [source] locally?"
|
|
244
|
-
header: "[data_type]"
|
|
245
|
-
options:
|
|
246
|
-
- label: "Yes, data exists"
|
|
247
|
-
description: "I have [data_type] in my local environment"
|
|
248
|
-
- label: "No, needs mock"
|
|
249
|
-
description: "I need this data mocked for testing"
|
|
250
|
-
- label: "Skip these tests"
|
|
251
|
-
description: "Log as assumptions and move on"
|
|
252
|
-
multiSelect: false
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
Handle responses:
|
|
256
|
-
- "Yes, data exists" → reclassify affected tests as `mock_required: false`
|
|
257
|
-
- "No, needs mock" → keep as `mock_required: true`, `mock_type: "external_data"`
|
|
258
|
-
- "Skip these tests" → mark all affected tests as `skipped`
|
|
259
|
-
|
|
260
|
-
Group by data source (not per-test) to stay within AskUserQuestion's 4-question limit.
|
|
167
|
+
2. **User confirmation for external_data tests:** Before batching, collect all tests with `needs_user_confirmation: true`, grouped by data source. AskUserQuestion per data source: Yes, data exists / No, needs mock / Skip these tests. Handle responses: reclassify as `mock_required: false`, keep as mock, or mark `skipped`. Group by data source (not per-test) to stay within AskUserQuestion's 4-question limit.
|
|
261
168
|
|
|
262
169
|
3. **Separate transient_state batch:** Transient states use a different mock strategy (delay/force) than data mocks. Give them their own batch.
|
|
263
170
|
4. Respect dependencies (if B depends on A, A must be in same or earlier batch)
|
|
264
171
|
5. Max 4 tests per batch (AskUserQuestion limit)
|
|
265
172
|
6. Batch ordering: no-mock → external_data → error_state → empty_response → transient_state → premium_user → offline_state
|
|
266
173
|
|
|
267
|
-
|
|
268
|
-
```yaml
|
|
269
|
-
batches:
|
|
270
|
-
- batch: 1
|
|
271
|
-
name: "No Mocks Required"
|
|
272
|
-
mock_type: null
|
|
273
|
-
tests: [1, 2, 3]
|
|
274
|
-
|
|
275
|
-
- batch: 2
|
|
276
|
-
name: "External Data"
|
|
277
|
-
mock_type: "external_data"
|
|
278
|
-
tests: [4, 5]
|
|
279
|
-
|
|
280
|
-
- batch: 3
|
|
281
|
-
name: "Error States"
|
|
282
|
-
mock_type: "error_state"
|
|
283
|
-
tests: [6, 7, 8]
|
|
284
|
-
|
|
285
|
-
- batch: 4
|
|
286
|
-
name: "Transient States"
|
|
287
|
-
mock_type: "transient_state"
|
|
288
|
-
tests: [9, 10]
|
|
289
|
-
|
|
290
|
-
- batch: 5
|
|
291
|
-
name: "Premium Features"
|
|
292
|
-
mock_type: "premium_user"
|
|
293
|
-
tests: [11, 12]
|
|
294
|
-
```
|
|
174
|
+
Each batch has: batch number, name, mock_type, and test list.
|
|
295
175
|
</step>
|
|
296
176
|
|
|
297
177
|
<step name="create_uat_file">
|
|
298
|
-
**Create UAT file
|
|
178
|
+
**Create UAT file:**
|
|
299
179
|
|
|
300
180
|
```bash
|
|
301
181
|
mkdir -p "$PHASE_DIR"
|
|
302
182
|
```
|
|
303
183
|
|
|
304
|
-
Create file at `.planning/phases/XX-name/{phase}-UAT.md
|
|
305
|
-
|
|
306
|
-
```markdown
|
|
307
|
-
---
|
|
308
|
-
status: testing
|
|
309
|
-
phase: XX-name
|
|
310
|
-
source: [list of SUMMARY.md files]
|
|
311
|
-
started: [ISO timestamp]
|
|
312
|
-
updated: [ISO timestamp]
|
|
313
|
-
current_batch: 1
|
|
314
|
-
mocked_files: []
|
|
315
|
-
pre_work_stash: [from dirty tree handling, or null]
|
|
316
|
-
---
|
|
317
|
-
|
|
318
|
-
## Progress
|
|
319
|
-
|
|
320
|
-
total: [N]
|
|
321
|
-
tested: 0
|
|
322
|
-
passed: 0
|
|
323
|
-
issues: 0
|
|
324
|
-
fixing: 0
|
|
325
|
-
pending: [N]
|
|
326
|
-
skipped: 0
|
|
327
|
-
|
|
328
|
-
## Current Batch
|
|
329
|
-
|
|
330
|
-
batch: 1 of [total_batches]
|
|
331
|
-
name: "[batch name]"
|
|
332
|
-
mock_type: [mock_type or null]
|
|
333
|
-
tests: [test numbers]
|
|
334
|
-
status: pending
|
|
335
|
-
|
|
336
|
-
## Tests
|
|
337
|
-
|
|
338
|
-
### 1. [Test Name]
|
|
339
|
-
expected: [observable behavior]
|
|
340
|
-
mock_required: [true/false]
|
|
341
|
-
mock_type: [type or null]
|
|
342
|
-
result: [pending]
|
|
343
|
-
|
|
344
|
-
### 2. [Test Name]
|
|
345
|
-
...
|
|
346
|
-
|
|
347
|
-
## Fixes Applied
|
|
348
|
-
|
|
349
|
-
[none yet]
|
|
350
|
-
|
|
351
|
-
## Batches
|
|
352
|
-
|
|
353
|
-
### Batch 1: [Name]
|
|
354
|
-
tests: [1, 2, 3]
|
|
355
|
-
status: pending
|
|
356
|
-
mock_type: null
|
|
357
|
-
|
|
358
|
-
### Batch 2: [Name]
|
|
359
|
-
tests: [4, 5, 6, 7]
|
|
360
|
-
status: pending
|
|
361
|
-
mock_type: error_state
|
|
362
|
-
|
|
363
|
-
...
|
|
364
|
-
|
|
365
|
-
## Assumptions
|
|
366
|
-
|
|
367
|
-
[none yet]
|
|
368
|
-
```
|
|
184
|
+
Create file at `.planning/phases/XX-name/{phase}-UAT.md` following the template structure in context. Populate with classified tests and batch data from previous steps.
|
|
369
185
|
|
|
370
186
|
Proceed to `execute_batch`.
|
|
371
187
|
</step>
|
|
@@ -456,22 +272,7 @@ If user has previously indicated they want to skip mock batches, or if mock gene
|
|
|
456
272
|
|
|
457
273
|
Collect tests for current batch (only `[pending]` and `blocked` results).
|
|
458
274
|
|
|
459
|
-
|
|
460
|
-
```
|
|
461
|
-
questions:
|
|
462
|
-
- question: "Test {N}: {name} — {expected}"
|
|
463
|
-
header: "Test {N}"
|
|
464
|
-
options:
|
|
465
|
-
- label: "Pass"
|
|
466
|
-
description: "Works as expected"
|
|
467
|
-
- label: "Can't test"
|
|
468
|
-
description: "Blocked by a previous failure"
|
|
469
|
-
- label: "Skip"
|
|
470
|
-
description: "Assume it works (can't test this state)"
|
|
471
|
-
multiSelect: false
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
The "Other" option is auto-added for issue descriptions.
|
|
275
|
+
AskUserQuestion per test (up to 4): Pass / Can't test / Skip. "Other" auto-added for issue descriptions.
|
|
475
276
|
|
|
476
277
|
**Tip for users:** To skip with custom reason, select "Other" and start with `Skip:` — e.g., `Skip: Requires paid API key`.
|
|
477
278
|
|
|
@@ -680,20 +481,7 @@ Mocks are stashed — working tree is clean.
|
|
|
680
481
|
<step name="handle_retest">
|
|
681
482
|
**Handle re-test result:**
|
|
682
483
|
|
|
683
|
-
|
|
684
|
-
```
|
|
685
|
-
questions:
|
|
686
|
-
- question: "Re-test: {test_name} — Does it work now?"
|
|
687
|
-
header: "Re-test"
|
|
688
|
-
options:
|
|
689
|
-
- label: "Pass"
|
|
690
|
-
description: "Fixed! Works correctly now"
|
|
691
|
-
- label: "Still broken"
|
|
692
|
-
description: "Same issue persists"
|
|
693
|
-
- label: "New issue"
|
|
694
|
-
description: "Original fixed but found different problem"
|
|
695
|
-
multiSelect: false
|
|
696
|
-
```
|
|
484
|
+
AskUserQuestion: Pass / Still broken / New issue.
|
|
697
485
|
|
|
698
486
|
**If Pass:**
|
|
699
487
|
- Update test: `result: pass`, `fix_status: verified`
|
|
@@ -814,6 +602,26 @@ git add ".planning/phases/XX-name/{phase}-UAT.md"
|
|
|
814
602
|
git commit -m "test({phase}): complete UAT - {passed} passed, {fixed} fixed, {skipped} assumptions"
|
|
815
603
|
```
|
|
816
604
|
|
|
605
|
+
**5.5. Update knowledge pitfalls (lightweight):**
|
|
606
|
+
|
|
607
|
+
```bash
|
|
608
|
+
# Check for significant findings
|
|
609
|
+
grep -c "severity: blocker\|severity: major" "$PHASE_DIR/${PHASE}-UAT.md" 2>/dev/null
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
If significant issues (blocker/major) were found AND fixed:
|
|
613
|
+
1. Determine affected subsystem(s) from the UAT.md test descriptions and config.json
|
|
614
|
+
2. Read relevant `knowledge/{subsystem}.md` files
|
|
615
|
+
3. Append new pitfall entries to the Pitfalls section (do not rewrite entire file — just append)
|
|
616
|
+
4. Commit knowledge file updates:
|
|
617
|
+
```bash
|
|
618
|
+
git add .planning/knowledge/*.md && git commit -m "docs: update pitfalls from UAT findings"
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
If no significant findings or no fixes: skip silently.
|
|
622
|
+
|
|
623
|
+
This is NOT a full re-consolidation. Read only UAT.md and add specific pitfall entries.
|
|
624
|
+
|
|
817
625
|
**6. Present summary:**
|
|
818
626
|
```
|
|
819
627
|
## UAT Complete: Phase {phase}
|
|
@@ -840,6 +648,11 @@ Check if more phases remain in ROADMAP.md:
|
|
|
840
648
|
</process>
|
|
841
649
|
|
|
842
650
|
<update_rules>
|
|
651
|
+
**Immutable (set on creation, never overwrite):** phase, source, started
|
|
652
|
+
**Result values:** [pending], pass, issue, blocked, skipped
|
|
653
|
+
**Issue adds:** reported, severity, fix_status (investigating | applied | verified), fix_commit, retry_count
|
|
654
|
+
**Skipped adds:** reason
|
|
655
|
+
|
|
843
656
|
**Write UAT.md after:**
|
|
844
657
|
- Each batch of responses processed
|
|
845
658
|
- Each fix applied
|
|
@@ -851,6 +664,7 @@ Check if more phases remain in ROADMAP.md:
|
|
|
851
664
|
| Frontmatter.status | OVERWRITE | Phase transitions |
|
|
852
665
|
| Frontmatter.current_batch | OVERWRITE | Batch transitions |
|
|
853
666
|
| Frontmatter.mocked_files | OVERWRITE | Mock generation/cleanup |
|
|
667
|
+
| Frontmatter.pre_work_stash | OVERWRITE | Dirty tree handling |
|
|
854
668
|
| Frontmatter.updated | OVERWRITE | Every write |
|
|
855
669
|
| Progress | OVERWRITE | After each test result |
|
|
856
670
|
| Current Batch | OVERWRITE | Batch transitions |
|
|
@@ -879,19 +693,11 @@ Default: **major** (safe default)
|
|
|
879
693
|
</severity_inference>
|
|
880
694
|
|
|
881
695
|
<success_criteria>
|
|
882
|
-
- [ ]
|
|
883
|
-
- [ ]
|
|
884
|
-
- [ ] Batches created respecting dependencies and mock types
|
|
885
|
-
- [ ] Mocks applied inline when needed (1-4 direct, 5+ via subagent)
|
|
886
|
-
- [ ] Tests presented in batches of 4
|
|
887
|
-
- [ ] Issues investigated with lightweight check (2-3 calls)
|
|
888
|
-
- [ ] Simple issues fixed inline with proper commit
|
|
889
|
-
- [ ] Complex issues escalated to fixer subagent
|
|
890
|
-
- [ ] Re-test retries (2 max, tracked via retry_count) before offering options
|
|
696
|
+
- [ ] Mocks stashed before fixing, restored after (git stash push/pop cycle)
|
|
697
|
+
- [ ] Stash conflicts auto-resolved to fix version (git checkout --theirs)
|
|
891
698
|
- [ ] Blocked tests re-presented after blocking issues resolved
|
|
892
|
-
- [ ]
|
|
893
|
-
- [ ]
|
|
699
|
+
- [ ] Failed re-tests get 2 retries then options (tracked via retry_count)
|
|
700
|
+
- [ ] All mocks reverted on completion (git checkout -- <mocked_files>)
|
|
894
701
|
- [ ] UAT fixes patch generated
|
|
895
|
-
- [ ] User's pre-existing work restored
|
|
896
|
-
- [ ] UAT.md committed with final summary
|
|
702
|
+
- [ ] User's pre-existing work restored from stash
|
|
897
703
|
</success_criteria>
|
package/package.json
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# cleanup-phase-artifacts.sh
|
|
4
|
+
# Deletes raw phase artifacts (CONTEXT, DESIGN, RESEARCH, SUMMARY, UAT,
|
|
5
|
+
# VERIFICATION, EXECUTION-ORDER) from all phases in a milestone range.
|
|
6
|
+
# Knowledge files in .planning/knowledge/ are not touched.
|
|
7
|
+
#
|
|
8
|
+
# Usage: ./scripts/cleanup-phase-artifacts.sh <start_phase> <end_phase>
|
|
9
|
+
# Example: ./scripts/cleanup-phase-artifacts.sh 1 6
|
|
10
|
+
|
|
11
|
+
set -e
|
|
12
|
+
|
|
13
|
+
# --- Validation ---
|
|
14
|
+
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
15
|
+
echo "Error: Two arguments required"
|
|
16
|
+
echo "Usage: $0 <start_phase> <end_phase>"
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
START="$1"
|
|
21
|
+
END="$2"
|
|
22
|
+
|
|
23
|
+
if ! [[ "$START" =~ ^[0-9]+$ ]] || ! [[ "$END" =~ ^[0-9]+$ ]]; then
|
|
24
|
+
echo "Error: Both arguments must be numeric"
|
|
25
|
+
echo "Usage: $0 <start_phase> <end_phase>"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
if [ "$START" -gt "$END" ]; then
|
|
30
|
+
echo "Error: Start phase ($START) cannot exceed end phase ($END)"
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# --- Find .planning from git root ---
|
|
35
|
+
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
36
|
+
if [ -z "$GIT_ROOT" ]; then
|
|
37
|
+
echo "Error: Not in a git repository"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
PHASES_DIR="$GIT_ROOT/.planning/phases"
|
|
42
|
+
if [ ! -d "$PHASES_DIR" ]; then
|
|
43
|
+
echo "Error: Phases directory not found at $PHASES_DIR"
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
# --- Delete artifacts from each phase in range ---
|
|
48
|
+
DELETED=0
|
|
49
|
+
for dir in "$PHASES_DIR"/*/; do
|
|
50
|
+
[ -d "$dir" ] || continue
|
|
51
|
+
dirname=$(basename "$dir")
|
|
52
|
+
phase_num="${dirname%%-*}"
|
|
53
|
+
# Strip leading zeros for numeric comparison
|
|
54
|
+
phase_int=$((10#$phase_num))
|
|
55
|
+
if [ "$phase_int" -ge "$START" ] && [ "$phase_int" -le "$END" ]; then
|
|
56
|
+
for f in "$dir"/*-CONTEXT.md "$dir"/*-DESIGN.md "$dir"/*-RESEARCH.md \
|
|
57
|
+
"$dir"/*-SUMMARY.md "$dir"/*-UAT.md "$dir"/*-VERIFICATION.md \
|
|
58
|
+
"$dir"/*-EXECUTION-ORDER.md; do
|
|
59
|
+
if [ -f "$f" ]; then
|
|
60
|
+
rm -f "$f"
|
|
61
|
+
DELETED=$((DELETED + 1))
|
|
62
|
+
fi
|
|
63
|
+
done
|
|
64
|
+
fi
|
|
65
|
+
done
|
|
66
|
+
|
|
67
|
+
echo "Cleaned $DELETED artifact files from phases $START-$END"
|
|
68
|
+
exit 0
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# scan-artifact-subsystems.sh
|
|
4
|
+
# Scans all planning artifact types for `subsystem:` YAML frontmatter values.
|
|
5
|
+
#
|
|
6
|
+
# Usage: scan-artifact-subsystems.sh [--values-only]
|
|
7
|
+
#
|
|
8
|
+
# --values-only Print only subsystem values (one per line)
|
|
9
|
+
# (default) Print file<TAB>value pairs
|
|
10
|
+
|
|
11
|
+
set -e
|
|
12
|
+
|
|
13
|
+
VALUES_ONLY=false
|
|
14
|
+
if [ "$1" = "--values-only" ]; then
|
|
15
|
+
VALUES_ONLY=true
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# --- Find .planning from git root ---
|
|
19
|
+
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
20
|
+
if [ -z "$GIT_ROOT" ]; then
|
|
21
|
+
echo "Error: Not in a git repository"
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
PLANNING="$GIT_ROOT/.planning"
|
|
26
|
+
|
|
27
|
+
# --- Extract subsystem value from a file's YAML frontmatter ---
|
|
28
|
+
extract_subsystem() {
|
|
29
|
+
sed -n '/^---$/,/^---$/p' "$1" | grep "^subsystem:" | sed 's/subsystem: *//'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# --- Scan a glob pattern and print results under a section header ---
|
|
33
|
+
scan_section() {
|
|
34
|
+
local header="$1"
|
|
35
|
+
shift
|
|
36
|
+
echo "=== $header ==="
|
|
37
|
+
for f in "$@"; do
|
|
38
|
+
[ -f "$f" ] || continue
|
|
39
|
+
val=$(extract_subsystem "$f")
|
|
40
|
+
if [ -n "$val" ]; then
|
|
41
|
+
if [ "$VALUES_ONLY" = true ]; then
|
|
42
|
+
echo "$val"
|
|
43
|
+
else
|
|
44
|
+
echo "$f $val"
|
|
45
|
+
fi
|
|
46
|
+
fi
|
|
47
|
+
done
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
scan_section "Phase SUMMARYs" "$PLANNING"/phases/*/*-SUMMARY.md
|
|
51
|
+
scan_section "Adhoc SUMMARYs" "$PLANNING"/adhoc/*-SUMMARY.md
|
|
52
|
+
scan_section "Debug docs" "$PLANNING"/debug/*.md "$PLANNING"/debug/resolved/*.md
|
|
53
|
+
scan_section "Todos" "$PLANNING"/todos/pending/*.md "$PLANNING"/todos/done/*.md
|
|
54
|
+
|
|
55
|
+
exit 0
|