@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
@@ -2,8 +2,8 @@
2
2
 
3
3
  Template for project-root `CLAUDE.md` — auto-generated by `sdd-tools generate-claude-md`.
4
4
 
5
- Contains 6 marker-bounded sections. Each section is independently updatable.
6
- The `generate-claude-md` subcommand manages 5 sections (project, stack, conventions, architecture, workflow enforcement).
5
+ Contains 7 marker-bounded sections. Each section is independently updatable.
6
+ The `generate-claude-md` subcommand manages 6 sections (project, stack, conventions, architecture, skills, workflow enforcement).
7
7
  The profile section is managed exclusively by `generate-claude-profile`.
8
8
 
9
9
  ---
@@ -21,7 +21,7 @@ The profile section is managed exclusively by `generate-claude-profile`.
21
21
 
22
22
  **Fallback text:**
23
23
  ```
24
- Project not yet initialized. Run /sdd:new-project to set up.
24
+ Project not yet initialized. Run /sdd-new-project to set up.
25
25
  ```
26
26
 
27
27
  ### Stack Section
@@ -66,6 +66,28 @@ Conventions not yet established. Will populate as patterns emerge during develop
66
66
  Architecture not yet mapped. Follow existing patterns found in the codebase.
67
67
  ```
68
68
 
69
+ ### Skills Section
70
+ ```
71
+ <!-- SDD:skills-start source:skills/ -->
72
+ ## Project Skills
73
+
74
+ | Skill | Description | Path |
75
+ | -------------- | --------------------- | ------------------------- |
76
+ | {{skill_name}} | {{skill_description}} | `{{skill_path}}/SKILL.md` |
77
+ <!-- SDD:skills-end -->
78
+ ```
79
+
80
+ **Fallback text:**
81
+ ```
82
+ No project skills found. Add skills to any of: `.claude/skills/`, `.agents/skills/`, `.cursor/skills/`, or `.github/skills/` with a `SKILL.md` index file.
83
+ ```
84
+
85
+ **Discovery behavior:**
86
+ - Scans `.claude/skills/`, `.agents/skills/`, `.cursor/skills/`, `.github/skills/` for subdirectories containing `SKILL.md`
87
+ - Extracts `name` and `description` from YAML frontmatter (supports multi-line descriptions)
88
+ - Skips SDD's own installed skills (directories starting with `sdd-`)
89
+ - Deduplicates by skill name across directories
90
+
69
91
  ### Workflow Enforcement Section
70
92
  ```
71
93
  <!-- SDD:workflow-start source:SDD defaults -->
@@ -74,9 +96,9 @@ Architecture not yet mapped. Follow existing patterns found in the codebase.
74
96
  Before using Edit, Write, or other file-changing tools, start work through a SDD command so planning artifacts and execution context stay in sync.
75
97
 
76
98
  Use these entry points:
77
- - `/sdd:quick` for small fixes, doc updates, and ad-hoc tasks
78
- - `/sdd:debug` for investigation and bug fixing
79
- - `/sdd:execute-phase` for planned phase work
99
+ - `/sdd-quick` for small fixes, doc updates, and ad-hoc tasks
100
+ - `/sdd-debug` for investigation and bug fixing
101
+ - `/sdd-execute-phase` for planned phase work
80
102
 
81
103
  Do not make direct repo edits outside a SDD workflow unless the user explicitly asks to bypass it.
82
104
  <!-- SDD:workflow-end -->
@@ -87,7 +109,7 @@ Do not make direct repo edits outside a SDD workflow unless the user explicitly
87
109
  <!-- SDD:profile-start -->
88
110
  ## Developer Profile
89
111
 
90
- > Profile not yet configured. Run `/sdd:profile-user` to generate your developer profile.
112
+ > Profile not yet configured. Run `/sdd-profile-user` to generate your developer profile.
91
113
  > This section is managed by `generate-claude-profile` — do not edit manually.
92
114
  <!-- SDD:profile-end -->
93
115
  ```
@@ -104,8 +126,9 @@ CLAUDE.md file and no profile section exists yet.
104
126
  2. **Stack** — Technology choices (what tools are used)
105
127
  3. **Conventions** — Code patterns and rules (how code is written)
106
128
  4. **Architecture** — System structure (how components fit together)
107
- 5. **Workflow Enforcement** — Default SDD entry points for file-changing work
108
- 6. **Profile** — Developer behavioral preferences (how to interact)
129
+ 5. **Skills** — Discovered project skills with name and description (what domain knowledge is available)
130
+ 6. **Workflow Enforcement** — Default SDD entry points for file-changing work
131
+ 7. **Profile** — Developer behavioral preferences (how to interact)
109
132
 
110
133
  ## Marker Format
111
134
 
@@ -7,6 +7,9 @@
7
7
  "verifier": true,
8
8
  "auto_advance": false,
9
9
  "nyquist_validation": true,
10
+ "security_enforcement": true,
11
+ "security_asvs_level": 1,
12
+ "security_block_on": "high",
10
13
  "discuss_mode": "discuss",
11
14
  "research_before_questions": false
12
15
  },
@@ -40,5 +43,6 @@
40
43
  "hooks": {
41
44
  "context_warnings": true
42
45
  },
46
+ "project_code": null,
43
47
  "agent_skills": {}
44
48
  }
@@ -51,7 +51,7 @@ Create: .planning/debug/{slug}.md
51
51
 
52
52
  ## Usage
53
53
 
54
- **From /sdd:debug:**
54
+ **From /sdd-debug:**
55
55
  ```python
56
56
  Task(
57
57
  prompt=filled_template,
@@ -5,7 +5,7 @@ description: Load developer preferences into this session
5
5
  # Developer Preferences
6
6
 
7
7
  > Generated by SDD on {{generated_at}} from {{data_source}}.
8
- > Run `/sdd:profile-user --refresh` to regenerate.
8
+ > Run `/sdd-profile-user --refresh` to regenerate.
9
9
 
10
10
  ## Behavioral Directives
11
11
 
@@ -4,7 +4,7 @@ Template for `.planning/phases/XX-name/DISCOVERY.md` - shallow research for libr
4
4
 
5
5
  **Purpose:** Answer "which library/option should we use" questions during mandatory discovery in plan-phase.
6
6
 
7
- For deep ecosystem research ("how do experts build this"), use `/sdd:research-phase` which produces RESEARCH.md.
7
+ For deep ecosystem research ("how do experts build this"), use `/sdd-research-phase` which produces RESEARCH.md.
8
8
 
9
9
  ---
10
10
 
@@ -142,5 +142,5 @@ Create `.planning/phases/XX-name/DISCOVERY.md`:
142
142
  - Niche/complex domains (3D, games, audio, shaders)
143
143
  - Need ecosystem knowledge, not just library choice
144
144
  - "How do experts build this" questions
145
- - Use `/sdd:research-phase` for these
145
+ - Use `/sdd-research-phase` for these
146
146
  </guidelines>
@@ -142,7 +142,7 @@ After completion, create `.planning/phases/XX-name/{phase}-{plan}-SUMMARY.md`
142
142
  | `user_setup` | No | Array of human-required setup items (external services) |
143
143
  | `must_haves` | Yes | Goal-backward verification criteria (see below) |
144
144
 
145
- **Wave is pre-computed:** Wave numbers are assigned during `/sdd:plan-phase`. Execute-phase reads `wave` directly from frontmatter and groups plans by wave number. No runtime dependency analysis needed.
145
+ **Wave is pre-computed:** Wave numbers are assigned during `/sdd-plan-phase`. Execute-phase reads `wave` directly from frontmatter and groups plans by wave number. No runtime dependency analysis needed.
146
146
 
147
147
  **Must-haves enable verification:** The `must_haves` field carries goal-backward requirements from planning to execution. After all plans complete, execute-phase spawns a verification subagent that checks these criteria against the actual codebase.
148
148
 
@@ -34,7 +34,7 @@ Template for spawning sdd-planner agent. The agent contains all planning experti
34
34
  </planning_context>
35
35
 
36
36
  <downstream_consumer>
37
- Output consumed by /sdd:execute-phase
37
+ Output consumed by /sdd-execute-phase
38
38
  Plans must be executable prompts with:
39
39
  - Frontmatter (wave, depends_on, files_modified, autonomous)
40
40
  - Tasks in XML format
@@ -68,7 +68,7 @@ Before returning PLANNING COMPLETE:
68
68
 
69
69
  ## Usage
70
70
 
71
- **From /sdd:plan-phase (standard mode):**
71
+ **From /sdd-plan-phase (standard mode):**
72
72
  ```python
73
73
  Task(
74
74
  prompt=filled_template,
@@ -77,7 +77,7 @@ Task(
77
77
  )
78
78
  ```
79
79
 
80
- **From /sdd:plan-phase --gaps (gap closure mode):**
80
+ **From /sdd-plan-phase --gaps (gap closure mode):**
81
81
  ```python
82
82
  Task(
83
83
  prompt=filled_template, # with mode: gap_closure
@@ -149,7 +149,7 @@ and implemented by workflows/transition.md and workflows/complete-milestone.md.
149
149
 
150
150
  For existing codebases:
151
151
 
152
- 1. **Map codebase first** via `/sdd:map-codebase`
152
+ 1. **Map codebase first** via `/sdd-map-codebase`
153
153
 
154
154
  2. **Infer Validated requirements** from existing code:
155
155
  - What does the codebase actually do?
@@ -18,7 +18,7 @@ Template for `.planning/phases/XX-name/{phase_num}-RESEARCH.md` - comprehensive
18
18
  <user_constraints>
19
19
  ## User Constraints (from CONTEXT.md)
20
20
 
21
- **CRITICAL:** If CONTEXT.md exists from /sdd:discuss-phase, copy locked decisions here verbatim. These MUST be honored by the planner.
21
+ **CRITICAL:** If CONTEXT.md exists from /sdd-discuss-phase, copy locked decisions here verbatim. These MUST be honored by the planner.
22
22
 
23
23
  ### Locked Decisions
24
24
  [Copy from CONTEXT.md `## Decisions` section - these are NON-NEGOTIABLE]
@@ -145,10 +145,10 @@ Updated after each plan completion.
145
145
 
146
146
  **Decisions:** Reference to PROJECT.md Key Decisions table, plus recent decisions summary for quick access. Full decision log lives in PROJECT.md.
147
147
 
148
- **Pending Todos:** Ideas captured via /sdd:add-todo
148
+ **Pending Todos:** Ideas captured via /sdd-add-todo
149
149
  - Count of pending todos
150
150
  - Reference to .planning/todos/pending/
151
- - Brief list if few, count if many (e.g., "5 pending todos — see /sdd:check-todos")
151
+ - Brief list if few, count if many (e.g., "5 pending todos — see /sdd-check-todos")
152
152
 
153
153
  **Blockers/Concerns:** From "Next Phase Readiness" sections
154
154
  - Issues that affect future work
@@ -11,15 +11,15 @@ Read all files referenced by the invoking prompt's execution_context before star
11
11
  <step name="parse_arguments">
12
12
  Parse the command arguments:
13
13
  - All arguments become the phase description
14
- - Example: `/sdd:add-phase Add authentication` → description = "Add authentication"
15
- - Example: `/sdd:add-phase Fix critical performance issues` → description = "Fix critical performance issues"
14
+ - Example: `/sdd-add-phase Add authentication` → description = "Add authentication"
15
+ - Example: `/sdd-add-phase Fix critical performance issues` → description = "Fix critical performance issues"
16
16
 
17
17
  If no arguments provided:
18
18
 
19
19
  ```
20
20
  ERROR: Phase description required
21
- Usage: /sdd:add-phase <description>
22
- Example: /sdd:add-phase Add authentication system
21
+ Usage: /sdd-add-phase <description>
22
+ Example: /sdd-add-phase Add authentication system
23
23
  ```
24
24
 
25
25
  Exit.
@@ -36,7 +36,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
36
36
  Check `roadmap_exists` from init JSON. If false:
37
37
  ```
38
38
  ERROR: No roadmap found (.planning/ROADMAP.md)
39
- Run /sdd:new-project to initialize.
39
+ Run /sdd-new-project to initialize.
40
40
  ```
41
41
  Exit.
42
42
  </step>
@@ -87,14 +87,14 @@ Roadmap updated: .planning/ROADMAP.md
87
87
 
88
88
  **Phase {N}: {description}**
89
89
 
90
- `/sdd:plan-phase {N}`
90
+ `/clear` then:
91
91
 
92
- <sub>`/clear` first → fresh context window</sub>
92
+ `/sdd-plan-phase {N}`
93
93
 
94
94
  ---
95
95
 
96
96
  **Also available:**
97
- - `/sdd:add-phase <description>` — add another phase
97
+ - `/sdd-add-phase <description>` — add another phase
98
98
  - Review roadmap
99
99
 
100
100
  ---
@@ -1,7 +1,7 @@
1
1
  <purpose>
2
2
  Generate unit and E2E tests for a completed phase based on its SUMMARY.md, CONTEXT.md, and implementation. Classifies each changed file into TDD (unit), E2E (browser), or Skip categories, presents a test plan for user approval, then generates tests following RED-GREEN conventions.
3
3
 
4
- Users currently hand-craft `/sdd:quick` prompts for test generation after each phase. This workflow standardizes the process with proper classification, quality gates, and gap reporting.
4
+ Users currently hand-craft `/sdd-quick` prompts for test generation after each phase. This workflow standardizes the process with proper classification, quality gates, and gap reporting.
5
5
  </purpose>
6
6
 
7
7
  <required_reading>
@@ -15,15 +15,15 @@ Parse `$ARGUMENTS` for:
15
15
  - Phase number (integer, decimal, or letter-suffix) → store as `$PHASE_ARG`
16
16
  - Remaining text after phase number → store as `$EXTRA_INSTRUCTIONS` (optional)
17
17
 
18
- Example: `/sdd:add-tests 12 focus on edge cases` → `$PHASE_ARG=12`, `$EXTRA_INSTRUCTIONS="focus on edge cases"`
18
+ Example: `/sdd-add-tests 12 focus on edge cases` → `$PHASE_ARG=12`, `$EXTRA_INSTRUCTIONS="focus on edge cases"`
19
19
 
20
20
  If no phase argument provided:
21
21
 
22
22
  ```
23
23
  ERROR: Phase number required
24
- Usage: /sdd:add-tests <phase> [additional instructions]
25
- Example: /sdd:add-tests 12
26
- Example: /sdd:add-tests 12 focus on edge cases in the pricing module
24
+ Usage: /sdd-add-tests <phase> [additional instructions]
25
+ Example: /sdd-add-tests 12
26
+ Example: /sdd-add-tests 12 focus on edge cases in the pricing module
27
27
  ```
28
28
 
29
29
  Exit.
@@ -54,7 +54,7 @@ Read the phase artifacts (in order of priority):
54
54
  If no SUMMARY.md exists:
55
55
  ```
56
56
  ERROR: No SUMMARY.md found for phase ${PHASE_ARG}
57
- This command works on completed phases. Run /sdd:execute-phase first.
57
+ This command works on completed phases. Run /sdd-execute-phase first.
58
58
  ```
59
59
  Exit.
60
60
 
@@ -108,6 +108,9 @@ Read each file to verify classification. Don't classify based on filename alone.
108
108
  <step name="present_classification">
109
109
  Present the classification to the user for confirmation before proceeding:
110
110
 
111
+
112
+ **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.
113
+
111
114
  ```
112
115
  AskUserQuestion(
113
116
  header: "Test Classification",
@@ -315,7 +318,7 @@ Present next steps:
315
318
  ## ▶ Next Up
316
319
 
317
320
  {if bugs discovered:}
318
- **Fix discovered bugs:** `/sdd:quick fix the {N} test failures discovered in phase ${phase_number}`
321
+ **Fix discovered bugs:** `/sdd-quick fix the {N} test failures discovered in phase ${phase_number}`
319
322
 
320
323
  {if blocked tests:}
321
324
  **Resolve test blockers:** {description of what's needed}
@@ -326,8 +329,8 @@ Present next steps:
326
329
  ---
327
330
 
328
331
  **Also available:**
329
- - `/sdd:add-tests {next_phase}` — test another phase
330
- - `/sdd:verify-work {phase_number}` — run UAT verification
332
+ - `/sdd-add-tests {next_phase}` — test another phase
333
+ - `/sdd-verify-work {phase_number}` — run UAT verification
331
334
 
332
335
  ---
333
336
  ```
@@ -20,7 +20,7 @@ Extract from init JSON: `commit_docs`, `date`, `timestamp`, `todo_count`, `todos
20
20
 
21
21
  Ensure directories exist:
22
22
  ```bash
23
- mkdir -p .planning/todos/pending .planning/todos/done
23
+ mkdir -p .planning/todos/pending .planning/todos/completed
24
24
  ```
25
25
 
26
26
  Note existing areas from the todos array for consistency in infer_area step.
@@ -28,7 +28,7 @@ Note existing areas from the todos array for consistency in infer_area step.
28
28
 
29
29
  <step name="extract_content">
30
30
  **With arguments:** Use as the title/focus.
31
- - `/sdd:add-todo Add auth token refresh` → title = "Add auth token refresh"
31
+ - `/sdd-add-todo Add auth token refresh` → title = "Add auth token refresh"
32
32
 
33
33
  **Without arguments:** Analyze recent conversation to extract:
34
34
  - The specific problem, idea, or task discussed
@@ -70,6 +70,8 @@ If potential duplicate found:
70
70
  1. Read the existing todo
71
71
  2. Compare scope
72
72
 
73
+
74
+ **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.
73
75
  If overlapping, use AskUserQuestion:
74
76
  - header: "Duplicate?"
75
77
  - question: "Similar todo exists: [title]. What would you like to do?"
@@ -141,7 +143,7 @@ Would you like to:
141
143
 
142
144
  1. Continue with current work
143
145
  2. Add another todo
144
- 3. View all todos (/sdd:check-todos)
146
+ 3. View all todos (/sdd-check-todos)
145
147
  ```
146
148
  </step>
147
149
 
@@ -0,0 +1,284 @@
1
+ <purpose>
2
+ Generate an AI design contract (AI-SPEC.md) for phases that involve building AI systems. Orchestrates sdd-framework-selector → sdd-ai-researcher → sdd-domain-researcher → sdd-eval-planner with a validation gate. Inserts between discuss-phase and plan-phase in the SDD lifecycle.
3
+
4
+ AI-SPEC.md locks four things before the planner creates tasks:
5
+ 1. Framework selection (with rationale and alternatives)
6
+ 2. Implementation guidance (correct syntax, patterns, pitfalls from official docs)
7
+ 3. Domain context (practitioner rubric ingredients, failure modes, regulatory constraints)
8
+ 4. Evaluation strategy (dimensions, rubrics, tooling, reference dataset, guardrails)
9
+
10
+ This prevents the two most common AI development failures: choosing the wrong framework for the use case, and treating evaluation as an afterthought.
11
+ </purpose>
12
+
13
+ <required_reading>
14
+ @~/.claude/sdd/references/ai-frameworks.md
15
+ @~/.claude/sdd/references/ai-evals.md
16
+ </required_reading>
17
+
18
+ <process>
19
+
20
+ ## 1. Initialize
21
+
22
+ ```bash
23
+ INIT=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" init plan-phase "$PHASE")
24
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
25
+ ```
26
+
27
+ Parse JSON for: `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_context`, `has_research`, `commit_docs`.
28
+
29
+ **File paths:** `state_path`, `roadmap_path`, `requirements_path`, `context_path`.
30
+
31
+ Resolve agent models:
32
+ ```bash
33
+ SELECTOR_MODEL=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" resolve-model sdd-framework-selector --raw)
34
+ RESEARCHER_MODEL=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" resolve-model sdd-ai-researcher --raw)
35
+ DOMAIN_MODEL=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" resolve-model sdd-domain-researcher --raw)
36
+ PLANNER_MODEL=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" resolve-model sdd-eval-planner --raw)
37
+ ```
38
+
39
+ Check config:
40
+ ```bash
41
+ AI_PHASE_ENABLED=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" config-get workflow.ai_integration_phase 2>/dev/null || echo "true")
42
+ ```
43
+
44
+ **If `AI_PHASE_ENABLED` is `false`:**
45
+ ```
46
+ AI phase is disabled in config. Enable via /sdd-settings.
47
+ ```
48
+ Exit workflow.
49
+
50
+ **If `planning_exists` is false:** Error — run `/sdd-new-project` first.
51
+
52
+ ## 2. Parse and Validate Phase
53
+
54
+ Extract phase number from $ARGUMENTS. If not provided, detect next unplanned phase.
55
+
56
+ ```bash
57
+ PHASE_INFO=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" roadmap get-phase "${PHASE}")
58
+ ```
59
+
60
+ **If `found` is false:** Error with available phases.
61
+
62
+ ## 3. Check Prerequisites
63
+
64
+ **If `has_context` is false:**
65
+ ```
66
+ No CONTEXT.md found for Phase {N}.
67
+ Recommended: run /sdd-discuss-phase {N} first to capture framework preferences.
68
+ Continuing without user decisions — framework selector will ask all questions.
69
+ ```
70
+ Continue (non-blocking).
71
+
72
+ ## 4. Check Existing AI-SPEC
73
+
74
+ ```bash
75
+ AI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-AI-SPEC.md 2>/dev/null | head -1)
76
+ ```
77
+
78
+
79
+ **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.
80
+ **If exists:** Use AskUserQuestion:
81
+ - header: "Existing AI-SPEC"
82
+ - question: "AI-SPEC.md already exists for Phase {N}. What would you like to do?"
83
+ - options:
84
+ - "Update — re-run with existing as baseline"
85
+ - "View — display current AI-SPEC and exit"
86
+ - "Skip — keep current AI-SPEC and exit"
87
+
88
+ If "View": display file contents, exit.
89
+ If "Skip": exit.
90
+ If "Update": continue to step 5.
91
+
92
+ ## 5. Spawn sdd-framework-selector
93
+
94
+ Display:
95
+ ```
96
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
97
+ SDD ► AI DESIGN CONTRACT — PHASE {N}: {name}
98
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99
+
100
+ ◆ Step 1/4 — Framework Selection...
101
+ ```
102
+
103
+ Spawn `sdd-framework-selector` with:
104
+ ```markdown
105
+ Read ~/.claude/agents/sdd-framework-selector.md for instructions.
106
+
107
+ <objective>
108
+ Select the right AI framework for Phase {phase_number}: {phase_name}
109
+ Goal: {phase_goal}
110
+ </objective>
111
+
112
+ <files_to_read>
113
+ {context_path if exists}
114
+ {requirements_path if exists}
115
+ </files_to_read>
116
+
117
+ <phase_context>
118
+ Phase: {phase_number} — {phase_name}
119
+ Goal: {phase_goal}
120
+ </phase_context>
121
+ ```
122
+
123
+ Parse selector output for: `primary_framework`, `system_type`, `model_provider`, `eval_concerns`, `alternative_framework`.
124
+
125
+ **If selector fails or returns empty:** Exit with error — "Framework selection failed. Re-run /sdd-ai-integration-phase {N} or answer the framework question in /sdd-discuss-phase {N} first."
126
+
127
+ ## 6. Initialize AI-SPEC.md
128
+
129
+ Copy template:
130
+ ```bash
131
+ cp "$HOME/.claude/sdd/templates/AI-SPEC.md" "${PHASE_DIR}/${PADDED_PHASE}-AI-SPEC.md"
132
+ ```
133
+
134
+ Fill in header fields:
135
+ - Phase number and name
136
+ - System classification (from selector)
137
+ - Selected framework (from selector)
138
+ - Alternative considered (from selector)
139
+
140
+ ## 7. Spawn sdd-ai-researcher
141
+
142
+ Display:
143
+ ```
144
+ ◆ Step 2/4 — Researching {primary_framework} docs + AI systems best practices...
145
+ ```
146
+
147
+ Spawn `sdd-ai-researcher` with:
148
+ ```markdown
149
+ Read ~/.claude/agents/sdd-ai-researcher.md for instructions.
150
+
151
+ <objective>
152
+ Research {primary_framework} for Phase {phase_number}: {phase_name}
153
+ Write Sections 3 and 4 of AI-SPEC.md
154
+ </objective>
155
+
156
+ <files_to_read>
157
+ {ai_spec_path}
158
+ {context_path if exists}
159
+ </files_to_read>
160
+
161
+ <input>
162
+ framework: {primary_framework}
163
+ system_type: {system_type}
164
+ model_provider: {model_provider}
165
+ ai_spec_path: {ai_spec_path}
166
+ phase_context: Phase {phase_number}: {phase_name} — {phase_goal}
167
+ </input>
168
+ ```
169
+
170
+ ## 8. Spawn sdd-domain-researcher
171
+
172
+ Display:
173
+ ```
174
+ ◆ Step 3/4 — Researching domain context and expert evaluation criteria...
175
+ ```
176
+
177
+ Spawn `sdd-domain-researcher` with:
178
+ ```markdown
179
+ Read ~/.claude/agents/sdd-domain-researcher.md for instructions.
180
+
181
+ <objective>
182
+ Research the business domain and expert evaluation criteria for Phase {phase_number}: {phase_name}
183
+ Write Section 1b (Domain Context) of AI-SPEC.md
184
+ </objective>
185
+
186
+ <files_to_read>
187
+ {ai_spec_path}
188
+ {context_path if exists}
189
+ {requirements_path if exists}
190
+ </files_to_read>
191
+
192
+ <input>
193
+ system_type: {system_type}
194
+ phase_name: {phase_name}
195
+ phase_goal: {phase_goal}
196
+ ai_spec_path: {ai_spec_path}
197
+ </input>
198
+ ```
199
+
200
+ ## 9. Spawn sdd-eval-planner
201
+
202
+ Display:
203
+ ```
204
+ ◆ Step 4/4 — Designing evaluation strategy from domain + technical context...
205
+ ```
206
+
207
+ Spawn `sdd-eval-planner` with:
208
+ ```markdown
209
+ Read ~/.claude/agents/sdd-eval-planner.md for instructions.
210
+
211
+ <objective>
212
+ Design evaluation strategy for Phase {phase_number}: {phase_name}
213
+ Write Sections 5, 6, and 7 of AI-SPEC.md
214
+ AI-SPEC.md now contains domain context (Section 1b) — use it as your rubric starting point.
215
+ </objective>
216
+
217
+ <files_to_read>
218
+ {ai_spec_path}
219
+ {context_path if exists}
220
+ {requirements_path if exists}
221
+ </files_to_read>
222
+
223
+ <input>
224
+ system_type: {system_type}
225
+ framework: {primary_framework}
226
+ model_provider: {model_provider}
227
+ phase_name: {phase_name}
228
+ phase_goal: {phase_goal}
229
+ ai_spec_path: {ai_spec_path}
230
+ </input>
231
+ ```
232
+
233
+ ## 10. Validate AI-SPEC Completeness
234
+
235
+ Read the completed AI-SPEC.md. Check that:
236
+ - Section 2 has a framework name (not placeholder)
237
+ - Section 1b has at least one domain rubric ingredient (Good/Bad/Stakes)
238
+ - Section 3 has a non-empty code block (entry point pattern)
239
+ - Section 4b has a Pydantic example
240
+ - Section 5 has at least one row in the dimensions table
241
+ - Section 6 has at least one guardrail or explicit "N/A for internal tool" note
242
+ - Checklist section at end has 3+ items checked
243
+
244
+ **If validation fails:** Display specific missing sections. Ask user if they want to re-run the specific step or continue anyway.
245
+
246
+ ## 11. Commit
247
+
248
+ **If `commit_docs` is true:**
249
+ ```bash
250
+ git add "${AI_SPEC_FILE}"
251
+ git commit -m "docs({phase_slug}): generate AI-SPEC.md — {primary_framework} + domain context + eval strategy"
252
+ ```
253
+
254
+ ## 12. Display Completion
255
+
256
+ ```
257
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
258
+ SDD ► AI-SPEC COMPLETE — PHASE {N}: {name}
259
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
260
+
261
+ ◆ Framework: {primary_framework}
262
+ ◆ System Type: {system_type}
263
+ ◆ Domain: {domain_vertical from Section 1b}
264
+ ◆ Eval Dimensions: {eval_concerns}
265
+ ◆ Tracing Default: Arize Phoenix (or detected existing tool)
266
+ ◆ Output: {ai_spec_path}
267
+
268
+ Next step:
269
+ /sdd-plan-phase {N} — planner will consume AI-SPEC.md
270
+ ```
271
+
272
+ </process>
273
+
274
+ <success_criteria>
275
+ - [ ] Framework selected with rationale (Section 2)
276
+ - [ ] AI-SPEC.md created from template
277
+ - [ ] Framework docs + AI best practices researched (Sections 3, 4, 4b populated)
278
+ - [ ] Domain context + expert rubric ingredients researched (Section 1b populated)
279
+ - [ ] Eval strategy grounded in domain context (Sections 5-7 populated)
280
+ - [ ] Arize Phoenix (or detected tool) set as tracing default in Section 7
281
+ - [ ] AI-SPEC.md validated (Sections 1b, 2, 3, 4b, 5, 6 all non-empty)
282
+ - [ ] Committed if commit_docs enabled
283
+ - [ ] Next step surfaced to user
284
+ </success_criteria>