@bhargavvc/sdd-cc 1.30.1 → 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 +2145 -545
  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
@@ -29,45 +29,101 @@ Extract:
29
29
 
30
30
  If no `.planning/` directory exists:
31
31
  ```
32
- No SDD project detected. Run `/sdd:new-project` to get started.
32
+ No SDD project detected. Run `/sdd-new-project` to get started.
33
33
  ```
34
34
  Exit.
35
35
  </step>
36
36
 
37
+ <step name="safety_gates">
38
+ Run hard-stop checks before routing. Exit on first hit unless `--force` was passed.
39
+
40
+ If `--force` flag was passed, skip all gates and the consecutive guard.
41
+ Print a one-line warning: `⚠ --force: skipping safety gates`
42
+ Then proceed directly to `determine_next_action`.
43
+
44
+ **Gate 1: Unresolved checkpoint**
45
+ Check if `.planning/.continue-here.md` exists:
46
+ ```bash
47
+ [ -f .planning/.continue-here.md ]
48
+ ```
49
+ If found:
50
+ ```
51
+ ⛔ Hard stop: Unresolved checkpoint
52
+
53
+ `.planning/.continue-here.md` exists — a previous session left
54
+ unfinished work that needs manual review before advancing.
55
+
56
+ Read the file, resolve the issue, then delete it to continue.
57
+ Use `--force` to bypass this check.
58
+ ```
59
+ Exit (do not route).
60
+
61
+ **Gate 2: Error state**
62
+ Check if STATE.md contains `status: error` or `status: failed`:
63
+ If found:
64
+ ```
65
+ ⛔ Hard stop: Project in error state
66
+
67
+ STATE.md shows status: {status}. Resolve the error before advancing.
68
+ Run `/sdd-health` to diagnose, or manually fix STATE.md.
69
+ Use `--force` to bypass this check.
70
+ ```
71
+ Exit.
72
+
73
+ **Gate 3: Unchecked verification**
74
+ Check if the current phase has a VERIFICATION.md with any `FAIL` items that don't have overrides:
75
+ If found:
76
+ ```
77
+ ⛔ Hard stop: Unchecked verification failures
78
+
79
+ VERIFICATION.md for phase {N} has {count} unresolved FAIL items.
80
+ Address the failures or add overrides before advancing to the next phase.
81
+ Use `--force` to bypass this check.
82
+ ```
83
+ Exit.
84
+
85
+ **Consecutive-call guard:**
86
+ After passing all gates, check a counter file `.planning/.next-call-count`:
87
+ - If file exists and count >= 6: prompt "You've called /sdd-next {N} times consecutively. Continue? [y/N]"
88
+ - If user says no, exit
89
+ - Increment the counter
90
+ - The counter file is deleted by any non-`/sdd-next` command (convention — other workflows don't need to implement this, the note here is sufficient)
91
+ </step>
92
+
37
93
  <step name="determine_next_action">
38
94
  Apply routing rules based on state:
39
95
 
40
96
  **Route 1: No phases exist yet → discuss**
41
97
  If ROADMAP has phases but no phase directories exist on disk:
42
- → Next action: `/sdd:discuss-phase <first-phase>`
98
+ → Next action: `/sdd-discuss-phase <first-phase>`
43
99
 
44
100
  **Route 2: Phase exists but has no CONTEXT.md or RESEARCH.md → discuss**
45
101
  If the current phase directory exists but has neither CONTEXT.md nor RESEARCH.md:
46
- → Next action: `/sdd:discuss-phase <current-phase>`
102
+ → Next action: `/sdd-discuss-phase <current-phase>`
47
103
 
48
104
  **Route 3: Phase has context but no plans → plan**
49
105
  If the current phase has CONTEXT.md (or RESEARCH.md) but no PLAN.md files:
50
- → Next action: `/sdd:plan-phase <current-phase>`
106
+ → Next action: `/sdd-plan-phase <current-phase>`
51
107
 
52
108
  **Route 4: Phase has plans but incomplete summaries → execute**
53
109
  If plans exist but not all have matching summaries:
54
- → Next action: `/sdd:execute-phase <current-phase>`
110
+ → Next action: `/sdd-execute-phase <current-phase>`
55
111
 
56
112
  **Route 5: All plans have summaries → verify and complete**
57
113
  If all plans in the current phase have summaries:
58
- → Next action: `/sdd:verify-work` then `/sdd:complete-phase`
114
+ → Next action: `/sdd-verify-work`
59
115
 
60
116
  **Route 6: Phase complete, next phase exists → advance**
61
117
  If the current phase is complete and the next phase exists in ROADMAP:
62
- → Next action: `/sdd:discuss-phase <next-phase>`
118
+ → Next action: `/sdd-discuss-phase <next-phase>`
63
119
 
64
120
  **Route 7: All phases complete → complete milestone**
65
121
  If all phases are complete:
66
- → Next action: `/sdd:complete-milestone`
122
+ → Next action: `/sdd-complete-milestone`
67
123
 
68
124
  **Route 8: Paused → resume**
69
125
  If STATE.md shows paused_at:
70
- → Next action: `/sdd:resume-work`
126
+ → Next action: `/sdd-resume-work`
71
127
  </step>
72
128
 
73
129
  <step name="show_and_execute">
@@ -79,12 +135,12 @@ Display the determination:
79
135
  **Current:** Phase [N] — [name] | [progress]%
80
136
  **Status:** [status description]
81
137
 
82
- ▶ **Next step:** `/sdd:[command] [args]`
138
+ ▶ **Next step:** `/sdd-[command] [args]`
83
139
  [One-line explanation of why this is the next step]
84
140
  ```
85
141
 
86
142
  Then immediately invoke the determined command via SlashCommand.
87
- Do not ask for confirmation — the whole point of `/sdd:next` is zero-friction advancement.
143
+ Do not ask for confirmation — the whole point of `/sdd-next` is zero-friction advancement.
88
144
  </step>
89
145
 
90
146
  </process>
@@ -1,5 +1,7 @@
1
1
  <purpose>
2
2
  Zero-friction idea capture. One Write call, one confirmation line. No questions, no prompts.
3
+
4
+ **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.
3
5
  Runs inline — no Task, no AskUserQuestion, no Bash.
4
6
  </purpose>
5
7
 
@@ -43,7 +45,7 @@ promoted: false
43
45
  | Arguments are empty (no text at all) | **list** |
44
46
  | Anything else | **append** (the text IS the note) |
45
47
 
46
- **Critical**: `list` is only a subcommand when it's the ENTIRE argument. `/sdd:note list of groceries` saves a note with text "list of groceries". Same for `promote` — only a subcommand when followed by exactly one number.
48
+ **Critical**: `list` is only a subcommand when it's the ENTIRE argument. `/sdd-note list of groceries` saves a note with text "list of groceries". Same for `promote` — only a subcommand when followed by exactly one number.
47
49
  </step>
48
50
 
49
51
  <step name="append">
@@ -87,7 +89,7 @@ Project (.planning/notes/):
87
89
  Global (~/.claude/notes/):
88
90
  4. [2026-02-08 10:00] cross-project idea about shared config
89
91
 
90
- {count} active note(s). Use `/sdd:note promote <N>` to convert to a todo.
92
+ {count} active note(s). Use `/sdd-note promote <N>` to convert to a todo.
91
93
  ```
92
94
 
93
95
  If a scope has no directory or no entries, show: `(no notes)`
@@ -99,9 +101,9 @@ If a scope has no directory or no entries, show: `(no notes)`
99
101
  1. Run the **list** logic to build the numbered index (both scopes)
100
102
  2. Find entry N from the numbered list
101
103
  3. If N is invalid or refers to an already-promoted note, tell the user and stop
102
- 4. **Requires `.planning/` directory** — if it doesn't exist, warn: "Todos require a SDD project. Run `/sdd:new-project` to initialize one."
104
+ 4. **Requires `.planning/` directory** — if it doesn't exist, warn: "Todos require a SDD project. Run `/sdd-new-project` to initialize one."
103
105
  5. Ensure `.planning/todos/pending/` directory exists
104
- 6. Generate todo ID: `{NNN}-{slug}` where NNN is the next sequential number (scan both `.planning/todos/pending/` and `.planning/todos/done/` for the highest existing number, increment by 1, zero-pad to 3 digits) and slug is the first ~4 meaningful words of the note text
106
+ 6. Generate todo ID: `{NNN}-{slug}` where NNN is the next sequential number (scan both `.planning/todos/pending/` and `.planning/todos/completed/` for the highest existing number, increment by 1, zero-pad to 3 digits) and slug is the first ~4 meaningful words of the note text
105
107
  7. Extract the note text from the source file (body after frontmatter)
106
108
  8. Create `.planning/todos/pending/{id}.md`:
107
109
 
@@ -110,7 +112,7 @@ If a scope has no directory or no entries, show: `(no notes)`
110
112
  title: "{note text}"
111
113
  status: pending
112
114
  priority: P2
113
- source: "promoted from /sdd:note"
115
+ source: "promoted from /sdd-note"
114
116
  created: {YYYY-MM-DD}
115
117
  theme: general
116
118
  ---
@@ -135,9 +137,9 @@ Promoted from quick note captured on {original date}.
135
137
  </process>
136
138
 
137
139
  <edge_cases>
138
- 1. **"list" as note text**: `/sdd:note list of things` saves note "list of things" (subcommand only when `list` is the entire arg)
140
+ 1. **"list" as note text**: `/sdd-note list of things` saves note "list of things" (subcommand only when `list` is the entire arg)
139
141
  2. **No `.planning/`**: Falls back to global `~/.claude/notes/` — works in any directory
140
- 3. **Promote without project**: Warns that todos require `.planning/`, suggests `/sdd:new-project`
142
+ 3. **Promote without project**: Warns that todos require `.planning/`, suggests `/sdd-new-project`
141
143
  4. **Large files**: `list` shows last 10 when >20 active entries
142
144
  5. **Duplicate slugs**: Append `-2`, `-3` etc. to filename if slug already used on same date
143
145
  6. **`--global` position**: Stripped from anywhere — `--global my idea` and `my idea --global` both save "my idea" globally
@@ -1,5 +1,5 @@
1
1
  <purpose>
2
- Create structured `.planning/HANDOFF.json` and `.continue-here.md` handoff files to preserve complete work state across sessions. The JSON provides machine-readable state for `/sdd:resume-work`; the markdown provides human-readable context.
2
+ Create structured `.planning/HANDOFF.json` and `.continue-here.md` handoff files to preserve complete work state across sessions. The JSON provides machine-readable state for `/sdd-resume-work`; the markdown provides human-readable context.
3
3
  </purpose>
4
4
 
5
5
  <required_reading>
@@ -9,14 +9,28 @@ Read all files referenced by the invoking prompt's execution_context before star
9
9
  <process>
10
10
 
11
11
  <step name="detect">
12
- Find current phase directory from most recently modified files:
12
+ ## Context Detection
13
+
14
+ Determine what kind of work is being paused and set the handoff destination accordingly:
13
15
 
14
16
  ```bash
15
- # Find most recent phase directory with work
16
- (ls -lt .planning/phases/*/PLAN.md 2>/dev/null || true) | head -1 | grep -oP 'phases/\K[^/]+' || true
17
+ # Check for active phase
18
+ phase=$(( ls -lt .planning/phases/*/PLAN.md 2>/dev/null || true ) | head -1 | grep -oP 'phases/\K[^/]+' || true)
19
+
20
+ # Check for active spike
21
+ spike=$(( ls -lt .planning/spikes/*/SPIKE.md .planning/spikes/*/DESIGN.md 2>/dev/null || true ) | head -1 | grep -oP 'spikes/\K[^/]+' || true)
22
+
23
+ # Check for active deliberation
24
+ deliberation=$(ls .planning/deliberations/*.md 2>/dev/null | head -1 || true)
17
25
  ```
18
26
 
19
- If no active phase detected, ask user which phase they're pausing work on.
27
+ - **Phase work**: active phase directory handoff to `.planning/phases/XX-name/.continue-here.md`
28
+ - **Spike work**: active spike directory or spike-related files (no active phase) → handoff to `.planning/spikes/SPIKE-NNN/.continue-here.md` (create directory if needed)
29
+ - **Deliberation work**: active deliberation file (no phase/spike) → handoff to `.planning/deliberations/.continue-here.md`
30
+ - **Research work**: research notes exist but no phase/spike/deliberation → handoff to `.planning/.continue-here.md`
31
+ - **Default**: no detectable context → handoff to `.planning/.continue-here.md`, note the ambiguity in `<current_state>`
32
+
33
+ If phase is detected, proceed with phase handoff path. Otherwise use the first matching non-phase path above.
20
34
  </step>
21
35
 
22
36
  <step name="gather">
@@ -30,6 +44,9 @@ If no active phase detected, ask user which phase they're pausing work on.
30
44
  6. **Human actions pending**: Things that need manual intervention (MCP setup, API keys, approvals, manual testing)
31
45
  7. **Background processes**: Any running servers/watchers that were part of the workflow
32
46
  8. **Files modified**: What's changed but not committed
47
+ 9. **Blocking constraints**: Anti-patterns or methodological failures encountered during this session that a resuming agent MUST be aware of before proceeding. Only include items discovered through actual failure — not warnings or predictions. Assign each constraint a `severity`:
48
+ - `blocking` — The resuming agent MUST demonstrate understanding before proceeding. The discuss-phase and execute-phase workflows will enforce a mandatory understanding check.
49
+ - `advisory` — Important context but does not gate resumption.
33
50
 
34
51
  Ask user for clarifications if needed via conversational questions.
35
52
 
@@ -85,10 +102,11 @@ timestamp=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" current-timestamp full --
85
102
  </step>
86
103
 
87
104
  <step name="write">
88
- **Write handoff to `.planning/phases/XX-name/.continue-here.md`:**
105
+ **Write handoff to the path determined in the detect step** (e.g. `.planning/phases/XX-name/.continue-here.md`, `.planning/spikes/SPIKE-NNN/.continue-here.md`, or `.planning/.continue-here.md`):
89
106
 
90
107
  ```markdown
91
108
  ---
109
+ context: [phase|spike|deliberation|research|default]
92
110
  phase: XX-name
93
111
  task: 3
94
112
  total_tasks: 7
@@ -96,12 +114,35 @@ status: in_progress
96
114
  last_updated: [timestamp from current-timestamp]
97
115
  ---
98
116
 
117
+ # BLOCKING CONSTRAINTS — Read Before Anything Else
118
+
119
+ > These are not suggestions. Each constraint below was discovered through failure.
120
+ > Acknowledge each one explicitly before proceeding.
121
+
122
+ - [ ] CONSTRAINT: [name] — [what it is] — [structural mitigation required]
123
+
124
+ **Do not proceed until all boxes are checked.**
125
+
126
+ _If no constraints have been identified yet, remove this section._
127
+
128
+ ## Critical Anti-Patterns
129
+
130
+ | Pattern | Description | Severity | Prevention Mechanism |
131
+ |---------|-------------|----------|---------------------|
132
+ | [pattern name] | [what it is and how it manifested] | blocking | [structural step that prevents recurrence — not acknowledgment] |
133
+ | [pattern name] | [what it is and how it manifested] | advisory | [guidance for avoiding it] |
134
+
135
+ **Severity values:** `blocking` — resuming agent must pass understanding check before proceeding. `advisory` — important context, does not gate resumption.
136
+
137
+ _Remove rows that do not apply. The discuss-phase and execute-phase workflows parse this table and enforce a mandatory understanding check for any `blocking` rows._
138
+
99
139
  <current_state>
100
140
  [Where exactly are we? Immediate context]
101
141
  </current_state>
102
142
 
103
143
  <completed_work>
104
144
 
145
+ Completed Tasks:
105
146
  - Task 1: [name] - Done
106
147
  - Task 2: [name] - Done
107
148
  - Task 3: [name] - In progress, [what's done]
@@ -124,6 +165,25 @@ last_updated: [timestamp from current-timestamp]
124
165
  - [Blocker 1]: [status/workaround]
125
166
  </blockers>
126
167
 
168
+ ## Required Reading (in order)
169
+ <!-- List documents the resuming agent must read before acting -->
170
+ 1. [document] — [why it matters]
171
+ 1. `.planning/METHODOLOGY.md` (if it exists) — project analytical lenses; apply before any assumption analysis
172
+
173
+ ## Critical Anti-Patterns (do NOT repeat these)
174
+ <!-- Mistakes discovered this session that must be structurally avoided -->
175
+ - [ANTI-PATTERN]: [what it is] → [structural mitigation]
176
+
177
+ ## Infrastructure State
178
+ <!-- Running services, external state, environment specifics -->
179
+ - [service/env]: [current state]
180
+
181
+ ## Pre-Execution Critique Required
182
+ <!-- Fill in ONLY if pausing between design and execution (e.g. spike design done, not yet run) -->
183
+ - Design artifact: [path]
184
+ - Critique focus: [key questions the critic should probe]
185
+ - Gate: Do NOT begin execution until critique is complete and design is revised
186
+
127
187
  <context>
128
188
  [Mental state, what were you thinking, the plan]
129
189
  </context>
@@ -143,7 +203,7 @@ timestamp=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" current-timestamp full --
143
203
 
144
204
  <step name="commit">
145
205
  ```bash
146
- node "$HOME/.claude/sdd/bin/sdd-tools.cjs" commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/phases/*/.continue-here.md .planning/HANDOFF.json
206
+ node "$HOME/.claude/sdd/bin/sdd-tools.cjs" commit "wip: [context-name] paused at [X]/[Y]" --files [handoff-path] .planning/HANDOFF.json
147
207
  ```
148
208
  </step>
149
209
 
@@ -151,17 +211,18 @@ node "$HOME/.claude/sdd/bin/sdd-tools.cjs" commit "wip: [phase-name] paused at t
151
211
  ```
152
212
  ✓ Handoff created:
153
213
  - .planning/HANDOFF.json (structured, machine-readable)
154
- - .planning/phases/[XX-name]/.continue-here.md (human-readable)
214
+ - [handoff-path] (human-readable)
155
215
 
156
216
  Current state:
157
217
 
158
- - Phase: [XX-name]
218
+ - Context: [phase|spike|deliberation|research]
219
+ - Location: [XX-name or SPIKE-NNN]
159
220
  - Task: [X] of [Y]
160
221
  - Status: [in_progress/blocked]
161
222
  - Blockers: [count] ({human_actions_pending count} need human action)
162
223
  - Committed as WIP
163
224
 
164
- To resume: /sdd:resume-work
225
+ To resume: /sdd-resume-work
165
226
 
166
227
  ```
167
228
  </step>
@@ -169,8 +230,10 @@ To resume: /sdd:resume-work
169
230
  </process>
170
231
 
171
232
  <success_criteria>
172
- - [ ] .continue-here.md created in correct phase directory
173
- - [ ] All sections filled with specific content
233
+ - [ ] Context detected (phase/spike/deliberation/research/default)
234
+ - [ ] .continue-here.md created at correct path for detected context
235
+ - [ ] Required Reading, Anti-Patterns, and Infrastructure State sections filled
236
+ - [ ] Pre-Execution Critique section filled if pausing between design and execution
174
237
  - [ ] Committed as WIP
175
238
  - [ ] User knows location and how to resume
176
239
  </success_criteria>
@@ -1,5 +1,5 @@
1
1
  <purpose>
2
- Create all phases necessary to close gaps identified by `/sdd:audit-milestone`. Reads MILESTONE-AUDIT.md, groups gaps into logical phases, creates phase entries in ROADMAP.md, and offers to plan each phase. One command creates all fix phases — no manual `/sdd:add-phase` per gap.
2
+ Create all phases necessary to close gaps identified by `/sdd-audit-milestone`. Reads MILESTONE-AUDIT.md, groups gaps into logical phases, creates phase entries in ROADMAP.md, and offers to plan each phase. One command creates all fix phases — no manual `/sdd-add-phase` per gap.
3
3
  </purpose>
4
4
 
5
5
  <required_reading>
@@ -22,7 +22,7 @@ Parse YAML frontmatter to extract structured gaps:
22
22
 
23
23
  If no audit file exists or has no gaps, error:
24
24
  ```
25
- No audit gaps found. Run `/sdd:audit-milestone` first.
25
+ No audit gaps found. Run `/sdd-audit-milestone` first.
26
26
  ```
27
27
 
28
28
  ## 2. Prioritize Gaps
@@ -163,22 +163,22 @@ node "$HOME/.claude/sdd/bin/sdd-tools.cjs" commit "docs(roadmap): add gap closur
163
163
 
164
164
  **Plan first gap closure phase**
165
165
 
166
- `/sdd:plan-phase {N}`
166
+ `/clear` then:
167
167
 
168
- <sub>`/clear` first → fresh context window</sub>
168
+ `/sdd-plan-phase {N}`
169
169
 
170
170
  ---
171
171
 
172
172
  **Also available:**
173
- - `/sdd:execute-phase {N}` — if plans already exist
173
+ - `/sdd-execute-phase {N}` — if plans already exist
174
174
  - `cat .planning/ROADMAP.md` — see updated roadmap
175
175
 
176
176
  ---
177
177
 
178
178
  **After all gap phases complete:**
179
179
 
180
- `/sdd:audit-milestone` — re-audit to verify gaps closed
181
- `/sdd:complete-milestone {version}` — archive when audit passes
180
+ `/sdd-audit-milestone` — re-audit to verify gaps closed
181
+ `/sdd-complete-milestone {version}` — archive when audit passes
182
182
  ```
183
183
 
184
184
  </process>
@@ -269,5 +269,5 @@ becomes:
269
269
  - [ ] Coverage count updated in REQUIREMENTS.md
270
270
  - [ ] Phase directories created
271
271
  - [ ] Changes committed (includes REQUIREMENTS.md)
272
- - [ ] User knows to run `/sdd:plan-phase` next
272
+ - [ ] User knows to run `/sdd-plan-phase` next
273
273
  </success_criteria>