@bhargavvc/sdd-cc 1.30.0 → 1.35.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 (242) hide show
  1. package/README.ja-JP.md +144 -110
  2. package/README.ko-KR.md +143 -107
  3. package/README.md +183 -112
  4. package/README.pt-BR.md +90 -52
  5. package/README.zh-CN.md +141 -101
  6. package/agents/sdd-advisor-researcher.md +23 -0
  7. package/agents/sdd-ai-researcher.md +133 -0
  8. package/agents/sdd-code-fixer.md +516 -0
  9. package/agents/sdd-code-reviewer.md +355 -0
  10. package/agents/sdd-codebase-mapper.md +3 -3
  11. package/agents/sdd-debugger.md +17 -5
  12. package/agents/sdd-doc-verifier.md +201 -0
  13. package/agents/sdd-doc-writer.md +602 -0
  14. package/agents/sdd-domain-researcher.md +153 -0
  15. package/agents/sdd-eval-auditor.md +164 -0
  16. package/agents/sdd-eval-planner.md +154 -0
  17. package/agents/sdd-executor.md +87 -4
  18. package/agents/sdd-framework-selector.md +160 -0
  19. package/agents/sdd-intel-updater.md +314 -0
  20. package/agents/sdd-nyquist-auditor.md +1 -1
  21. package/agents/sdd-phase-researcher.md +71 -4
  22. package/agents/sdd-plan-checker.md +100 -6
  23. package/agents/sdd-planner.md +145 -206
  24. package/agents/sdd-project-researcher.md +25 -2
  25. package/agents/sdd-research-synthesizer.md +3 -3
  26. package/agents/sdd-roadmapper.md +6 -6
  27. package/agents/sdd-security-auditor.md +128 -0
  28. package/agents/sdd-ui-auditor.md +43 -3
  29. package/agents/sdd-ui-checker.md +5 -5
  30. package/agents/sdd-ui-researcher.md +27 -4
  31. package/agents/sdd-user-profiler.md +2 -2
  32. package/agents/sdd-verifier.md +142 -22
  33. package/bin/install.js +2151 -551
  34. package/commands/sdd/add-backlog.md +5 -5
  35. package/commands/sdd/add-tests.md +2 -2
  36. package/commands/sdd/ai-integration-phase.md +36 -0
  37. package/commands/sdd/analyze-dependencies.md +34 -0
  38. package/commands/sdd/audit-fix.md +33 -0
  39. package/commands/sdd/autonomous.md +7 -2
  40. package/commands/sdd/cleanup.md +5 -0
  41. package/commands/sdd/code-review-fix.md +52 -0
  42. package/commands/sdd/code-review.md +55 -0
  43. package/commands/sdd/complete-milestone.md +6 -6
  44. package/commands/sdd/debug.md +22 -9
  45. package/commands/sdd/discuss-phase.md +7 -2
  46. package/commands/sdd/do.md +1 -1
  47. package/commands/sdd/docs-update.md +48 -0
  48. package/commands/sdd/eval-review.md +32 -0
  49. package/commands/sdd/execute-phase.md +4 -0
  50. package/commands/sdd/explore.md +27 -0
  51. package/commands/sdd/fast.md +2 -2
  52. package/commands/sdd/from-sdd2.md +45 -0
  53. package/commands/sdd/help.md +2 -0
  54. package/commands/sdd/import.md +36 -0
  55. package/commands/sdd/intel.md +179 -0
  56. package/commands/sdd/join-discord.md +2 -1
  57. package/commands/sdd/manager.md +1 -0
  58. package/commands/sdd/map-codebase.md +3 -3
  59. package/commands/sdd/new-milestone.md +1 -1
  60. package/commands/sdd/new-project.md +5 -1
  61. package/commands/sdd/new-workspace.md +1 -1
  62. package/commands/sdd/next.md +2 -0
  63. package/commands/sdd/plan-milestone-gaps.md +2 -2
  64. package/commands/sdd/plan-phase.md +6 -1
  65. package/commands/sdd/plant-seed.md +1 -1
  66. package/commands/sdd/profile-user.md +1 -1
  67. package/commands/sdd/quick.md +5 -3
  68. package/commands/sdd/reapply-patches.md +230 -42
  69. package/commands/sdd/research-phase.md +3 -3
  70. package/commands/sdd/review-backlog.md +1 -0
  71. package/commands/sdd/review.md +6 -3
  72. package/commands/sdd/scan.md +26 -0
  73. package/commands/sdd/secure-phase.md +35 -0
  74. package/commands/sdd/ship.md +1 -1
  75. package/commands/sdd/thread.md +5 -5
  76. package/commands/sdd/undo.md +34 -0
  77. package/commands/sdd/verify-work.md +1 -1
  78. package/commands/sdd/workstreams.md +17 -11
  79. package/hooks/dist/sdd-check-update.js +33 -8
  80. package/hooks/dist/sdd-context-monitor.js +17 -8
  81. package/hooks/dist/sdd-phase-boundary.sh +27 -0
  82. package/hooks/dist/sdd-prompt-guard.js +1 -0
  83. package/hooks/dist/sdd-read-guard.js +82 -0
  84. package/hooks/dist/sdd-session-state.sh +33 -0
  85. package/hooks/dist/sdd-statusline.js +137 -15
  86. package/hooks/dist/sdd-validate-commit.sh +47 -0
  87. package/hooks/dist/sdd-workflow-guard.js +4 -4
  88. package/hooks/sdd-check-update.js +139 -0
  89. package/hooks/sdd-context-monitor.js +165 -0
  90. package/hooks/sdd-phase-boundary.sh +27 -0
  91. package/hooks/sdd-prompt-guard.js +97 -0
  92. package/hooks/sdd-read-guard.js +82 -0
  93. package/hooks/sdd-session-state.sh +33 -0
  94. package/hooks/sdd-statusline.js +241 -0
  95. package/hooks/sdd-validate-commit.sh +47 -0
  96. package/hooks/sdd-workflow-guard.js +94 -0
  97. package/package.json +3 -3
  98. package/scripts/build-hooks.js +18 -7
  99. package/scripts/prompt-injection-scan.sh +1 -0
  100. package/scripts/rebrand-gsd-to-sdd.sh +221 -220
  101. package/scripts/run-tests.cjs +5 -1
  102. package/scripts/sync-upstream.sh +1 -1
  103. package/sdd/bin/lib/commands.cjs +79 -17
  104. package/sdd/bin/lib/config.cjs +90 -48
  105. package/sdd/bin/lib/core.cjs +452 -87
  106. package/sdd/bin/lib/docs.cjs +267 -0
  107. package/sdd/bin/lib/frontmatter.cjs +381 -336
  108. package/sdd/bin/lib/init.cjs +110 -16
  109. package/sdd/bin/lib/intel.cjs +660 -0
  110. package/sdd/bin/lib/learnings.cjs +378 -0
  111. package/sdd/bin/lib/milestone.cjs +42 -11
  112. package/sdd/bin/lib/model-profiles.cjs +17 -15
  113. package/sdd/bin/lib/phase.cjs +367 -288
  114. package/sdd/bin/lib/profile-output.cjs +106 -10
  115. package/sdd/bin/lib/roadmap.cjs +146 -115
  116. package/sdd/bin/lib/schema-detect.cjs +238 -0
  117. package/sdd/bin/lib/sdd2-import.cjs +511 -0
  118. package/sdd/bin/lib/security.cjs +124 -3
  119. package/sdd/bin/lib/state.cjs +648 -264
  120. package/sdd/bin/lib/template.cjs +8 -4
  121. package/sdd/bin/lib/verify.cjs +209 -28
  122. package/sdd/bin/lib/workstream.cjs +7 -3
  123. package/sdd/bin/sdd-tools.cjs +184 -12
  124. package/sdd/contexts/dev.md +21 -0
  125. package/sdd/contexts/research.md +22 -0
  126. package/sdd/contexts/review.md +22 -0
  127. package/sdd/references/agent-contracts.md +79 -0
  128. package/sdd/references/ai-evals.md +156 -0
  129. package/sdd/references/ai-frameworks.md +186 -0
  130. package/sdd/references/artifact-types.md +113 -0
  131. package/sdd/references/common-bug-patterns.md +114 -0
  132. package/sdd/references/context-budget.md +49 -0
  133. package/sdd/references/continuation-format.md +25 -25
  134. package/sdd/references/domain-probes.md +125 -0
  135. package/sdd/references/few-shot-examples/plan-checker.md +73 -0
  136. package/sdd/references/few-shot-examples/verifier.md +109 -0
  137. package/sdd/references/gate-prompts.md +100 -0
  138. package/sdd/references/gates.md +70 -0
  139. package/sdd/references/git-integration.md +1 -1
  140. package/sdd/references/ios-scaffold.md +123 -0
  141. package/sdd/references/model-profile-resolution.md +2 -0
  142. package/sdd/references/model-profiles.md +24 -18
  143. package/sdd/references/planner-gap-closure.md +62 -0
  144. package/sdd/references/planner-reviews.md +39 -0
  145. package/sdd/references/planner-revision.md +87 -0
  146. package/sdd/references/planning-config.md +252 -0
  147. package/sdd/references/revision-loop.md +97 -0
  148. package/sdd/references/thinking-models-debug.md +44 -0
  149. package/sdd/references/thinking-models-execution.md +50 -0
  150. package/sdd/references/thinking-models-planning.md +62 -0
  151. package/sdd/references/thinking-models-research.md +50 -0
  152. package/sdd/references/thinking-models-verification.md +55 -0
  153. package/sdd/references/thinking-partner.md +96 -0
  154. package/sdd/references/ui-brand.md +4 -4
  155. package/sdd/references/universal-anti-patterns.md +63 -0
  156. package/sdd/references/verification-overrides.md +227 -0
  157. package/sdd/references/workstream-flag.md +56 -3
  158. package/sdd/templates/AI-SPEC.md +246 -0
  159. package/sdd/templates/DEBUG.md +1 -1
  160. package/sdd/templates/SECURITY.md +61 -0
  161. package/sdd/templates/UAT.md +4 -4
  162. package/sdd/templates/VALIDATION.md +4 -4
  163. package/sdd/templates/claude-md.md +32 -9
  164. package/sdd/templates/config.json +4 -0
  165. package/sdd/templates/debug-subagent-prompt.md +1 -1
  166. package/sdd/templates/dev-preferences.md +1 -1
  167. package/sdd/templates/discovery.md +2 -2
  168. package/sdd/templates/phase-prompt.md +1 -1
  169. package/sdd/templates/planner-subagent-prompt.md +3 -3
  170. package/sdd/templates/project.md +1 -1
  171. package/sdd/templates/research.md +1 -1
  172. package/sdd/templates/state.md +2 -2
  173. package/sdd/workflows/add-phase.md +8 -8
  174. package/sdd/workflows/add-tests.md +12 -9
  175. package/sdd/workflows/add-todo.md +5 -3
  176. package/sdd/workflows/ai-integration-phase.md +284 -0
  177. package/sdd/workflows/analyze-dependencies.md +96 -0
  178. package/sdd/workflows/audit-fix.md +157 -0
  179. package/sdd/workflows/audit-milestone.md +11 -11
  180. package/sdd/workflows/audit-uat.md +2 -2
  181. package/sdd/workflows/autonomous.md +195 -27
  182. package/sdd/workflows/check-todos.md +12 -10
  183. package/sdd/workflows/cleanup.md +2 -0
  184. package/sdd/workflows/code-review-fix.md +497 -0
  185. package/sdd/workflows/code-review.md +515 -0
  186. package/sdd/workflows/complete-milestone.md +56 -22
  187. package/sdd/workflows/diagnose-issues.md +10 -3
  188. package/sdd/workflows/discovery-phase.md +5 -3
  189. package/sdd/workflows/discuss-phase-assumptions.md +24 -6
  190. package/sdd/workflows/discuss-phase-power.md +291 -0
  191. package/sdd/workflows/discuss-phase.md +173 -21
  192. package/sdd/workflows/do.md +23 -21
  193. package/sdd/workflows/docs-update.md +1155 -0
  194. package/sdd/workflows/eval-review.md +155 -0
  195. package/sdd/workflows/execute-phase.md +594 -38
  196. package/sdd/workflows/execute-plan.md +67 -96
  197. package/sdd/workflows/explore.md +139 -0
  198. package/sdd/workflows/fast.md +5 -5
  199. package/sdd/workflows/forensics.md +2 -2
  200. package/sdd/workflows/health.md +4 -4
  201. package/sdd/workflows/help.md +122 -119
  202. package/sdd/workflows/import.md +276 -0
  203. package/sdd/workflows/inbox.md +387 -0
  204. package/sdd/workflows/insert-phase.md +7 -7
  205. package/sdd/workflows/list-phase-assumptions.md +4 -4
  206. package/sdd/workflows/list-workspaces.md +2 -2
  207. package/sdd/workflows/manager.md +35 -32
  208. package/sdd/workflows/map-codebase.md +7 -5
  209. package/sdd/workflows/milestone-summary.md +2 -2
  210. package/sdd/workflows/new-milestone.md +17 -9
  211. package/sdd/workflows/new-project.md +50 -25
  212. package/sdd/workflows/new-workspace.md +7 -5
  213. package/sdd/workflows/next.md +67 -11
  214. package/sdd/workflows/note.md +9 -7
  215. package/sdd/workflows/pause-work.md +75 -12
  216. package/sdd/workflows/plan-milestone-gaps.md +8 -8
  217. package/sdd/workflows/plan-phase.md +294 -42
  218. package/sdd/workflows/plant-seed.md +6 -3
  219. package/sdd/workflows/pr-branch.md +42 -14
  220. package/sdd/workflows/profile-user.md +9 -7
  221. package/sdd/workflows/progress.md +45 -45
  222. package/sdd/workflows/quick.md +195 -47
  223. package/sdd/workflows/remove-phase.md +6 -6
  224. package/sdd/workflows/remove-workspace.md +3 -1
  225. package/sdd/workflows/research-phase.md +2 -2
  226. package/sdd/workflows/resume-project.md +12 -12
  227. package/sdd/workflows/review.md +109 -9
  228. package/sdd/workflows/scan.md +102 -0
  229. package/sdd/workflows/secure-phase.md +166 -0
  230. package/sdd/workflows/session-report.md +2 -2
  231. package/sdd/workflows/settings.md +38 -12
  232. package/sdd/workflows/ship.md +21 -9
  233. package/sdd/workflows/stats.md +1 -1
  234. package/sdd/workflows/transition.md +23 -23
  235. package/sdd/workflows/ui-phase.md +15 -7
  236. package/sdd/workflows/ui-review.md +29 -4
  237. package/sdd/workflows/undo.md +314 -0
  238. package/sdd/workflows/update.md +171 -20
  239. package/sdd/workflows/validate-phase.md +6 -4
  240. package/sdd/workflows/verify-phase.md +210 -6
  241. package/sdd/workflows/verify-work.md +83 -9
  242. package/sdd/commands/sdd/workstreams.md +0 -63
@@ -1,6 +1,6 @@
1
1
  <purpose>
2
2
 
3
- Drive all remaining milestone phases autonomously. For each incomplete phase: discuss → plan → execute using Skill() flat invocations. Pauses only for explicit user decisions (grey area acceptance, blockers, validation requests). Re-reads ROADMAP.md after each phase to catch dynamically inserted phases.
3
+ Drive milestone phases autonomously — all remaining phases, a range via `--from N`/`--to N`, or a single phase via `--only N`. For each incomplete phase: discuss → plan → execute using Skill() flat invocations. Pauses only for explicit user decisions (grey area acceptance, blockers, validation requests). Re-reads ROADMAP.md after each phase to catch dynamically inserted phases.
4
4
 
5
5
  </purpose>
6
6
 
@@ -16,15 +16,35 @@ Read all files referenced by the invoking prompt's execution_context before star
16
16
 
17
17
  ## 1. Initialize
18
18
 
19
- Parse `$ARGUMENTS` for `--from N` flag:
19
+ Parse `$ARGUMENTS` for `--from N`, `--to N`, `--only N`, and `--interactive` flags:
20
20
 
21
21
  ```bash
22
22
  FROM_PHASE=""
23
23
  if echo "$ARGUMENTS" | grep -qE '\-\-from\s+[0-9]'; then
24
24
  FROM_PHASE=$(echo "$ARGUMENTS" | grep -oE '\-\-from\s+[0-9]+\.?[0-9]*' | awk '{print $2}')
25
25
  fi
26
+
27
+ TO_PHASE=""
28
+ if echo "$ARGUMENTS" | grep -qE '\-\-to\s+[0-9]'; then
29
+ TO_PHASE=$(echo "$ARGUMENTS" | grep -oE '\-\-to\s+[0-9]+\.?[0-9]*' | awk '{print $2}')
30
+ fi
31
+
32
+ ONLY_PHASE=""
33
+ if echo "$ARGUMENTS" | grep -qE '\-\-only\s+[0-9]'; then
34
+ ONLY_PHASE=$(echo "$ARGUMENTS" | grep -oE '\-\-only\s+[0-9]+\.?[0-9]*' | awk '{print $2}')
35
+ FROM_PHASE="$ONLY_PHASE"
36
+ fi
37
+
38
+ INTERACTIVE=""
39
+ if echo "$ARGUMENTS" | grep -q '\-\-interactive'; then
40
+ INTERACTIVE="true"
41
+ fi
26
42
  ```
27
43
 
44
+ When `--only` is set, also set `FROM_PHASE` to the same value so existing filter logic applies.
45
+
46
+ When `--interactive` is set, discuss runs inline with questions (not auto-answered), while plan and execute are dispatched as background agents. This keeps the main context lean — only discuss conversations accumulate — while preserving user input on all design decisions.
47
+
28
48
  Bootstrap via milestone-level init:
29
49
 
30
50
  ```bash
@@ -34,8 +54,8 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
34
54
 
35
55
  Parse JSON for: `milestone_version`, `milestone_name`, `phase_count`, `completed_phases`, `roadmap_exists`, `state_exists`, `commit_docs`.
36
56
 
37
- **If `roadmap_exists` is false:** Error — "No ROADMAP.md found. Run `/sdd:new-milestone` first."
38
- **If `state_exists` is false:** Error — "No STATE.md found. Run `/sdd:new-milestone` first."
57
+ **If `roadmap_exists` is false:** Error — "No ROADMAP.md found. Run `/sdd-new-milestone` first."
58
+ **If `state_exists` is false:** Error — "No STATE.md found. Run `/sdd-new-milestone` first."
39
59
 
40
60
  Display startup banner:
41
61
 
@@ -48,7 +68,10 @@ Display startup banner:
48
68
  Phases: {phase_count} total, {completed_phases} complete
49
69
  ```
50
70
 
51
- If `FROM_PHASE` is set, display: `Starting from phase ${FROM_PHASE}`
71
+ If `ONLY_PHASE` is set, display: `Single phase mode: Phase ${ONLY_PHASE}`
72
+ Else if `FROM_PHASE` is set, display: `Starting from phase ${FROM_PHASE}`
73
+ If `TO_PHASE` is set, display: `Stopping after phase ${TO_PHASE}`
74
+ If `INTERACTIVE` is set, display: `Mode: Interactive (discuss inline, plan+execute in background)`
52
75
 
53
76
  </step>
54
77
 
@@ -68,6 +91,26 @@ Parse the JSON `phases` array.
68
91
 
69
92
  **Apply `--from N` filter:** If `FROM_PHASE` was provided, additionally filter out phases where `number < FROM_PHASE` (use numeric comparison — handles decimal phases like "5.1").
70
93
 
94
+ **Apply `--to N` filter:** If `TO_PHASE` was provided, additionally filter out phases where `number > TO_PHASE` (use numeric comparison). This limits execution to phases up through the target phase.
95
+
96
+ **Apply `--only N` filter:** If `ONLY_PHASE` was provided, additionally filter OUT phases where `number != ONLY_PHASE`. This means the phase list will contain exactly one phase (or zero if already complete).
97
+
98
+ **If `TO_PHASE` is set and no phases remain** (all phases up to N are already completed):
99
+
100
+ ```
101
+ All phases through ${TO_PHASE} are already completed. Nothing to do.
102
+ ```
103
+
104
+ Exit cleanly.
105
+
106
+ **If `ONLY_PHASE` is set and no phases remain** (phase already complete):
107
+
108
+ ```
109
+ Phase ${ONLY_PHASE} is already complete. Nothing to do.
110
+ ```
111
+
112
+ Exit cleanly.
113
+
71
114
  **Sort by `number`** in numeric ascending order.
72
115
 
73
116
  **If no incomplete phases remain:**
@@ -117,7 +160,9 @@ For the current phase, display the progress banner:
117
160
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
161
  ```
119
162
 
120
- Where N = current phase number (from the ROADMAP, e.g., 6), T = total milestone phases (from `phase_count` parsed in initialize step, e.g., 8), P = percentage of all milestone phases completed so far. Calculate P as: (number of phases with `disk_status` "complete" from the latest `roadmap analyze` / T × 100). Use █ for filled and ░ for empty segments in the progress bar (8 characters wide).
163
+ Where N = current phase number (from the ROADMAP, e.g., 63), T = total milestone phases (from `phase_count` parsed in initialize step, e.g., 67). **Important:** T must be `phase_count` (the total number of phases in this milestone), NOT the count of remaining/incomplete phases. When phases are numbered 61-67, T=7 and the banner should read `Phase 63/7` (phase 63, 7 total in milestone), not `Phase 63/3` (which would confuse 3 remaining with 3 total). P = percentage of all milestone phases completed so far. Calculate P as: (number of phases with `disk_status` "complete" from the latest `roadmap analyze` / T × 100). Use █ for filled and ░ for empty segments in the progress bar (8 characters wide).
164
+
165
+ **Alternative display when phase numbers exceed total** (e.g., multi-milestone projects where phases are numbered globally): If N > T (phase number exceeds milestone phase count), use the format `Phase {N} ({position}/{T})` where `position` is the 1-based index of this phase among incomplete phases being processed. This prevents confusing displays like "Phase 63/5".
121
166
 
122
167
  **3a. Smart Discuss**
123
168
 
@@ -209,15 +254,26 @@ node "$HOME/.claude/sdd/bin/sdd-tools.cjs" commit "docs(${PADDED_PHASE}): auto-g
209
254
 
210
255
  Proceed to 3b.
211
256
 
212
- **If SKIP_DISCUSS is `false` (or unset):** Execute the smart_discuss step for this phase.
257
+ **If SKIP_DISCUSS is `false` (or unset):**
258
+
259
+ **IMPORTANT — Discuss must be single-pass in autonomous mode.**
260
+ The discuss step in `--auto` mode MUST NOT loop. If CONTEXT.md already exists after discuss completes, do NOT re-invoke discuss for the same phase. The `has_context` check below is authoritative — once true, discuss is done for this phase regardless of perceived "gaps" in the context file.
261
+
262
+ **If `INTERACTIVE` is set:** Run the standard discuss-phase skill inline (asks interactive questions, waits for user answers). This preserves user input on all design decisions while keeping plan+execute out of the main context:
213
263
 
214
- After smart_discuss completes, verify context was written:
264
+ ```
265
+ Skill(skill="sdd:discuss-phase", args="${PHASE_NUM}")
266
+ ```
267
+
268
+ **If `INTERACTIVE` is NOT set:** Execute the smart_discuss step for this phase (batch table proposals, auto-optimized).
269
+
270
+ After discuss completes (either mode), verify context was written:
215
271
 
216
272
  ```bash
217
273
  PHASE_STATE=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" init phase-op ${PHASE_NUM})
218
274
  ```
219
275
 
220
- Check `has_context`. If false → go to handle_blocker: "Smart discuss for phase ${PHASE_NUM} did not produce CONTEXT.md."
276
+ Check `has_context`. If false → go to handle_blocker: "Discuss for phase ${PHASE_NUM} did not produce CONTEXT.md."
221
277
 
222
278
  **3a.5. UI Design Contract (Frontend Phases)**
223
279
 
@@ -245,7 +301,7 @@ Phase ${PHASE_NUM}: Frontend phase detected — generating UI design contract...
245
301
  ```
246
302
 
247
303
  ```
248
- Skill(skill="sdd:ui-phase", args="${PHASE_NUM}")
304
+ Skill(skill="sdd-ui-phase", args="${PHASE_NUM}")
249
305
  ```
250
306
 
251
307
  Verify UI-SPEC was created:
@@ -260,21 +316,72 @@ UI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-UI-SPEC.md 2>/dev/null | head -1)
260
316
 
261
317
  **3b. Plan**
262
318
 
319
+ **If `INTERACTIVE` is set:** Dispatch plan as a background agent to keep the main context lean. While plan runs, the workflow can immediately start discussing the next phase (see step 4).
320
+
263
321
  ```
264
- Skill(skill="sdd:plan-phase", args="${PHASE_NUM}")
322
+ Agent(
323
+ description="Plan phase ${PHASE_NUM}: ${PHASE_NAME}",
324
+ run_in_background=true,
325
+ prompt="Run plan-phase for phase ${PHASE_NUM}: Skill(skill=\"sdd:plan-phase\", args=\"${PHASE_NUM}\")"
326
+ )
327
+ ```
328
+
329
+ Store the agent task_id. After discuss for the next phase completes (or if no next phase), wait for the plan agent to finish before proceeding to execute.
330
+
331
+ **If `INTERACTIVE` is NOT set (default):** Run plan inline as before.
332
+
333
+ ```
334
+ Skill(skill="sdd-plan-phase", args="${PHASE_NUM}")
265
335
  ```
266
336
 
267
337
  Verify plan produced output — re-run `init phase-op` and check `has_plans`. If false → go to handle_blocker: "Plan phase ${PHASE_NUM} did not produce any plans."
268
338
 
269
339
  **3c. Execute**
270
340
 
341
+ **If `INTERACTIVE` is set:** Wait for the plan agent to complete (if not already), verify plans exist, then dispatch execute as a background agent:
342
+
271
343
  ```
272
- Skill(skill="sdd:execute-phase", args="${PHASE_NUM} --no-transition")
344
+ Agent(
345
+ description="Execute phase ${PHASE_NUM}: ${PHASE_NAME}",
346
+ run_in_background=true,
347
+ prompt="Run execute-phase for phase ${PHASE_NUM}: Skill(skill=\"sdd:execute-phase\", args=\"${PHASE_NUM} --no-transition\")"
348
+ )
273
349
  ```
274
350
 
351
+ Store the agent task_id. The workflow can now start discussing the next phase while this phase executes in the background. Before starting post-execution routing for this phase, wait for the execute agent to complete.
352
+
353
+ **If `INTERACTIVE` is NOT set (default):** Run execute inline as before.
354
+
355
+ ```
356
+ Skill(skill="sdd-execute-phase", args="${PHASE_NUM} --no-transition")
357
+ ```
358
+
359
+ **3c.5. Code Review and Fix**
360
+
361
+ Auto-invoke code review and fix chain. Autonomous mode chains both review and fix (unlike execute-phase/quick which only suggest fix).
362
+
363
+ **Config gate:**
364
+ ```bash
365
+ CODE_REVIEW_ENABLED=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" config-get workflow.code_review 2>/dev/null || echo "true")
366
+ ```
367
+ If `"false"`: display "Code review skipped (workflow.code_review=false)" and proceed to 3d.
368
+
369
+ ```
370
+ Skill(skill="sdd:code-review", args="${PHASE_NUM}")
371
+ ```
372
+
373
+ Parse status from REVIEW.md frontmatter. If "clean" or "skipped": proceed to 3d. If findings found: auto-invoke:
374
+ ```
375
+ Skill(skill="sdd:code-review-fix", args="${PHASE_NUM} --auto")
376
+ ```
377
+
378
+ **Error handling:** If either Skill fails, catch the error, display as non-blocking, and proceed to 3d.
379
+
275
380
  **3d. Post-Execution Routing**
276
381
 
277
- After execute-phase returns, read the verification result:
382
+ **If `INTERACTIVE` is set:** Wait for the execute agent to complete before reading verification results.
383
+
384
+ After execute-phase returns (or the execute agent completes), read the verification result:
278
385
 
279
386
  ```bash
280
387
  VERIFY_STATUS=$(grep "^status:" "${PHASE_DIR}"/*-VERIFICATION.md 2>/dev/null | head -1 | cut -d: -f2 | tr -d ' ')
@@ -305,6 +412,8 @@ Proceed to iterate step.
305
412
 
306
413
  Read the human_verification section from VERIFICATION.md to get the count and items requiring manual testing.
307
414
 
415
+
416
+ **Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `AskUserQuestion` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-Claude runtimes (OpenAI Codex, Gemini CLI, etc.) where `AskUserQuestion` is not available.
308
417
  Display the items, then ask user via AskUserQuestion:
309
418
  - **question:** "Phase ${PHASE_NUM} has items needing manual verification. Validate now or continue to next phase?"
310
419
  - **options:** "Validate now" / "Continue without validation"
@@ -334,14 +443,14 @@ Ask user via AskUserQuestion:
334
443
  On **"Run gap closure"**: Execute gap closure cycle (limit: 1 attempt):
335
444
 
336
445
  ```
337
- Skill(skill="sdd:plan-phase", args="${PHASE_NUM} --gaps")
446
+ Skill(skill="sdd-plan-phase", args="${PHASE_NUM} --gaps")
338
447
  ```
339
448
 
340
449
  Verify gap plans were created — re-run `init phase-op ${PHASE_NUM}` and check `has_plans`. If no new gap plans → go to handle_blocker: "Gap closure planning for phase ${PHASE_NUM} did not produce plans."
341
450
 
342
451
  Re-execute:
343
452
  ```
344
- Skill(skill="sdd:execute-phase", args="${PHASE_NUM} --no-transition")
453
+ Skill(skill="sdd-execute-phase", args="${PHASE_NUM} --no-transition")
345
454
  ```
346
455
 
347
456
  Re-read verification status:
@@ -389,7 +498,7 @@ Phase ${PHASE_NUM}: Frontend phase with UI-SPEC — running UI review audit...
389
498
  ```
390
499
 
391
500
  ```
392
- Skill(skill="sdd:ui-review", args="${PHASE_NUM}")
501
+ Skill(skill="sdd-ui-review", args="${PHASE_NUM}")
393
502
  ```
394
503
 
395
504
  Display the review result summary (score from UI-REVIEW.md if produced). Continue to iterate step regardless of score — UI review is advisory, not blocking.
@@ -404,7 +513,7 @@ Display the review result summary (score from UI-REVIEW.md if produced). Continu
404
513
 
405
514
  Run smart discuss for the current phase. Proposes grey area answers in batch tables — the user accepts or overrides per area. Produces identical CONTEXT.md output to regular discuss-phase.
406
515
 
407
- > **Note:** Smart discuss is an autonomous-optimized variant of the `sdd:discuss-phase` skill. It produces identical CONTEXT.md output but uses batch table proposals instead of sequential questioning. The original `discuss-phase` skill remains unchanged (per CTRL-03). Future milestones may extract this to a separate skill file.
516
+ > **Note:** Smart discuss is an autonomous-optimized variant of the `sdd-discuss-phase` skill. It produces identical CONTEXT.md output but uses batch table proposals instead of sequential questioning. The original `sdd-discuss-phase` skill remains unchanged (per CTRL-03). Future milestones may extract this to a separate skill file.
408
517
 
409
518
  **Inputs:** `PHASE_NUM` from execute_phase. Run init to get phase paths:
410
519
 
@@ -686,7 +795,24 @@ Decisions captured: {count} across {area_count} areas
686
795
 
687
796
  ## 4. Iterate
688
797
 
689
- After each phase completes, re-read ROADMAP.md to catch phases inserted mid-execution (decimal phases like 5.1):
798
+ **If `ONLY_PHASE` is set:** Do not iterate. Proceed directly to lifecycle step (which exits cleanly per single-phase mode).
799
+
800
+ **If `TO_PHASE` is set and current phase number >= `TO_PHASE`:** The target phase has been reached. Do not iterate further. Display:
801
+
802
+ ```
803
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
804
+ SDD ► AUTONOMOUS ▸ --to ${TO_PHASE} REACHED
805
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
806
+
807
+ Completed through phase ${TO_PHASE} as requested.
808
+ Remaining phases were not executed.
809
+
810
+ Resume with: /sdd-autonomous --from ${next_incomplete_phase}
811
+ ```
812
+
813
+ Proceed directly to lifecycle step (which handles partial completion — skips audit/complete/cleanup since not all phases are done). Exit cleanly.
814
+
815
+ **Otherwise:** After each phase completes, re-read ROADMAP.md to catch phases inserted mid-execution (decimal phases like 5.1):
690
816
 
691
817
  ```bash
692
818
  ROADMAP=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" roadmap analyze)
@@ -695,6 +821,7 @@ ROADMAP=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" roadmap analyze)
695
821
  Re-filter incomplete phases using the same logic as discover_phases:
696
822
  - Keep phases where `disk_status !== "complete"` OR `roadmap_complete === false`
697
823
  - Apply `--from N` filter if originally provided
824
+ - Apply `--to N` filter if originally provided
698
825
  - Sort by number ascending
699
826
 
700
827
  Read STATE.md fresh:
@@ -707,6 +834,13 @@ Check for blockers in the Blockers/Concerns section. If blockers are found, go t
707
834
 
708
835
  If incomplete phases remain: proceed to next phase, loop back to execute_phase.
709
836
 
837
+ **Interactive mode overlap:** When `INTERACTIVE` is set, the iterate step enables pipeline parallelism:
838
+ 1. After discuss completes for Phase N, dispatch plan+execute as background agents
839
+ 2. Immediately start discuss for Phase N+1 (the next incomplete phase) while Phase N builds
840
+ 3. Before starting plan for Phase N+1, wait for Phase N's execute agent to complete and handle its post-execution routing (verification, gap closure, etc.)
841
+
842
+ This means the user is always answering discuss questions (lightweight, interactive) while the heavy work (planning, code generation) runs in the background. The main context only accumulates discuss conversations — plan and execute contexts are isolated in their agents.
843
+
710
844
  If all phases complete, proceed to lifecycle step.
711
845
 
712
846
  </step>
@@ -715,7 +849,23 @@ If all phases complete, proceed to lifecycle step.
715
849
 
716
850
  ## 5. Lifecycle
717
851
 
718
- After all phases complete, run the milestone lifecycle sequence: audit completecleanup.
852
+ **If `ONLY_PHASE` is set:** Skip lifecycle. A single phase does not trigger audit/complete/cleanup. Display:
853
+
854
+ ```
855
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
856
+ SDD ► AUTONOMOUS ▸ PHASE ${ONLY_PHASE} COMPLETE ✓
857
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
858
+
859
+ Phase ${ONLY_PHASE}: ${PHASE_NAME} — Done
860
+ Mode: Single phase (--only)
861
+
862
+ Lifecycle skipped — run /sdd-autonomous without --only
863
+ after all phases complete to trigger audit/complete/cleanup.
864
+ ```
865
+
866
+ Exit cleanly.
867
+
868
+ **Otherwise:** After all phases complete, run the milestone lifecycle sequence: audit → complete → cleanup.
719
869
 
720
870
  Display lifecycle transition banner:
721
871
 
@@ -731,7 +881,7 @@ Display lifecycle transition banner:
731
881
  **5a. Audit**
732
882
 
733
883
  ```
734
- Skill(skill="sdd:audit-milestone")
884
+ Skill(skill="sdd-audit-milestone")
735
885
  ```
736
886
 
737
887
  After audit completes, detect the result:
@@ -767,7 +917,7 @@ Ask user via AskUserQuestion:
767
917
 
768
918
  On **"Continue anyway"**: Display `Audit ⏭ Gaps accepted — proceeding to complete milestone` and proceed to 5b.
769
919
 
770
- On **"Stop"**: Go to handle_blocker with "User stopped — audit gaps remain. Run /sdd:audit-milestone to review, then /sdd:complete-milestone when ready."
920
+ On **"Stop"**: Go to handle_blocker with "User stopped — audit gaps remain. Run /sdd-audit-milestone to review, then /sdd-complete-milestone when ready."
771
921
 
772
922
  **If `tech_debt`:**
773
923
 
@@ -782,12 +932,12 @@ Show the summary, then ask user via AskUserQuestion:
782
932
 
783
933
  On **"Continue with tech debt"**: Display `Audit ⏭ Tech debt acknowledged — proceeding to complete milestone` and proceed to 5b.
784
934
 
785
- On **"Stop"**: Go to handle_blocker with "User stopped — tech debt to address. Run /sdd:audit-milestone to review details."
935
+ On **"Stop"**: Go to handle_blocker with "User stopped — tech debt to address. Run /sdd-audit-milestone to review details."
786
936
 
787
937
  **5b. Complete Milestone**
788
938
 
789
939
  ```
790
- Skill(skill="sdd:complete-milestone", args="${milestone_version}")
940
+ Skill(skill="sdd-complete-milestone", args="${milestone_version}")
791
941
  ```
792
942
 
793
943
  After complete-milestone returns, verify it produced output:
@@ -801,7 +951,7 @@ If the archive file does not exist, go to handle_blocker: "Complete milestone di
801
951
  **5c. Cleanup**
802
952
 
803
953
  ```
804
- Skill(skill="sdd:cleanup")
954
+ Skill(skill="sdd-cleanup")
805
955
  ```
806
956
 
807
957
  Cleanup shows its own dry-run and asks user for approval internally — this is an acceptable pause per CTRL-01 since it's an explicit decision about file deletion.
@@ -852,7 +1002,7 @@ When any phase operation fails or a blocker is detected, present 3 options via A
852
1002
  Skipped: {list of skipped phases}
853
1003
  Remaining: {list of remaining phases}
854
1004
 
855
- Resume with: /sdd:autonomous --from {next_phase}
1005
+ Resume with: /sdd-autonomous ${ONLY_PHASE ? "--only " + ONLY_PHASE : "--from " + next_phase}${TO_PHASE ? " --to " + TO_PHASE : ""}
856
1006
  ```
857
1007
 
858
1008
  </step>
@@ -876,16 +1026,34 @@ When any phase operation fails or a blocker is detected, present 3 options via A
876
1026
  - [ ] Final completion or stop summary displayed
877
1027
  - [ ] After all phases complete, lifecycle step is invoked (not manual suggestion)
878
1028
  - [ ] Lifecycle transition banner displayed before audit
879
- - [ ] Audit invoked via Skill(skill="sdd:audit-milestone")
1029
+ - [ ] Audit invoked via Skill(skill="sdd-audit-milestone")
880
1030
  - [ ] Audit result routing: passed → auto-continue, gaps_found → user decides, tech_debt → user decides
881
1031
  - [ ] Audit technical failure (no file/no status) routes to handle_blocker
882
1032
  - [ ] Complete-milestone invoked via Skill() with ${milestone_version} arg
883
1033
  - [ ] Cleanup invoked via Skill() — internal confirmation is acceptable (CTRL-01)
884
1034
  - [ ] Final completion banner displayed after lifecycle
885
- - [ ] Progress bar uses phase number / total milestone phases (not position among incomplete)
1035
+ - [ ] Progress bar uses phase number / total milestone phases (not position among incomplete), with fallback display when phase numbers exceed total
886
1036
  - [ ] Smart discuss documents relationship to discuss-phase with CTRL-03 note
887
1037
  - [ ] Frontend phases get UI-SPEC generated before planning (step 3a.5) if not already present
888
1038
  - [ ] Frontend phases get UI review audit after successful execution (step 3d.5) if UI-SPEC exists
889
1039
  - [ ] UI phase and UI review respect workflow.ui_phase and workflow.ui_review config toggles
890
1040
  - [ ] UI review is advisory (non-blocking) — phase proceeds to iterate regardless of score
1041
+ - [ ] `--only N` restricts execution to exactly one phase
1042
+ - [ ] `--only N` skips lifecycle step (audit/complete/cleanup)
1043
+ - [ ] `--only N` exits cleanly after single phase completes
1044
+ - [ ] `--only N` on already-complete phase exits with message
1045
+ - [ ] `--only N` handle_blocker resume message uses --only flag
1046
+ - [ ] `--to N` stops execution after phase N completes (halts at iterate step)
1047
+ - [ ] `--to N` filters out phases with number > N during discovery
1048
+ - [ ] `--to N` displays "Stopping after phase N" in startup banner
1049
+ - [ ] `--to N` on already completed target exits with "already completed" message
1050
+ - [ ] `--to N` compatible with `--from N` (run phases from M to N)
1051
+ - [ ] `--to N` handle_blocker resume message preserves --to flag
1052
+ - [ ] `--to N` skips lifecycle when not all milestone phases complete
1053
+ - [ ] `--interactive` runs discuss inline via sdd:discuss-phase (asks questions, waits for user)
1054
+ - [ ] `--interactive` dispatches plan and execute as background agents (context isolation)
1055
+ - [ ] `--interactive` enables pipeline parallelism: discuss Phase N+1 while Phase N builds
1056
+ - [ ] `--interactive` main context only accumulates discuss conversations (lean)
1057
+ - [ ] `--interactive` waits for background agents before post-execution routing
1058
+ - [ ] `--interactive` compatible with `--only`, `--from`, and `--to` flags
891
1059
  </success_criteria>
@@ -22,14 +22,14 @@ If `todo_count` is 0:
22
22
  ```
23
23
  No pending todos.
24
24
 
25
- Todos are captured during work sessions with /sdd:add-todo.
25
+ Todos are captured during work sessions with /sdd-add-todo.
26
26
 
27
27
  ---
28
28
 
29
29
  Would you like to:
30
30
 
31
- 1. Continue with current phase (/sdd:progress)
32
- 2. Add a todo now (/sdd:add-todo)
31
+ 1. Continue with current phase (/sdd-progress)
32
+ 2. Add a todo now (/sdd-add-todo)
33
33
  ```
34
34
 
35
35
  Exit.
@@ -37,8 +37,8 @@ Exit.
37
37
 
38
38
  <step name="parse_filter">
39
39
  Check for area filter in arguments:
40
- - `/sdd:check-todos` → show all
41
- - `/sdd:check-todos api` → filter to area:api only
40
+ - `/sdd-check-todos` → show all
41
+ - `/sdd-check-todos api` → filter to area:api only
42
42
  </step>
43
43
 
44
44
  <step name="list_todos">
@@ -56,7 +56,7 @@ Pending Todos:
56
56
  ---
57
57
 
58
58
  Reply with a number to view details, or:
59
- - `/sdd:check-todos [area]` to filter by area
59
+ - `/sdd-check-todos [area]` to filter by area
60
60
  - `q` to exit
61
61
  ```
62
62
 
@@ -102,6 +102,8 @@ If `.planning/ROADMAP.md` exists:
102
102
  <step name="offer_actions">
103
103
  **If todo maps to a roadmap phase:**
104
104
 
105
+
106
+ **Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `AskUserQuestion` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-Claude runtimes (OpenAI Codex, Gemini CLI, etc.) where `AskUserQuestion` is not available.
105
107
  Use AskUserQuestion:
106
108
  - header: "Action"
107
109
  - question: "This todo relates to Phase [N]: [name]. What would you like to do?"
@@ -118,7 +120,7 @@ Use AskUserQuestion:
118
120
  - question: "What would you like to do with this todo?"
119
121
  - options:
120
122
  - "Work on it now" — move to done, start working
121
- - "Create a phase" — /sdd:add-phase with this scope
123
+ - "Create a phase" — /sdd-add-phase with this scope
122
124
  - "Brainstorm approach" — think through before deciding
123
125
  - "Put it back" — return to list
124
126
  </step>
@@ -126,7 +128,7 @@ Use AskUserQuestion:
126
128
  <step name="execute_action">
127
129
  **Work on it now:**
128
130
  ```bash
129
- mv ".planning/todos/pending/[filename]" ".planning/todos/done/"
131
+ mv ".planning/todos/pending/[filename]" ".planning/todos/completed/"
130
132
  ```
131
133
  Update STATE.md todo count. Present problem/solution context. Begin work or ask how to proceed.
132
134
 
@@ -134,7 +136,7 @@ Update STATE.md todo count. Present problem/solution context. Begin work or ask
134
136
  Note todo reference in phase planning notes. Keep in pending. Return to list or exit.
135
137
 
136
138
  **Create a phase:**
137
- Display: `/sdd:add-phase [description from todo]`
139
+ Display: `/sdd-add-phase [description from todo]`
138
140
  Keep in pending. User runs command in fresh context.
139
141
 
140
142
  **Brainstorm approach:**
@@ -155,7 +157,7 @@ If todo was moved to done/, commit the change:
155
157
 
156
158
  ```bash
157
159
  git rm --cached .planning/todos/pending/[filename] 2>/dev/null || true
158
- node "$HOME/.claude/sdd/bin/sdd-tools.cjs" commit "docs: start work on todo - [title]" --files .planning/todos/done/[filename] .planning/STATE.md
160
+ node "$HOME/.claude/sdd/bin/sdd-tools.cjs" commit "docs: start work on todo - [title]" --files .planning/todos/completed/[filename] .planning/STATE.md
159
161
  ```
160
162
 
161
163
  Tool respects `commit_docs` config and gitignore automatically.
@@ -93,6 +93,8 @@ No phase directories found to archive. Phases may have been removed or archived
93
93
 
94
94
  Stop here.
95
95
 
96
+
97
+ **Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `AskUserQuestion` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-Claude runtimes (OpenAI Codex, Gemini CLI, etc.) where `AskUserQuestion` is not available.
96
98
  AskUserQuestion: "Proceed with archiving?" with options: "Yes — archive listed phases" | "Cancel"
97
99
 
98
100
  If "Cancel": Stop.