maxsimcli 4.7.1 → 4.9.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 (161) hide show
  1. package/dist/assets/CHANGELOG.md +20 -0
  2. package/dist/assets/hooks/maxsim-check-update.cjs +38 -0
  3. package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -1
  4. package/dist/assets/hooks/maxsim-statusline.cjs +116 -48
  5. package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -1
  6. package/dist/assets/hooks/maxsim-sync-reminder.cjs +117 -0
  7. package/dist/assets/hooks/maxsim-sync-reminder.cjs.map +1 -0
  8. package/dist/assets/templates/agents/AGENTS.md +78 -106
  9. package/dist/assets/templates/agents/executor.md +101 -0
  10. package/dist/assets/templates/agents/planner.md +86 -0
  11. package/dist/assets/templates/agents/researcher.md +71 -0
  12. package/dist/assets/templates/agents/verifier.md +88 -0
  13. package/dist/assets/templates/commands/maxsim/debug.md +7 -7
  14. package/dist/assets/templates/commands/maxsim/execute.md +45 -0
  15. package/dist/assets/templates/commands/maxsim/go.md +29 -0
  16. package/dist/assets/templates/commands/maxsim/help.md +2 -2
  17. package/dist/assets/templates/commands/maxsim/init.md +52 -0
  18. package/dist/assets/templates/commands/maxsim/plan.md +50 -0
  19. package/dist/assets/templates/commands/maxsim/progress.md +4 -3
  20. package/dist/assets/templates/commands/maxsim/quick.md +6 -4
  21. package/dist/assets/templates/commands/maxsim/settings.md +4 -3
  22. package/dist/assets/templates/references/continuation-format.md +16 -16
  23. package/dist/assets/templates/references/model-profile-resolution.md +1 -1
  24. package/dist/assets/templates/references/model-profiles.md +12 -19
  25. package/dist/assets/templates/rules/conventions.md +51 -0
  26. package/dist/assets/templates/rules/verification-protocol.md +57 -0
  27. package/dist/assets/templates/skills/agent-system-map/SKILL.md +92 -0
  28. package/dist/assets/templates/skills/brainstorming/SKILL.md +48 -36
  29. package/dist/assets/templates/skills/code-review/SKILL.md +40 -61
  30. package/dist/assets/templates/skills/commit-conventions/SKILL.md +75 -0
  31. package/dist/assets/templates/skills/evidence-collection/SKILL.md +87 -0
  32. package/dist/assets/templates/skills/handoff-contract/SKILL.md +70 -0
  33. package/dist/assets/templates/skills/input-validation/SKILL.md +51 -0
  34. package/dist/assets/templates/skills/maxsim-batch/SKILL.md +41 -45
  35. package/dist/assets/templates/skills/maxsim-simplify/SKILL.md +37 -90
  36. package/dist/assets/templates/skills/memory-management/SKILL.md +32 -67
  37. package/dist/assets/templates/skills/research-methodology/SKILL.md +137 -0
  38. package/dist/assets/templates/skills/roadmap-writing/SKILL.md +40 -58
  39. package/dist/assets/templates/skills/sdd/SKILL.md +34 -69
  40. package/dist/assets/templates/skills/systematic-debugging/SKILL.md +20 -26
  41. package/dist/assets/templates/skills/tdd/SKILL.md +25 -33
  42. package/dist/assets/templates/skills/tool-priority-guide/SKILL.md +80 -0
  43. package/dist/assets/templates/skills/using-maxsim/SKILL.md +42 -73
  44. package/dist/assets/templates/skills/verification-before-completion/SKILL.md +12 -24
  45. package/dist/assets/templates/skills/verification-gates/SKILL.md +169 -0
  46. package/dist/assets/templates/templates/UAT.md +3 -3
  47. package/dist/assets/templates/templates/VALIDATION.md +1 -1
  48. package/dist/assets/templates/templates/context.md +4 -4
  49. package/dist/assets/templates/templates/debug-subagent-prompt.md +3 -3
  50. package/dist/assets/templates/templates/discovery.md +2 -2
  51. package/dist/assets/templates/templates/phase-prompt.md +2 -2
  52. package/dist/assets/templates/templates/planner-subagent-prompt.md +7 -7
  53. package/dist/assets/templates/templates/project.md +1 -1
  54. package/dist/assets/templates/templates/research.md +1 -1
  55. package/dist/assets/templates/templates/state.md +2 -2
  56. package/dist/assets/templates/templates/summary.md +41 -0
  57. package/dist/assets/templates/workflows/batch.md +5 -5
  58. package/dist/assets/templates/workflows/diagnose-issues.md +2 -2
  59. package/dist/assets/templates/workflows/discovery-phase.md +3 -3
  60. package/dist/assets/templates/workflows/discuss-phase.md +11 -11
  61. package/dist/assets/templates/workflows/execute-phase.md +205 -11
  62. package/dist/assets/templates/workflows/execute-plan.md +299 -34
  63. package/dist/assets/templates/workflows/execute.md +421 -0
  64. package/dist/assets/templates/workflows/go.md +250 -0
  65. package/dist/assets/templates/workflows/health.md +5 -5
  66. package/dist/assets/templates/workflows/help.md +165 -435
  67. package/dist/assets/templates/workflows/init-existing.md +23 -23
  68. package/dist/assets/templates/workflows/init.md +205 -0
  69. package/dist/assets/templates/workflows/new-milestone.md +9 -9
  70. package/dist/assets/templates/workflows/new-project.md +26 -26
  71. package/dist/assets/templates/workflows/plan-create.md +298 -0
  72. package/dist/assets/templates/workflows/plan-discuss.md +347 -0
  73. package/dist/assets/templates/workflows/plan-phase.md +29 -29
  74. package/dist/assets/templates/workflows/plan-research.md +177 -0
  75. package/dist/assets/templates/workflows/plan.md +231 -0
  76. package/dist/assets/templates/workflows/progress.md +46 -42
  77. package/dist/assets/templates/workflows/quick.md +195 -14
  78. package/dist/assets/templates/workflows/research-phase.md +5 -5
  79. package/dist/assets/templates/workflows/sdd.md +20 -12
  80. package/dist/assets/templates/workflows/settings.md +18 -14
  81. package/dist/assets/templates/workflows/verify-phase.md +1 -1
  82. package/dist/assets/templates/workflows/verify-work.md +16 -16
  83. package/dist/cli.cjs +496 -91
  84. package/dist/cli.cjs.map +1 -1
  85. package/dist/core-D5zUr9cb.cjs.map +1 -1
  86. package/dist/install.cjs +274 -355
  87. package/dist/install.cjs.map +1 -1
  88. package/dist/mcp-server.cjs +5213 -2248
  89. package/dist/mcp-server.cjs.map +1 -1
  90. package/dist/skills-CjFWZIGM.cjs.map +1 -1
  91. package/package.json +4 -1
  92. package/dist/assets/hooks/maxsim-context-monitor.cjs +0 -121
  93. package/dist/assets/hooks/maxsim-context-monitor.cjs.map +0 -1
  94. package/dist/assets/templates/agents/maxsim-code-reviewer.md +0 -239
  95. package/dist/assets/templates/agents/maxsim-codebase-mapper.md +0 -214
  96. package/dist/assets/templates/agents/maxsim-debugger.md +0 -572
  97. package/dist/assets/templates/agents/maxsim-drift-checker.md +0 -522
  98. package/dist/assets/templates/agents/maxsim-executor.md +0 -504
  99. package/dist/assets/templates/agents/maxsim-integration-checker.md +0 -273
  100. package/dist/assets/templates/agents/maxsim-phase-researcher.md +0 -305
  101. package/dist/assets/templates/agents/maxsim-plan-checker.md +0 -343
  102. package/dist/assets/templates/agents/maxsim-planner.md +0 -610
  103. package/dist/assets/templates/agents/maxsim-project-researcher.md +0 -359
  104. package/dist/assets/templates/agents/maxsim-research-synthesizer.md +0 -263
  105. package/dist/assets/templates/agents/maxsim-roadmapper.md +0 -324
  106. package/dist/assets/templates/agents/maxsim-spec-reviewer.md +0 -245
  107. package/dist/assets/templates/agents/maxsim-verifier.md +0 -393
  108. package/dist/assets/templates/commands/maxsim/add-phase.md +0 -43
  109. package/dist/assets/templates/commands/maxsim/add-tests.md +0 -41
  110. package/dist/assets/templates/commands/maxsim/add-todo.md +0 -57
  111. package/dist/assets/templates/commands/maxsim/artefakte.md +0 -122
  112. package/dist/assets/templates/commands/maxsim/audit-milestone.md +0 -36
  113. package/dist/assets/templates/commands/maxsim/batch.md +0 -42
  114. package/dist/assets/templates/commands/maxsim/check-drift.md +0 -56
  115. package/dist/assets/templates/commands/maxsim/check-todos.md +0 -46
  116. package/dist/assets/templates/commands/maxsim/cleanup.md +0 -18
  117. package/dist/assets/templates/commands/maxsim/complete-milestone.md +0 -136
  118. package/dist/assets/templates/commands/maxsim/discuss-phase.md +0 -87
  119. package/dist/assets/templates/commands/maxsim/discuss.md +0 -70
  120. package/dist/assets/templates/commands/maxsim/execute-phase.md +0 -41
  121. package/dist/assets/templates/commands/maxsim/health.md +0 -22
  122. package/dist/assets/templates/commands/maxsim/init-existing.md +0 -46
  123. package/dist/assets/templates/commands/maxsim/insert-phase.md +0 -32
  124. package/dist/assets/templates/commands/maxsim/list-phase-assumptions.md +0 -46
  125. package/dist/assets/templates/commands/maxsim/map-codebase.md +0 -71
  126. package/dist/assets/templates/commands/maxsim/new-milestone.md +0 -44
  127. package/dist/assets/templates/commands/maxsim/new-project.md +0 -46
  128. package/dist/assets/templates/commands/maxsim/pause-work.md +0 -38
  129. package/dist/assets/templates/commands/maxsim/plan-milestone-gaps.md +0 -34
  130. package/dist/assets/templates/commands/maxsim/plan-phase.md +0 -44
  131. package/dist/assets/templates/commands/maxsim/realign.md +0 -39
  132. package/dist/assets/templates/commands/maxsim/reapply-patches.md +0 -110
  133. package/dist/assets/templates/commands/maxsim/remove-phase.md +0 -31
  134. package/dist/assets/templates/commands/maxsim/research-phase.md +0 -189
  135. package/dist/assets/templates/commands/maxsim/resume-work.md +0 -40
  136. package/dist/assets/templates/commands/maxsim/roadmap.md +0 -19
  137. package/dist/assets/templates/commands/maxsim/sdd.md +0 -39
  138. package/dist/assets/templates/commands/maxsim/set-profile.md +0 -34
  139. package/dist/assets/templates/commands/maxsim/update.md +0 -37
  140. package/dist/assets/templates/commands/maxsim/verify-work.md +0 -38
  141. package/dist/assets/templates/workflows/add-phase.md +0 -111
  142. package/dist/assets/templates/workflows/add-tests.md +0 -351
  143. package/dist/assets/templates/workflows/add-todo.md +0 -247
  144. package/dist/assets/templates/workflows/audit-milestone.md +0 -297
  145. package/dist/assets/templates/workflows/check-drift.md +0 -248
  146. package/dist/assets/templates/workflows/check-todos.md +0 -261
  147. package/dist/assets/templates/workflows/cleanup.md +0 -153
  148. package/dist/assets/templates/workflows/complete-milestone.md +0 -701
  149. package/dist/assets/templates/workflows/discuss.md +0 -343
  150. package/dist/assets/templates/workflows/insert-phase.md +0 -129
  151. package/dist/assets/templates/workflows/list-phase-assumptions.md +0 -178
  152. package/dist/assets/templates/workflows/map-codebase.md +0 -315
  153. package/dist/assets/templates/workflows/pause-work.md +0 -122
  154. package/dist/assets/templates/workflows/plan-milestone-gaps.md +0 -274
  155. package/dist/assets/templates/workflows/realign.md +0 -288
  156. package/dist/assets/templates/workflows/remove-phase.md +0 -154
  157. package/dist/assets/templates/workflows/resume-project.md +0 -306
  158. package/dist/assets/templates/workflows/roadmap.md +0 -130
  159. package/dist/assets/templates/workflows/set-profile.md +0 -81
  160. package/dist/assets/templates/workflows/transition.md +0 -544
  161. package/dist/assets/templates/workflows/update.md +0 -220
@@ -27,7 +27,7 @@ Check if `--auto` flag is present in $ARGUMENTS.
27
27
  - Auto mode does NOT require an idea document (unlike new-project's --auto)
28
28
  - Default config: stage=MVP, branching_strategy=none, model_profile=balanced, mode=yolo, depth=standard
29
29
  - After scan: generate all documents with smart inferences
30
- - Add `<!-- Auto-generated by /maxsim:init-existing --auto. Review recommended. -->` comment at top of each generated document
30
+ - Add `<!-- Auto-generated by /maxsim:init --auto. Review recommended. -->` comment at top of each generated document
31
31
  - Auto mode still creates all documents: config.json, PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md
32
32
  - If `.planning/` exists: auto mode defaults to merge behavior (keep existing, fill gaps, re-scan)
33
33
  - If `.planning/` does not exist: create fresh
@@ -53,7 +53,7 @@ Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `ma
53
53
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
54
54
 
55
55
  No source code or package manifest detected in this directory.
56
- For greenfield projects, use /maxsim:new-project instead.
56
+ For greenfield projects, use /maxsim:init instead.
57
57
  ```
58
58
 
59
59
  Use AskUserQuestion:
@@ -61,9 +61,9 @@ Use AskUserQuestion:
61
61
  - question: "No code detected. Continue with init-existing anyway, or switch to new-project?"
62
62
  - options:
63
63
  - "Continue anyway" -- I know there's code here (maybe in subdirectories)
64
- - "Switch to /maxsim:new-project" -- This is a greenfield project
64
+ - "Switch to /maxsim:init" -- This is a greenfield project
65
65
 
66
- **If "Switch":** Print "Run `/maxsim:new-project` to start a greenfield project." and exit.
66
+ **If "Switch":** Print "Run `/maxsim:init` to start a greenfield project." and exit.
67
67
  **If "Continue":** Proceed to Step 2.
68
68
 
69
69
  **In auto mode:** If no code detected, proceed anyway (scan will find what it can).
@@ -108,7 +108,7 @@ Use AskUserQuestion:
108
108
  - options:
109
109
  - "Merge (Recommended)" -- Keep existing files, fill gaps, re-scan codebase
110
110
  - "Overwrite" -- Delete existing .planning/ and start fresh
111
- - "Cancel" -- Exit (run /maxsim:health to diagnose)
111
+ - "Cancel" -- Exit (run /maxsim:progress (health check) to diagnose)
112
112
 
113
113
  **On Merge:**
114
114
  - Note which core files exist: config.json, PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md
@@ -142,7 +142,7 @@ mkdir -p .planning
142
142
  Proceed to Step 3.
143
143
 
144
144
  **On Cancel:**
145
- Print: "Cancelled. Run `/maxsim:health` to diagnose your .planning/ state."
145
+ Print: "Cancelled. Run `/maxsim:progress (health check)` to diagnose your .planning/ state."
146
146
  Exit workflow.
147
147
 
148
148
  ## Step 3: Codebase Scan
@@ -171,13 +171,13 @@ mkdir -p .planning/codebase/
171
171
 
172
172
  Spawn 4 mapper agents using the Task tool. Follow the EXACT pattern from `templates/workflows/map-codebase.md`.
173
173
 
174
- **CRITICAL:** Spawn mapper agents directly using the Task tool. Do NOT invoke `/maxsim:map-codebase` command (that would exit the current workflow context).
174
+ **CRITICAL:** Spawn mapper agents directly using the Task tool. Do NOT invoke `/maxsim:init (codebase mapping stage)` command (that would exit the current workflow context).
175
175
 
176
176
  **Agent 1: Tech Focus**
177
177
 
178
178
  ```
179
179
  Task(
180
- subagent_type="maxsim-codebase-mapper",
180
+ subagent_type="researcher",
181
181
  model="{mapper_model}",
182
182
  run_in_background=true,
183
183
  description="Map codebase tech stack",
@@ -196,7 +196,7 @@ Explore thoroughly. Write documents directly using templates. Return confirmatio
196
196
 
197
197
  ```
198
198
  Task(
199
- subagent_type="maxsim-codebase-mapper",
199
+ subagent_type="researcher",
200
200
  model="{mapper_model}",
201
201
  run_in_background=true,
202
202
  description="Map codebase architecture",
@@ -215,7 +215,7 @@ Explore thoroughly. Write documents directly using templates. Return confirmatio
215
215
 
216
216
  ```
217
217
  Task(
218
- subagent_type="maxsim-codebase-mapper",
218
+ subagent_type="researcher",
219
219
  model="{mapper_model}",
220
220
  run_in_background=true,
221
221
  description="Map codebase conventions",
@@ -234,7 +234,7 @@ Explore thoroughly. Write documents directly using templates. Return confirmatio
234
234
 
235
235
  ```
236
236
  Task(
237
- subagent_type="maxsim-codebase-mapper",
237
+ subagent_type="researcher",
238
238
  model="{mapper_model}",
239
239
  run_in_background=true,
240
240
  description="Map codebase concerns",
@@ -856,7 +856,7 @@ If no discrepancies, omit this section.
856
856
 
857
857
  **If auto mode:** Add at top of file:
858
858
  ```markdown
859
- <!-- Auto-generated by /maxsim:init-existing --auto. Review recommended. -->
859
+ <!-- Auto-generated by /maxsim:init --auto. Review recommended. -->
860
860
  ```
861
861
 
862
862
  ### 9b: REQUIREMENTS.md
@@ -1006,7 +1006,7 @@ These are MUST NOT requirements derived from production constraints:
1006
1006
 
1007
1007
  **If auto mode:** Add at top of file:
1008
1008
  ```markdown
1009
- <!-- Auto-generated by /maxsim:init-existing --auto. Review recommended. -->
1009
+ <!-- Auto-generated by /maxsim:init --auto. Review recommended. -->
1010
1010
  ```
1011
1011
 
1012
1012
  ### 9c: ROADMAP.md
@@ -1023,7 +1023,7 @@ Use template from `templates/roadmap.md`.
1023
1023
  ◆ Spawning roadmapper...
1024
1024
  ```
1025
1025
 
1026
- Spawn the `maxsim-roadmapper` agent via Task tool to generate the roadmap:
1026
+ Spawn the planner (roadmap mode) via Task tool to generate the roadmap:
1027
1027
 
1028
1028
  ```
1029
1029
  Task(prompt="
@@ -1068,7 +1068,7 @@ not generic setup phases. The codebase already exists.
1068
1068
 
1069
1069
  Write files first, then return. This ensures artifacts persist even if context is lost.
1070
1070
  </instructions>
1071
- ", subagent_type="maxsim-roadmapper", model="{roadmapper_model}", description="Create roadmap for existing project")
1071
+ ", subagent_type="planner", model="{roadmapper_model}", description="Create roadmap for existing project")
1072
1072
  ```
1073
1073
 
1074
1074
  **Handle roadmapper return:**
@@ -1124,7 +1124,7 @@ Pre-populate:
1124
1124
 
1125
1125
  **If auto mode:** Add at top of file:
1126
1126
  ```markdown
1127
- <!-- Auto-generated by /maxsim:init-existing --auto. Review recommended. -->
1127
+ <!-- Auto-generated by /maxsim:init --auto. Review recommended. -->
1128
1128
  ```
1129
1129
 
1130
1130
  ### 9e: config.json
@@ -1156,7 +1156,7 @@ Write content:
1156
1156
  | 3 | [Any constraint decisions from Step 7] | [Why] | [Alternatives] | Locked |
1157
1157
 
1158
1158
  ---
1159
- *Decisions captured during /maxsim:init-existing initialization*
1159
+ *Decisions captured during /maxsim:init initialization*
1160
1160
  ```
1161
1161
 
1162
1162
  **ACCEPTANCE-CRITERIA.md:**
@@ -1181,7 +1181,7 @@ Write content:
1181
1181
 
1182
1182
  ## Phase-Level Criteria
1183
1183
 
1184
- Populated per-phase during /maxsim:discuss-phase.
1184
+ Populated per-phase during /maxsim:plan (discussion stage).
1185
1185
 
1186
1186
  ---
1187
1187
  *Criteria derived from init-existing initialization*
@@ -1218,7 +1218,7 @@ Write content:
1218
1218
  - [What this milestone is NOT trying to achieve]
1219
1219
 
1220
1220
  ---
1221
- *No-gos captured during /maxsim:init-existing initialization*
1221
+ *No-gos captured during /maxsim:init initialization*
1222
1222
  ```
1223
1223
 
1224
1224
  **If auto mode:** Generate artefakte from scan findings with reasonable inferences. Mark uncertain entries with `(inferred)`.
@@ -1293,7 +1293,7 @@ git add .planning/
1293
1293
 
1294
1294
  If `commit_docs` is true:
1295
1295
  ```bash
1296
- git commit -m "docs: initialize MAXSIM in existing project via /maxsim:init-existing"
1296
+ git commit -m "docs: initialize MAXSIM in existing project via /maxsim:init"
1297
1297
  ```
1298
1298
 
1299
1299
  Print structured summary:
@@ -1327,14 +1327,14 @@ Print next steps:
1327
1327
 
1328
1328
  **Phase 1: [Phase Name]** -- [Goal from ROADMAP.md]
1329
1329
 
1330
- /maxsim:plan-phase 1 -- plan the first phase
1330
+ /maxsim:plan 1 -- plan the first phase
1331
1331
 
1332
1332
  <sub>/clear first → fresh context window</sub>
1333
1333
 
1334
1334
  ───────────────────────────────────────────────────────────────
1335
1335
 
1336
1336
  **Also available:**
1337
- - /maxsim:roadmap -- review the generated roadmap
1337
+ - /maxsim:progress -- review the generated roadmap
1338
1338
  - /maxsim:progress -- see project status
1339
1339
 
1340
1340
  ───────────────────────────────────────────────────────────────
@@ -1388,7 +1388,7 @@ Print next steps:
1388
1388
  - [ ] CONCERNS.md findings presented as candidate no-gos
1389
1389
  - [ ] Agent dry-run validation passed (Quality Score >= 7)
1390
1390
  - [ ] Structured summary printed
1391
- - [ ] Next steps suggested: /maxsim:roadmap then /maxsim:plan-phase 1
1391
+ - [ ] Next steps suggested: /maxsim:progress then /maxsim:plan 1
1392
1392
 
1393
1393
  **Auto mode criteria:**
1394
1394
  - [ ] All questions skipped
@@ -0,0 +1,205 @@
1
+ <purpose>
2
+
3
+ Unified initialization router. Detects the current project state and delegates to the appropriate sub-workflow:
4
+ - **New project** (no .planning/) -> delegates to @./workflows/new-project.md
5
+ - **Existing project** (.planning/ exists, no ROADMAP.md) -> delegates to @./workflows/init-existing.md
6
+ - **Active milestone** (.planning/ + ROADMAP.md, phases in progress) -> shows status, offers options
7
+ - **Milestone complete** (all phases done) -> offers completion or new milestone via @./workflows/new-milestone.md
8
+
9
+ This file is a THIN ROUTER. All heavy logic lives in the sub-workflows.
10
+
11
+ </purpose>
12
+
13
+ <required_reading>
14
+
15
+ Read all files referenced by the invoking prompt's execution_context before starting.
16
+
17
+ </required_reading>
18
+
19
+ <process>
20
+
21
+ ## 1. Parse Flags
22
+
23
+ Check if `--auto` was passed in $ARGUMENTS. If present, set `AUTO_MODE=true` and pass through to sub-workflows.
24
+
25
+ ## 2. Detect Scenario
26
+
27
+ Run filesystem checks to determine which flow applies:
28
+
29
+ ```bash
30
+ # Check project state
31
+ PLANNING_EXISTS=$(test -d .planning && echo "true" || echo "false")
32
+
33
+ if [ "$PLANNING_EXISTS" = "true" ]; then
34
+ ROADMAP_EXISTS=$(test -f .planning/ROADMAP.md && echo "true" || echo "false")
35
+ STATE_EXISTS=$(test -f .planning/STATE.md && echo "true" || echo "false")
36
+ else
37
+ ROADMAP_EXISTS="false"
38
+ STATE_EXISTS="false"
39
+ fi
40
+
41
+ echo "PLANNING=$PLANNING_EXISTS ROADMAP=$ROADMAP_EXISTS STATE=$STATE_EXISTS"
42
+ ```
43
+
44
+ Use the results to route:
45
+
46
+ | PLANNING | ROADMAP | Route |
47
+ |----------|---------|-------|
48
+ | false | - | Scenario A: New Project |
49
+ | true | false | Scenario B: Existing Project |
50
+ | true | true | Scenario C or D: check phase completion |
51
+
52
+ For Scenario C vs D, check phase progress:
53
+
54
+ ```bash
55
+ node .claude/maxsim/bin/maxsim-tools.cjs roadmap analyze 2>/dev/null || echo "NO_ANALYSIS"
56
+ ```
57
+
58
+ If all phases show status "complete" -> Scenario D (Milestone Complete).
59
+ Otherwise -> Scenario C (Active Milestone).
60
+
61
+ ## 3. Route to Scenario
62
+
63
+ ### Scenario A: New Project
64
+
65
+ No `.planning/` directory found. This is a fresh project initialization.
66
+
67
+ Display:
68
+
69
+ ```
70
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
71
+ MAXSIM ► INITIALIZING NEW PROJECT
72
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
73
+ ```
74
+
75
+ Delegate to @./workflows/new-project.md -- execute the full new-project workflow end-to-end.
76
+
77
+ Pass through:
78
+ - `--auto` flag if set
79
+ - All $ARGUMENTS for idea document references
80
+
81
+ After the new-project workflow completes, display:
82
+
83
+ ```
84
+ Project initialized. Run /maxsim:plan 1 to start phase planning.
85
+ ```
86
+
87
+ ### Scenario B: Existing Project
88
+
89
+ `.planning/` exists but no `ROADMAP.md`. This is an existing codebase that needs MAXSIM initialization.
90
+
91
+ Display:
92
+
93
+ ```
94
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
+ MAXSIM ► INITIALIZING EXISTING PROJECT
96
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
97
+ ```
98
+
99
+ Delegate to @./workflows/init-existing.md -- execute the full init-existing workflow end-to-end.
100
+
101
+ Pass through:
102
+ - `--auto` flag if set
103
+
104
+ After the init-existing workflow completes, display:
105
+
106
+ ```
107
+ Project initialized. Run /maxsim:plan 1 to start phase planning.
108
+ ```
109
+
110
+ ### Scenario C: Active Milestone
111
+
112
+ `.planning/` and `ROADMAP.md` exist with phases still in progress. The project is actively being worked on.
113
+
114
+ Display:
115
+
116
+ ```
117
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
+ MAXSIM ► PROJECT STATUS
119
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
120
+ ```
121
+
122
+ Load current state:
123
+
124
+ ```bash
125
+ node .claude/maxsim/bin/maxsim-tools.cjs state load 2>/dev/null
126
+ ```
127
+
128
+ Read `.planning/ROADMAP.md` and `.planning/STATE.md` to display:
129
+ - Current milestone name and version
130
+ - Phase progress (completed/total)
131
+ - Current phase and plan being executed
132
+ - Recent activity from session continuity
133
+
134
+ Then present options conversationally (natural language, not AskUserQuestion):
135
+
136
+ **Options:**
137
+
138
+ 1. **Continue working** -- Based on the current state, suggest the next logical action:
139
+ - If a plan is in progress: "Continue executing Plan {N} with `/maxsim:execute {phase}`"
140
+ - If a phase needs planning: "Plan the next phase with `/maxsim:plan {phase}`"
141
+ - If verification is pending: "Verify the current phase"
142
+
143
+ 2. **Start a new milestone** -- If the user wants to pivot or start fresh:
144
+ - Delegate to @./workflows/new-milestone.md for the milestone creation flow
145
+
146
+ 3. **View detailed progress** -- Direct to `/maxsim:progress` for full status
147
+
148
+ 4. **Exit** -- No action needed
149
+
150
+ Wait for the user's choice and route accordingly.
151
+
152
+ ### Scenario D: Milestone Complete
153
+
154
+ `.planning/` and `ROADMAP.md` exist with all phases marked complete. The current milestone is finished.
155
+
156
+ Display:
157
+
158
+ ```
159
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
160
+ MAXSIM ► MILESTONE COMPLETE
161
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
162
+ ```
163
+
164
+ Load state and display completion summary:
165
+ - Milestone name and version
166
+ - Total phases completed
167
+ - Key metrics (plans executed, decisions made)
168
+
169
+ Then present options conversationally:
170
+
171
+ **Options:**
172
+
173
+ 1. **Complete and archive this milestone** -- Run the milestone completion flow:
174
+ - Delegate to @./workflows/new-milestone.md with completion mode
175
+ - Archives current milestone data
176
+ - Updates MILESTONES.md with summary
177
+
178
+ 2. **Start a new milestone** -- Begin the next cycle:
179
+ - Delegate to @./workflows/new-milestone.md for creation flow
180
+ - Gathers new milestone goals
181
+ - Creates fresh REQUIREMENTS.md and ROADMAP.md
182
+
183
+ 3. **View final progress** -- Direct to `/maxsim:progress` for the full report
184
+
185
+ Wait for the user's choice and route accordingly.
186
+
187
+ ## 4. Context Management
188
+
189
+ For long-running flows (Scenarios A and B especially), the sub-workflows handle their own context management including checkpoint-before-clear patterns. The router does not need to manage context beyond the initial detection and delegation.
190
+
191
+ If context is filling up during Scenario C or D interactive options:
192
+ - Recommend the user run `/clear` and then the specific command for their chosen action
193
+ - Example: "Context is getting large. Run `/clear`, then `/maxsim:plan 3` to continue planning phase 3."
194
+
195
+ </process>
196
+
197
+ <constraints>
198
+
199
+ - This workflow is a ROUTER only. All project initialization logic lives in the sub-workflows.
200
+ - Do NOT inline or duplicate logic from new-project.md, init-existing.md, or new-milestone.md.
201
+ - Do NOT reference removed command names in user-facing output. The old per-scenario commands no longer exist as user-facing commands.
202
+ - The sub-workflows may still reference removed command names internally -- that is expected and will be cleaned up in a later plan.
203
+ - For Scenarios C and D, use natural conversational flow for options. Do not use AskUserQuestion for the menu -- just present options and let the user respond naturally.
204
+
205
+ </constraints>
@@ -93,7 +93,7 @@ AskUserQuestion: "Research the domain ecosystem for new features before defining
93
93
  - "Research first (Recommended)" — Discover patterns, features, architecture for NEW capabilities
94
94
  - "Skip research" — Go straight to requirements
95
95
 
96
- **Persist choice to config** (so future `/maxsim:plan-phase` honors it):
96
+ **Persist choice to config** (so future `/maxsim:plan` honors it):
97
97
 
98
98
  ```bash
99
99
  # If "Research first": persist true
@@ -118,7 +118,7 @@ node ~/.claude/maxsim/bin/maxsim-tools.cjs config-set workflow.research false
118
118
  mkdir -p .planning/research
119
119
  ```
120
120
 
121
- Spawn 4 parallel maxsim-project-researcher agents. Each uses this template with dimension-specific fields:
121
+ Spawn 4 parallel researcher agents. Each uses this template with dimension-specific fields:
122
122
 
123
123
  **Common structure for all 4 researchers:**
124
124
  ```
@@ -145,7 +145,7 @@ Focus ONLY on what's needed for the NEW features.
145
145
  Write to: .planning/research/{FILE}
146
146
  Use template: ~/.claude/maxsim/templates/research-project/{FILE}
147
147
  </output>
148
- ", subagent_type="maxsim-project-researcher", model="{researcher_model}", description="{DIMENSION} research")
148
+ ", subagent_type="researcher", model="{researcher_model}", description="{DIMENSION} research")
149
149
  ```
150
150
 
151
151
  **Dimension-specific fields:**
@@ -174,7 +174,7 @@ Synthesize research outputs into SUMMARY.md.
174
174
  Write to: .planning/research/SUMMARY.md
175
175
  Use template: ~/.claude/maxsim/templates/research-project/SUMMARY.md
176
176
  Commit after writing.
177
- ", subagent_type="maxsim-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
177
+ ", subagent_type="researcher", model="{synthesizer_model}", description="Synthesize research")
178
178
  ```
179
179
 
180
180
  Display key findings from SUMMARY.md:
@@ -297,7 +297,7 @@ Create roadmap for milestone v[X.Y]:
297
297
 
298
298
  Write files first, then return.
299
299
  </instructions>
300
- ", subagent_type="maxsim-roadmapper", model="{roadmapper_model}", description="Create roadmap")
300
+ ", subagent_type="planner", model="{roadmapper_model}", description="Create roadmap")
301
301
  ```
302
302
 
303
303
  **Handle return:**
@@ -360,11 +360,11 @@ node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "docs: create milestone v[X.Y]
360
360
 
361
361
  **Phase [N]: [Phase Name]** — [Goal]
362
362
 
363
- `/maxsim:discuss-phase [N]` — gather context and clarify approach
363
+ `/maxsim:plan [N]` — gather context and clarify approach
364
364
 
365
365
  <sub>`/clear` first → fresh context window</sub>
366
366
 
367
- Also: `/maxsim:plan-phase [N]` — skip discussion, plan directly
367
+ Also: `/maxsim:plan [N]` — skip discussion, plan directly
368
368
  ```
369
369
 
370
370
  </process>
@@ -376,12 +376,12 @@ Also: `/maxsim:plan-phase [N]` — skip discussion, plan directly
376
376
  - [ ] Research completed (if selected) — 4 parallel agents, milestone-aware
377
377
  - [ ] Requirements gathered and scoped per category
378
378
  - [ ] REQUIREMENTS.md created with REQ-IDs
379
- - [ ] maxsim-roadmapper spawned with phase numbering context
379
+ - [ ] planner (roadmap mode) spawned with phase numbering context
380
380
  - [ ] Roadmap files written immediately (not draft)
381
381
  - [ ] User feedback incorporated (if any)
382
382
  - [ ] ROADMAP.md phases continue from previous milestone
383
383
  - [ ] All commits made (if planning docs committed)
384
- - [ ] User knows next step: `/maxsim:discuss-phase [N]`
384
+ - [ ] User knows next step: `/maxsim:plan [N]`
385
385
 
386
386
  **Atomic commits:** Each phase commits its artifacts immediately.
387
387
  </success_criteria>
@@ -30,7 +30,7 @@ Check if `--auto` flag is present in $ARGUMENTS.
30
30
 
31
31
  **Document requirement:**
32
32
  Auto mode requires an idea document — either:
33
- - File reference: `/maxsim:new-project --auto @prd.md`
33
+ - File reference: `/maxsim:init --auto @prd.md`
34
34
  - Pasted/written text in the prompt
35
35
 
36
36
  If no document content provided, error:
@@ -39,8 +39,8 @@ If no document content provided, error:
39
39
  Error: --auto requires an idea document.
40
40
 
41
41
  Usage:
42
- /maxsim:new-project --auto @your-idea.md
43
- /maxsim:new-project --auto [paste or write your idea here]
42
+ /maxsim:init --auto @your-idea.md
43
+ /maxsim:init --auto [paste or write your idea here]
44
44
 
45
45
  The document should describe what you want to build.
46
46
  ```
@@ -75,12 +75,12 @@ Use AskUserQuestion:
75
75
  - header: "Codebase"
76
76
  - question: "I detected existing code in this directory. Would you like to map the codebase first?"
77
77
  - options:
78
- - "Map codebase first" — Run /maxsim:map-codebase to understand existing architecture (Recommended)
78
+ - "Map codebase first" — Run /maxsim:init (codebase mapping stage) to understand existing architecture (Recommended)
79
79
  - "Skip mapping" — Proceed with project initialization
80
80
 
81
81
  **If "Map codebase first":**
82
82
  ```
83
- Run `/maxsim:map-codebase` first, then return to `/maxsim:new-project`
83
+ Run `/maxsim:init (codebase mapping stage)` first, then return to `/maxsim:init`
84
84
  ```
85
85
  Exit command.
86
86
 
@@ -440,7 +440,7 @@ Write content:
440
440
  | 2 | [Choice from questioning] | [Why this was chosen] | [What else was discussed] | Locked |
441
441
 
442
442
  ---
443
- *Decisions captured during /maxsim:new-project initialization*
443
+ *Decisions captured during /maxsim:init initialization*
444
444
  ```
445
445
 
446
446
  **ACCEPTANCE-CRITERIA.md** — Measurable success criteria derived from user's vision:
@@ -467,7 +467,7 @@ These define what "done" looks like for the entire project:
467
467
 
468
468
  ## Phase-Level Criteria
469
469
 
470
- Populated per-phase during /maxsim:discuss-phase.
470
+ Populated per-phase during /maxsim:plan.
471
471
 
472
472
  ---
473
473
  *Criteria derived from project initialization*
@@ -500,7 +500,7 @@ Write content:
500
500
  - [What this project is NOT]
501
501
 
502
502
  ---
503
- *No-gos captured during /maxsim:new-project initialization*
503
+ *No-gos captured during /maxsim:init initialization*
504
504
  ```
505
505
 
506
506
  **CONVENTIONS.md** — Coding conventions for agents to follow:
@@ -739,10 +739,10 @@ Display spawning indicator:
739
739
  → Pitfalls research
740
740
  ```
741
741
 
742
- Spawn 4 parallel maxsim-project-researcher agents with path references:
742
+ Spawn 4 parallel researcher agents with path references:
743
743
 
744
744
  ```
745
- Task(prompt="First, read ~/.claude/agents/maxsim-project-researcher.md for your role and instructions.
745
+ Task(prompt="
746
746
 
747
747
  <research_type>
748
748
  Project Research — Stack dimension for [domain].
@@ -780,9 +780,9 @@ Your STACK.md feeds into roadmap creation. Be prescriptive:
780
780
  Write to: .planning/research/STACK.md
781
781
  Use template: ~/.claude/maxsim/templates/research-project/STACK.md
782
782
  </output>
783
- ", subagent_type="general-purpose", model="{researcher_model}", description="Stack research")
783
+ ", subagent_type="researcher", model="{researcher_model}", description="Stack research")
784
784
 
785
- Task(prompt="First, read ~/.claude/agents/maxsim-project-researcher.md for your role and instructions.
785
+ Task(prompt="
786
786
 
787
787
  <research_type>
788
788
  Project Research — Features dimension for [domain].
@@ -820,9 +820,9 @@ Your FEATURES.md feeds into requirements definition. Categorize clearly:
820
820
  Write to: .planning/research/FEATURES.md
821
821
  Use template: ~/.claude/maxsim/templates/research-project/FEATURES.md
822
822
  </output>
823
- ", subagent_type="general-purpose", model="{researcher_model}", description="Features research")
823
+ ", subagent_type="researcher", model="{researcher_model}", description="Features research")
824
824
 
825
- Task(prompt="First, read ~/.claude/agents/maxsim-project-researcher.md for your role and instructions.
825
+ Task(prompt="
826
826
 
827
827
  <research_type>
828
828
  Project Research — Architecture dimension for [domain].
@@ -860,9 +860,9 @@ Your ARCHITECTURE.md informs phase structure in roadmap. Include:
860
860
  Write to: .planning/research/ARCHITECTURE.md
861
861
  Use template: ~/.claude/maxsim/templates/research-project/ARCHITECTURE.md
862
862
  </output>
863
- ", subagent_type="general-purpose", model="{researcher_model}", description="Architecture research")
863
+ ", subagent_type="researcher", model="{researcher_model}", description="Architecture research")
864
864
 
865
- Task(prompt="First, read ~/.claude/agents/maxsim-project-researcher.md for your role and instructions.
865
+ Task(prompt="
866
866
 
867
867
  <research_type>
868
868
  Project Research — Pitfalls dimension for [domain].
@@ -900,7 +900,7 @@ Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall:
900
900
  Write to: .planning/research/PITFALLS.md
901
901
  Use template: ~/.claude/maxsim/templates/research-project/PITFALLS.md
902
902
  </output>
903
- ", subagent_type="general-purpose", model="{researcher_model}", description="Pitfalls research")
903
+ ", subagent_type="researcher", model="{researcher_model}", description="Pitfalls research")
904
904
  ```
905
905
 
906
906
  After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
@@ -923,7 +923,7 @@ Write to: .planning/research/SUMMARY.md
923
923
  Use template: ~/.claude/maxsim/templates/research-project/SUMMARY.md
924
924
  Commit after writing.
925
925
  </output>
926
- ", subagent_type="maxsim-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
926
+ ", subagent_type="researcher", model="{synthesizer_model}", description="Synthesize research")
927
927
  ```
928
928
 
929
929
  **Locked Decisions Approval Gate:**
@@ -1135,7 +1135,7 @@ Display stage banner:
1135
1135
  ◆ Spawning roadmapper...
1136
1136
  ```
1137
1137
 
1138
- Spawn maxsim-roadmapper agent with path references:
1138
+ Spawn planner (roadmap mode) with path references:
1139
1139
 
1140
1140
  ```
1141
1141
  Task(prompt="
@@ -1161,7 +1161,7 @@ Create roadmap:
1161
1161
 
1162
1162
  Write files first, then return. This ensures artifacts persist even if context is lost.
1163
1163
  </instructions>
1164
- ", subagent_type="maxsim-roadmapper", model="{roadmapper_model}", description="Create roadmap")
1164
+ ", subagent_type="planner", model="{roadmapper_model}", description="Create roadmap")
1165
1165
  ```
1166
1166
 
1167
1167
  **Handle roadmapper return:**
@@ -1241,7 +1241,7 @@ Use AskUserQuestion:
1241
1241
  Update the roadmap based on feedback. Edit files in place.
1242
1242
  Return ROADMAP REVISED with changes made.
1243
1243
  </revision>
1244
- ", subagent_type="maxsim-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
1244
+ ", subagent_type="planner", model="{roadmapper_model}", description="Revise roadmap")
1245
1245
  ```
1246
1246
  - Present revised roadmap
1247
1247
  - Loop until user approves
@@ -1340,7 +1340,7 @@ Present completion summary:
1340
1340
  ╚══════════════════════════════════════════╝
1341
1341
  ```
1342
1342
 
1343
- Exit skill and invoke SlashCommand("/maxsim:discuss-phase 1 --auto")
1343
+ Exit skill and invoke SlashCommand("/maxsim:plan 1 --auto")
1344
1344
 
1345
1345
  **If interactive mode:**
1346
1346
 
@@ -1351,14 +1351,14 @@ Exit skill and invoke SlashCommand("/maxsim:discuss-phase 1 --auto")
1351
1351
 
1352
1352
  **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
1353
1353
 
1354
- /maxsim:discuss-phase 1 — gather context and clarify approach
1354
+ /maxsim:plan 1 — gather context and clarify approach
1355
1355
 
1356
1356
  <sub>/clear first → fresh context window</sub>
1357
1357
 
1358
1358
  ---
1359
1359
 
1360
1360
  **Also available:**
1361
- - /maxsim:plan-phase 1 — skip discussion, plan directly
1361
+ - /maxsim:plan 1 — skip discussion, plan directly
1362
1362
 
1363
1363
  ───────────────────────────────────────────────────────────────
1364
1364
  ```
@@ -1397,7 +1397,7 @@ Exit skill and invoke SlashCommand("/maxsim:discuss-phase 1 --auto")
1397
1397
  - [ ] Requirements gathered (from research or conversation)
1398
1398
  - [ ] User scoped each category (v1/v2/out of scope)
1399
1399
  - [ ] REQUIREMENTS.md created with REQ-IDs → **committed**
1400
- - [ ] maxsim-roadmapper spawned with context
1400
+ - [ ] planner (roadmap mode) spawned with context
1401
1401
  - [ ] Roadmap files written immediately (not draft)
1402
1402
  - [ ] User feedback incorporated (if any)
1403
1403
  - [ ] ROADMAP.md created with phases, requirement mappings, success criteria
@@ -1406,7 +1406,7 @@ Exit skill and invoke SlashCommand("/maxsim:discuss-phase 1 --auto")
1406
1406
  - [ ] CONVENTIONS.md generated with 4 must-have sections (Tech Stack, File Layout, Error Handling, Testing)
1407
1407
  - [ ] NO-GOS.md populated from confirmed no-gos during questioning
1408
1408
  - [ ] Agent dry-run validation passed (Quality Score >= 7)
1409
- - [ ] User knows next step is `/maxsim:discuss-phase 1`
1409
+ - [ ] User knows next step is `/maxsim:plan 1`
1410
1410
 
1411
1411
  **Atomic commits:** Each phase commits its artifacts immediately. If context is lost, artifacts persist.
1412
1412