mindsystem-cc 3.19.0 → 3.21.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 (83) hide show
  1. package/README.md +5 -6
  2. package/agents/ms-designer.md +5 -2
  3. package/agents/ms-mockup-designer.md +1 -1
  4. package/agents/ms-plan-writer.md +8 -1
  5. package/agents/ms-product-researcher.md +69 -0
  6. package/agents/ms-research-synthesizer.md +1 -1
  7. package/agents/ms-researcher.md +8 -8
  8. package/agents/ms-roadmapper.md +9 -13
  9. package/bin/install.js +68 -5
  10. package/commands/ms/add-phase.md +30 -18
  11. package/commands/ms/adhoc.md +1 -1
  12. package/commands/ms/audit-milestone.md +12 -12
  13. package/commands/ms/complete-milestone.md +25 -22
  14. package/commands/ms/config.md +202 -0
  15. package/commands/ms/design-phase.md +34 -29
  16. package/commands/ms/discuss-phase.md +26 -22
  17. package/commands/ms/doctor.md +22 -202
  18. package/commands/ms/execute-phase.md +18 -7
  19. package/commands/ms/help.md +46 -39
  20. package/commands/ms/insert-phase.md +29 -17
  21. package/commands/ms/new-milestone.md +42 -19
  22. package/commands/ms/new-project.md +88 -103
  23. package/commands/ms/plan-milestone-gaps.md +4 -5
  24. package/commands/ms/plan-phase.md +5 -3
  25. package/commands/ms/progress.md +2 -4
  26. package/commands/ms/research-phase.md +7 -12
  27. package/commands/ms/research-project.md +12 -12
  28. package/mindsystem/references/continuation-format.md +3 -3
  29. package/mindsystem/references/plan-format.md +11 -1
  30. package/mindsystem/references/principles.md +1 -1
  31. package/mindsystem/references/questioning.md +50 -8
  32. package/mindsystem/references/routing/audit-result-routing.md +12 -11
  33. package/mindsystem/references/routing/between-milestones-routing.md +2 -2
  34. package/mindsystem/references/routing/milestone-complete-routing.md +1 -1
  35. package/mindsystem/references/routing/next-phase-routing.md +4 -2
  36. package/mindsystem/templates/context.md +7 -6
  37. package/mindsystem/templates/milestone-archive.md +5 -5
  38. package/mindsystem/templates/milestone-context.md +1 -1
  39. package/mindsystem/templates/milestone.md +9 -9
  40. package/mindsystem/templates/project.md +70 -64
  41. package/mindsystem/templates/research-subagent-prompt.md +3 -3
  42. package/mindsystem/templates/roadmap-milestone.md +14 -14
  43. package/mindsystem/templates/roadmap.md +9 -7
  44. package/mindsystem/workflows/adhoc.md +1 -1
  45. package/mindsystem/workflows/complete-milestone.md +66 -107
  46. package/mindsystem/workflows/discuss-phase.md +137 -65
  47. package/mindsystem/workflows/doctor-fixes.md +273 -0
  48. package/mindsystem/workflows/execute-phase.md +7 -3
  49. package/mindsystem/workflows/execute-plan.md +6 -5
  50. package/mindsystem/workflows/map-codebase.md +2 -2
  51. package/mindsystem/workflows/mockup-generation.md +1 -1
  52. package/mindsystem/workflows/plan-phase.md +28 -3
  53. package/mindsystem/workflows/transition.md +20 -25
  54. package/mindsystem/workflows/verify-work.md +1 -1
  55. package/package.json +1 -1
  56. package/scripts/__pycache__/ms-tools.cpython-314.pyc +0 -0
  57. package/scripts/__pycache__/test_ms_tools.cpython-314-pytest-9.0.2.pyc +0 -0
  58. package/scripts/fixtures/scan-context/.planning/ROADMAP.md +16 -0
  59. package/scripts/fixtures/scan-context/.planning/adhoc/20260220-fix-token-SUMMARY.md +12 -0
  60. package/scripts/fixtures/scan-context/.planning/config.json +3 -0
  61. package/scripts/fixtures/scan-context/.planning/debug/resolved/token-bug.md +11 -0
  62. package/scripts/fixtures/scan-context/.planning/knowledge/auth.md +11 -0
  63. package/scripts/fixtures/scan-context/.planning/phases/02-infra/02-1-SUMMARY.md +20 -0
  64. package/scripts/fixtures/scan-context/.planning/phases/04-setup/04-1-SUMMARY.md +21 -0
  65. package/scripts/fixtures/scan-context/.planning/phases/05-auth/05-1-SUMMARY.md +28 -0
  66. package/scripts/fixtures/scan-context/.planning/todos/done/setup-db.md +10 -0
  67. package/scripts/fixtures/scan-context/.planning/todos/pending/add-logout.md +10 -0
  68. package/scripts/fixtures/scan-context/expected-output.json +257 -0
  69. package/scripts/ms-tools.py +2139 -0
  70. package/scripts/test_ms_tools.py +836 -0
  71. package/commands/ms/list-phase-assumptions.md +0 -56
  72. package/mindsystem/workflows/list-phase-assumptions.md +0 -178
  73. package/scripts/__pycache__/compare_mockups.cpython-314.pyc +0 -0
  74. package/scripts/archive-milestone-files.sh +0 -68
  75. package/scripts/archive-milestone-phases.sh +0 -138
  76. package/scripts/doctor-scan.sh +0 -379
  77. package/scripts/gather-milestone-stats.sh +0 -179
  78. package/scripts/generate-adhoc-patch.sh +0 -79
  79. package/scripts/generate-phase-patch.sh +0 -169
  80. package/scripts/scan-artifact-subsystems.sh +0 -55
  81. package/scripts/scan-planning-context.py +0 -839
  82. package/scripts/update-state.sh +0 -59
  83. package/scripts/validate-execution-order.sh +0 -104
@@ -1,169 +0,0 @@
1
- #!/bin/bash
2
- #
3
- # generate-phase-patch.sh
4
- # Generates a patch file with implementation changes from a phase,
5
- # excluding documentation and generated files.
6
- #
7
- # Usage: ./scripts/generate-phase-patch.sh <phase_number> [--suffix=<suffix>]
8
- # Example: ./scripts/generate-phase-patch.sh 04
9
- # ./scripts/generate-phase-patch.sh 4
10
- # ./scripts/generate-phase-patch.sh 04 --suffix=uat-fixes
11
- #
12
- # Options:
13
- # --suffix=<suffix> Filter commits by message pattern and use custom output filename
14
- # When --suffix=uat-fixes: looks for commits with "({phase}-uat):" pattern
15
- # Output: {phase}-{suffix}.patch instead of {phase}-changes.patch
16
-
17
- set -e
18
-
19
- # --- Configuration ---
20
- EXCLUSIONS=(
21
- # Documentation
22
- '.planning'
23
-
24
- # Flutter/Dart generated
25
- '*.g.dart'
26
- '*.freezed.dart'
27
- '*.gr.dart'
28
- 'generated'
29
- '.dart_tool'
30
-
31
- # Next.js/TypeScript generated
32
- 'node_modules'
33
- '.next'
34
- 'dist'
35
- 'build'
36
- '*.d.ts'
37
- '.turbo'
38
-
39
- # Common build artifacts
40
- '*.lock'
41
- )
42
-
43
- # --- Parse arguments ---
44
- PHASE_INPUT=""
45
- SUFFIX=""
46
-
47
- for arg in "$@"; do
48
- case $arg in
49
- --suffix=*)
50
- SUFFIX="${arg#*=}"
51
- ;;
52
- *)
53
- if [ -z "$PHASE_INPUT" ]; then
54
- PHASE_INPUT="$arg"
55
- fi
56
- ;;
57
- esac
58
- done
59
-
60
- # --- Validation ---
61
- if [ -z "$PHASE_INPUT" ]; then
62
- echo "Error: Phase number required"
63
- echo "Usage: $0 <phase_number> [--suffix=<suffix>]"
64
- exit 1
65
- fi
66
-
67
- # --- Find git root ---
68
- GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
69
- if [ -z "$GIT_ROOT" ]; then
70
- echo "Error: Not in a git repository"
71
- exit 1
72
- fi
73
- cd "$GIT_ROOT"
74
-
75
- # --- Normalize phase number (zero-pad if needed) ---
76
- if [[ "$PHASE_INPUT" =~ ^[0-9]$ ]]; then
77
- PHASE_NUMBER=$(printf "%02d" "$PHASE_INPUT")
78
- else
79
- PHASE_NUMBER="$PHASE_INPUT"
80
- fi
81
-
82
- # --- Determine commit pattern based on suffix ---
83
- if [ -n "$SUFFIX" ]; then
84
- # With suffix: filter by specific pattern
85
- # For uat-fixes: look for "fix({phase}-uat):" pattern
86
- if [ "$SUFFIX" = "uat-fixes" ]; then
87
- COMMIT_PATTERN="\($PHASE_NUMBER-uat\):"
88
- echo "Generating UAT fixes patch for phase $PHASE_NUMBER..."
89
- else
90
- # Generic suffix: look for pattern with suffix in scope
91
- COMMIT_PATTERN="\($PHASE_NUMBER-$SUFFIX\):"
92
- echo "Generating $SUFFIX patch for phase $PHASE_NUMBER..."
93
- fi
94
- else
95
- # No suffix: standard phase commits
96
- COMMIT_PATTERN="\($PHASE_NUMBER-"
97
- echo "Generating patch for phase $PHASE_NUMBER..."
98
- fi
99
-
100
- # --- Find matching commits ---
101
- PHASE_COMMITS=$(git log --oneline | grep -E "$COMMIT_PATTERN" | cut -d' ' -f1 || true)
102
-
103
- if [ -z "$PHASE_COMMITS" ]; then
104
- echo "No commits found matching pattern: $COMMIT_PATTERN"
105
- echo "Patch skipped"
106
- exit 0
107
- fi
108
-
109
- COMMIT_COUNT=$(echo "$PHASE_COMMITS" | wc -l | tr -d ' ')
110
- echo "Found $COMMIT_COUNT commit(s)"
111
-
112
- # --- Determine base commit ---
113
- EARLIEST_COMMIT=$(echo "$PHASE_COMMITS" | tail -1)
114
- BASE_COMMIT=$(git rev-parse "${EARLIEST_COMMIT}^" 2>/dev/null || git rev-list --max-parents=0 HEAD)
115
- echo "Base commit: $(git log --oneline -1 "$BASE_COMMIT")"
116
-
117
- # --- Find output directory ---
118
- PHASES_DIR=".planning/phases"
119
- PHASE_DIR=$(find "$PHASES_DIR" -maxdepth 1 -type d -name "${PHASE_NUMBER}-*" 2>/dev/null | head -1)
120
-
121
- if [ -z "$PHASE_DIR" ]; then
122
- PHASE_DIR="$PHASES_DIR"
123
- echo "No phase directory found, saving to $PHASES_DIR/"
124
- else
125
- echo "Output directory: $PHASE_DIR/"
126
- fi
127
-
128
- # Ensure directory exists
129
- mkdir -p "$PHASE_DIR"
130
-
131
- # --- Build exclusion arguments ---
132
- EXCLUDE_ARGS=""
133
- for pattern in "${EXCLUSIONS[@]}"; do
134
- EXCLUDE_ARGS="$EXCLUDE_ARGS ':!$pattern'"
135
- done
136
-
137
- # --- Determine output filename ---
138
- if [ -n "$SUFFIX" ]; then
139
- PATCH_FILE="$PHASE_DIR/${PHASE_NUMBER}-${SUFFIX}.patch"
140
- else
141
- PATCH_FILE="$PHASE_DIR/${PHASE_NUMBER}-changes.patch"
142
- fi
143
-
144
- # --- Generate diff ---
145
- # For suffix mode: generate diff only for the specific commits
146
- # For standard mode: generate diff from base to HEAD
147
- if [ -n "$SUFFIX" ]; then
148
- # Create combined diff from all matching commits
149
- LATEST_COMMIT=$(echo "$PHASE_COMMITS" | head -1)
150
- eval "git diff \"$BASE_COMMIT\" \"$LATEST_COMMIT\" -- . $EXCLUDE_ARGS" > "$PATCH_FILE"
151
- else
152
- eval "git diff \"$BASE_COMMIT\" HEAD -- . $EXCLUDE_ARGS" > "$PATCH_FILE"
153
- fi
154
-
155
- # --- Check result ---
156
- if [ ! -s "$PATCH_FILE" ]; then
157
- rm "$PATCH_FILE"
158
- echo "No implementation changes outside excluded patterns"
159
- echo "Patch skipped"
160
- exit 0
161
- fi
162
-
163
- PATCH_LINES=$(wc -l < "$PATCH_FILE" | tr -d ' ')
164
- echo ""
165
- echo "Generated: $PATCH_FILE ($PATCH_LINES lines)"
166
- echo ""
167
- echo "Review: cat $PATCH_FILE"
168
- echo "Apply: git apply $PATCH_FILE"
169
- echo "Discard: rm $PATCH_FILE"
@@ -1,55 +0,0 @@
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