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.
Files changed (54) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -0
  3. package/agents/ms-codebase-researcher.md +105 -0
  4. package/agents/ms-consolidator.md +137 -286
  5. package/agents/ms-debugger.md +1 -0
  6. package/agents/ms-designer.md +1 -0
  7. package/agents/ms-executor.md +2 -1
  8. package/agents/ms-flutter-reviewer.md +1 -0
  9. package/agents/ms-integration-checker.md +1 -0
  10. package/agents/ms-plan-checker.md +17 -327
  11. package/agents/ms-researcher.md +25 -343
  12. package/agents/ms-roadmapper.md +10 -75
  13. package/agents/ms-verifier.md +33 -309
  14. package/agents/ms-verify-fixer.md +1 -0
  15. package/commands/ms/check-phase.md +24 -55
  16. package/commands/ms/complete-milestone.md +6 -25
  17. package/commands/ms/create-roadmap.md +3 -15
  18. package/commands/ms/design-phase.md +40 -2
  19. package/commands/ms/discuss-phase.md +1 -9
  20. package/commands/ms/doctor.md +224 -0
  21. package/commands/ms/execute-phase.md +22 -12
  22. package/commands/ms/help.md +11 -0
  23. package/commands/ms/new-milestone.md +3 -3
  24. package/commands/ms/plan-phase.md +1 -1
  25. package/commands/ms/research-phase.md +249 -85
  26. package/commands/ms/verify-work.md +7 -13
  27. package/mindsystem/templates/UAT.md +0 -274
  28. package/mindsystem/templates/context.md +1 -11
  29. package/mindsystem/templates/discovery.md +2 -3
  30. package/mindsystem/templates/knowledge.md +99 -0
  31. package/mindsystem/templates/requirements.md +3 -61
  32. package/mindsystem/templates/research-comparison-output.md +50 -0
  33. package/mindsystem/templates/research-feasibility-output.md +43 -0
  34. package/mindsystem/templates/research-project-output.md +81 -0
  35. package/mindsystem/templates/research-subagent-prompt.md +164 -48
  36. package/mindsystem/templates/roadmap-milestone.md +67 -0
  37. package/mindsystem/templates/roadmap.md +2 -66
  38. package/mindsystem/workflows/complete-milestone.md +23 -140
  39. package/mindsystem/workflows/define-requirements.md +4 -8
  40. package/mindsystem/workflows/discuss-phase.md +25 -8
  41. package/mindsystem/workflows/execute-phase.md +34 -0
  42. package/mindsystem/workflows/execute-plan.md +8 -0
  43. package/mindsystem/workflows/mockup-generation.md +1 -1
  44. package/mindsystem/workflows/plan-phase.md +40 -102
  45. package/mindsystem/workflows/verify-work.md +40 -234
  46. package/package.json +1 -1
  47. package/scripts/cleanup-phase-artifacts.sh +68 -0
  48. package/scripts/scan-artifact-subsystems.sh +55 -0
  49. package/scripts/scan-planning-context.py +689 -0
  50. package/skills/flutter-code-quality/SKILL.md +1 -1
  51. package/skills/flutter-code-simplification/SKILL.md +1 -1
  52. package/skills/flutter-senior-review/SKILL.md +1 -1
  53. package/mindsystem/templates/decisions.md +0 -145
  54. package/mindsystem/templates/learnings.md +0 -150
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: ms-executor
3
3
  description: Executes Mindsystem plans with atomic commits, deviation handling, and summary creation. Spawned by execute-phase orchestrator.
4
- tools: Read, Write, Edit, Bash, Grep, Glob
4
+ model: opus
5
+ tools: Read, Write, Edit, Bash, Grep, Glob, Skill, AskUserQuestion
5
6
  color: yellow
6
7
  ---
7
8
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: ms-flutter-reviewer
3
3
  description: Analyzes Flutter/Dart code for structural issues during milestone audits. Reports findings only — does NOT fix anything.
4
+ model: opus
4
5
  tools: Read, Bash, Glob, Grep
5
6
  mode: analyze-only
6
7
  color: yellow
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: ms-integration-checker
3
3
  description: Verifies cross-phase integration and E2E flows. Checks that phases connect properly and user workflows complete end-to-end.
4
+ model: sonnet
4
5
  tools: Read, Bash, Grep, Glob
5
6
  color: blue
6
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ms-plan-checker
3
3
  description: Verifies plans will achieve phase goal before execution. Goal-backward analysis of plan quality. Spawned by /ms:plan-phase orchestrator.
4
- model: sonnet
4
+ model: opus
5
5
  tools: Read, Bash, Glob, Grep
6
6
  color: green
7
7
  ---
@@ -24,7 +24,7 @@ Your job: Goal-backward verification of PLANS before execution. Start from what
24
24
  - Scope exceeds context budget (quality will degrade)
25
25
  - Plans contradict user decisions from CONTEXT.md
26
26
 
27
- You are NOT the executor (verifies code after execution) or the verifier (checks goal achievement in codebase). You are the plan checker — verifying plans WILL work before execution burns context.
27
+ You are NOT the executor (implements code from plans) or the verifier (checks goal achievement in codebase after execution). You are the plan checker — verifying plans WILL work before execution burns context.
28
28
  </role>
29
29
 
30
30
  <upstream_input>
@@ -53,12 +53,6 @@ Goal-backward plan verification starts from the outcome and works backwards:
53
53
  5. Will execution complete within context budget?
54
54
 
55
55
  Then verify each level against the actual plan files.
56
-
57
- **The difference:**
58
- - `ms-verifier`: Verifies code DID achieve goal (after execution)
59
- - `ms-plan-checker`: Verifies plans WILL achieve goal (before execution)
60
-
61
- Same methodology (goal-backward), different timing, different subject matter.
62
56
  </core_principle>
63
57
 
64
58
  <verification_dimensions>
@@ -298,8 +292,6 @@ issue:
298
292
 
299
293
  ## Step 1: Load Context
300
294
 
301
- Gather verification context from the phase directory and project state.
302
-
303
295
  ```bash
304
296
  # Normalize phase and find directory
305
297
  PADDED_PHASE=$(printf "%02d" ${PHASE_ARG} 2>/dev/null || echo "${PHASE_ARG}")
@@ -315,323 +307,35 @@ grep -A 10 "Phase ${PHASE_NUM}" .planning/ROADMAP.md | head -15
315
307
  ls "$PHASE_DIR"/*-BRIEF.md 2>/dev/null
316
308
  ```
317
309
 
318
- **Extract:**
319
- - Phase goal (from ROADMAP.md)
320
- - Requirements (decompose goal into what must be true)
321
- - Phase context (from BRIEF.md if exists)
310
+ Extract phase goal, decompose into requirements, note phase context from BRIEF.md if present.
322
311
 
323
312
  ## Step 2: Load All Plans
324
313
 
325
- Read each PLAN.md file in the phase directory.
326
-
327
- ```bash
328
- for plan in "$PHASE_DIR"/*-PLAN.md; do
329
- echo "=== $plan ==="
330
- cat "$plan"
331
- done
332
- ```
333
-
334
- **Parse from each plan:**
335
- - Inline metadata (Subsystem, Type)
336
- - Context section
337
- - Changes subsections (`### N.` headers with `**Files:**` lines)
338
- - Verification section
339
- - Must-Haves section (markdown checklist)
340
-
341
- ## Step 3: Parse Must-Haves
342
-
343
- Extract Must-Haves from each plan's `## Must-Haves` section.
344
-
345
- **Structure (markdown checklist):**
346
- ```markdown
347
- ## Must-Haves
348
- - [ ] User can log in with email/password
349
- - [ ] Invalid credentials return 401
350
- - [ ] Session persists across page reload
351
- ```
352
-
353
- Each `- [ ]` item is a user-observable truth to verify.
354
-
355
- **Also extract from `## Changes`:**
356
- - `**Files:**` lines → artifacts that must exist
357
- - Implementation details → key links between artifacts (fetch calls, imports, queries)
358
-
359
- **Aggregate across plans** to get full picture of what phase delivers.
360
-
361
- ## Step 4: Check Requirement Coverage
362
-
363
- Map phase requirements to tasks.
364
-
365
- **For each requirement from phase goal:**
366
- 1. Find task(s) that address it
367
- 2. Verify task action is specific enough
368
- 3. Flag uncovered requirements
369
-
370
- **Coverage matrix:**
371
- ```
372
- Requirement | Plans | Tasks | Status
373
- ---------------------|-------|-------|--------
374
- User can log in | 01 | 1,2 | COVERED
375
- User can log out | - | - | MISSING
376
- Session persists | 01 | 3 | COVERED
377
- ```
378
-
379
- ## Step 5: Validate Change Structure
380
-
381
- For each change subsection, verify required content exists.
314
+ Use Read tool for each PLAN.md file. Parse from each: inline metadata, Changes subsections (`### N.` with `**Files:**` lines), Verification section, Must-Haves checklist. Aggregate `**Files:**` lines and Must-Have items across plans.
382
315
 
316
+ Use Bash for batch counting:
383
317
  ```bash
384
318
  # Count changes per plan
385
319
  grep -c "^### " "$PHASE_DIR"/*-PLAN.md
386
320
 
387
- # Check for Files lines in each plan
321
+ # Check for Files lines
388
322
  grep "^\*\*Files:\*\*" "$PHASE_DIR"/*-PLAN.md
389
323
  ```
390
324
 
391
- **Check:**
392
- - Each `### N.` subsection has a `**Files:**` line
393
- - Implementation details are specific (not "implement auth")
394
- - `## Verification` section has entries
395
- - `## Must-Haves` section has checklist items
396
-
397
- ## Step 6: Verify Dependency Graph
398
-
399
- Read and validate EXECUTION-ORDER.md.
400
-
401
- **Parse EXECUTION-ORDER.md:**
402
- ```bash
403
- cat "$PHASE_DIR"/EXECUTION-ORDER.md
404
- ```
405
-
406
- **Validate:**
407
- 1. All PLAN.md files in phase directory are listed in EXECUTION-ORDER.md
408
- 2. No PLAN.md files missing from EXECUTION-ORDER.md
409
- 3. No circular dependencies between waves
410
- 4. Plans in same wave don't modify the same files (check `**Files:**` lines)
411
- 5. Wave ordering is consistent (later waves depend on earlier ones)
412
-
413
- **File conflict detection:** Parse `**Files:**` from plans in the same wave. If overlap found, report conflict.
414
-
415
- ## Step 7: Check Key Links Planned
416
-
417
- Verify artifacts are wired together in task actions.
418
-
419
- **For each key link identified from `## Changes`:**
420
- 1. Find the source artifact task
421
- 2. Check if action mentions the connection
422
- 3. Flag missing wiring
423
-
424
- **Example check:**
425
- ```
426
- key_link: Chat.tsx -> /api/chat via fetch
427
- Task 2 action: "Create Chat component with message list..."
428
- Missing: No mention of fetch/API call in action
429
- Issue: Key link not planned
430
- ```
431
-
432
- ## Step 8: Assess Scope
433
-
434
- Evaluate scope against context budget.
435
-
436
- **Metrics per plan:**
437
- ```bash
438
- # Count changes (### subsections)
439
- grep -c "^### " "$PHASE_DIR"/${PHASE}-01-PLAN.md
440
-
441
- # Count files from **Files:** lines
442
- grep "^\*\*Files:\*\*" "$PHASE_DIR"/${PHASE}-01-PLAN.md
443
- ```
444
-
445
- **Thresholds:**
446
- - 2-3 changes/plan: Good
447
- - 4 changes/plan: Warning
448
- - 5+ changes/plan: Blocker (split required)
449
-
450
- ## Step 9: Verify Must-Haves Derivation
325
+ ## Step 3: Run All Dimension Checks
451
326
 
452
- Check that `## Must-Haves` checklist items are properly derived from phase goal.
327
+ Run Dimensions 1-7 from `<verification_dimensions>` against the loaded plans. Build a coverage matrix mapping requirements to changes. Read EXECUTION-ORDER.md and validate against plan files.
453
328
 
454
- **Checklist items should be:**
455
- - User-observable (not "bcrypt installed" but "passwords are secure")
456
- - Testable by human using the app
457
- - Specific enough to verify
329
+ ## Step 4: Determine Overall Status
458
330
 
459
- **Changes should support Must-Haves:**
460
- - Each Must-Have item has corresponding change(s) in `## Changes`
461
- - `**Files:**` lines identify artifacts that make truths possible
462
- - Implementation details describe wiring between artifacts (not just creation)
331
+ **passed** All dimensions clear. No blockers or warnings.
463
332
 
464
- ## Step 10: Determine Overall Status
465
-
466
- Based on all dimension checks:
467
-
468
- **Status: passed**
469
- - All requirements covered
470
- - All tasks complete (fields present)
471
- - Dependency graph valid
472
- - Key links planned
473
- - Scope within budget
474
- - Must-Haves properly derived
475
-
476
- **Status: issues_found**
477
- - One or more blockers or warnings
478
- - Plans need revision before execution
479
-
480
- **Count issues by severity:**
481
- - `blocker`: Must fix before execution
482
- - `warning`: Should fix, execution may succeed
483
- - `info`: Minor improvements suggested
333
+ **issues_found** One or more blockers or warnings. Return structured issues to orchestrator.
484
334
 
485
335
  </verification_process>
486
336
 
487
- <examples>
488
-
489
- ## Example 1: Missing Requirement Coverage
490
-
491
- **Phase goal:** "Users can authenticate"
492
- **Requirements derived:** AUTH-01 (login), AUTH-02 (logout), AUTH-03 (session management)
493
-
494
- **Plans found:**
495
- ```
496
- Plan 01:
497
- - Task 1: Create login endpoint
498
- - Task 2: Create session management
499
-
500
- Plan 02:
501
- - Task 1: Add protected routes
502
- ```
503
-
504
- **Analysis:**
505
- - AUTH-01 (login): Covered by Plan 01, Task 1
506
- - AUTH-02 (logout): NO TASK FOUND
507
- - AUTH-03 (session): Covered by Plan 01, Task 2
508
-
509
- **Issue:**
510
- ```yaml
511
- issue:
512
- dimension: requirement_coverage
513
- severity: blocker
514
- description: "AUTH-02 (logout) has no covering task"
515
- plan: null
516
- fix_hint: "Add logout endpoint task to Plan 01 or create Plan 03"
517
- ```
518
-
519
- ## Example 2: Dependency Conflict
520
-
521
- **EXECUTION-ORDER.md:**
522
- ```markdown
523
- ## Wave 1 (parallel)
524
- - 03-01-PLAN.md
525
- - 03-02-PLAN.md
526
-
527
- ## Wave 2
528
- - 03-03-PLAN.md (after: 01, 02)
529
- ```
530
-
531
- **But Plan 02 references output from Plan 03 in its implementation details.**
532
-
533
- **Analysis:**
534
- - Plan 02 in Wave 1 needs output from Plan 03 (Wave 2)
535
- - Plan 03 waits for Plan 02 to complete
536
- - Contradiction: forward reference from earlier wave
537
-
538
- **Issue:**
539
- ```yaml
540
- issue:
541
- dimension: dependency_correctness
542
- severity: blocker
543
- description: "Plan 02 (Wave 1) references output from Plan 03 (Wave 2)"
544
- plans: ["02", "03"]
545
- fix_hint: "Move Plan 02 to Wave 2 or remove the forward reference"
546
- ```
547
-
548
- ## Example 3: Change Missing Verification
549
-
550
- **Change in Plan 01:**
551
- ```markdown
552
- ### 2. Create login endpoint
553
- **Files:** `src/app/api/auth/login/route.ts`
554
-
555
- POST endpoint accepting {email, password}, validates using bcrypt...
556
- ```
557
-
558
- **But `## Verification` has no entry for this change, and `## Must-Haves` doesn't reference login.**
559
-
560
- **Analysis:**
561
- - Change has Files and implementation details
562
- - No corresponding verification entry
563
- - Cannot confirm change completion
564
-
565
- **Issue:**
566
- ```yaml
567
- issue:
568
- dimension: change_completeness
569
- severity: blocker
570
- description: "Change 2 has no corresponding verification entry"
571
- plan: "01"
572
- change: 2
573
- change_name: "Create login endpoint"
574
- fix_hint: "Add curl command or test to ## Verification for login endpoint"
575
- ```
576
-
577
- ## Example 4: Scope Exceeded
578
-
579
- **Plan 01 analysis:**
580
- ```
581
- Changes (### subsections): 5
582
- Files (from **Files:** lines): 12
583
- - prisma/schema.prisma
584
- - src/app/api/auth/login/route.ts
585
- - src/app/api/auth/logout/route.ts
586
- - src/app/api/auth/refresh/route.ts
587
- - src/middleware.ts
588
- - src/lib/auth.ts
589
- - src/lib/jwt.ts
590
- - src/components/LoginForm.tsx
591
- - src/components/LogoutButton.tsx
592
- - src/app/login/page.tsx
593
- - src/app/dashboard/page.tsx
594
- - src/types/auth.ts
595
- ```
596
-
597
- **Analysis:**
598
- - 5 changes exceeds 2-3 target
599
- - 12 files is high
600
- - Auth is complex domain
601
- - Risk of quality degradation
602
-
603
- **Issue:**
604
- ```yaml
605
- issue:
606
- dimension: scope_sanity
607
- severity: blocker
608
- description: "Plan 01 has 5 changes with 12 files - exceeds context budget"
609
- plan: "01"
610
- metrics:
611
- changes: 5
612
- files: 12
613
- estimated_context: "~80%"
614
- fix_hint: "Split into: 01 (schema + API), 02 (middleware + lib), 03 (UI components)"
615
- ```
616
-
617
- </examples>
618
-
619
337
  <issue_structure>
620
338
 
621
- ## Issue Format
622
-
623
- Each issue follows this structure:
624
-
625
- ```yaml
626
- issue:
627
- plan: "16-01" # Which plan (null if phase-level)
628
- dimension: "change_completeness" # Which dimension failed
629
- severity: "blocker" # blocker | warning | info
630
- description: "Change 2 has no corresponding verification entry"
631
- change: 2 # Change number if applicable
632
- fix_hint: "Add verification command for build output"
633
- ```
634
-
635
339
  ## Severity Levels
636
340
 
637
341
  **blocker** - Must fix before execution
@@ -764,10 +468,6 @@ issues:
764
468
 
765
469
  **DO NOT accept vague changes.** "Implement auth" is not specific enough. Changes need concrete files, implementation details, verification.
766
470
 
767
- **DO NOT skip dependency analysis.** Missing EXECUTION-ORDER.md entries or file conflicts cause execution failures.
768
-
769
- **DO NOT ignore scope.** 5+ changes per plan degrades quality. Better to report and split.
770
-
771
471
  **DO NOT verify implementation details.** Check that plans describe what to build, not that code exists.
772
472
 
773
473
  **DO NOT trust change titles alone.** Read the implementation details, Files lines, verification entries. A well-named change can be empty.
@@ -778,21 +478,11 @@ issues:
778
478
 
779
479
  Plan verification complete when:
780
480
 
781
- - [ ] Phase goal extracted from ROADMAP.md
782
- - [ ] All PLAN.md files in phase directory loaded
783
- - [ ] Must-Haves parsed from `## Must-Haves` sections
784
- - [ ] Requirement coverage checked (all requirements have changes)
785
- - [ ] Change completeness validated (Files, details, verification)
786
- - [ ] EXECUTION-ORDER.md validated (all plans listed, no cycles, no file conflicts)
787
- - [ ] Key links checked (wiring planned, not just artifacts)
788
- - [ ] Scope assessed (within context budget)
789
- - [ ] Must-Haves derivation verified (user-observable truths)
790
- - [ ] Context compliance checked (if CONTEXT.md provided):
791
- - [ ] Locked decisions have implementing changes
792
- - [ ] No changes contradict locked decisions
793
- - [ ] Deferred ideas not included in plans
794
- - [ ] Overall status determined (passed | issues_found)
795
- - [ ] Structured issues returned (if any found)
796
- - [ ] Result returned to orchestrator
481
+ - [ ] Key links checked (wiring planned between artifacts, not just creation)
482
+ - [ ] Scope assessed per plan (changes, files within thresholds)
483
+ - [ ] Must-Haves are user-observable truths, not implementation details
484
+ - [ ] EXECUTION-ORDER.md validated (no missing plans, no file conflicts in same wave)
485
+ - [ ] Context compliance checked (if CONTEXT.md: locked decisions implemented, deferred ideas excluded)
486
+ - [ ] Structured issues returned to orchestrator
797
487
 
798
488
  </success_criteria>