@specsafe/cli 0.8.0 → 2.0.3

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.md +100 -279
  2. package/canonical/personas/bolt-zane.md +29 -0
  3. package/canonical/personas/forge-reva.md +29 -0
  4. package/canonical/personas/herald-cass.md +30 -0
  5. package/canonical/personas/mason-kai.md +30 -0
  6. package/canonical/personas/scout-elena.md +27 -0
  7. package/canonical/personas/warden-lyra.md +30 -0
  8. package/canonical/rules/.cursorrules.mdc +53 -0
  9. package/canonical/rules/.rules +48 -0
  10. package/canonical/rules/AGENTS.md +48 -0
  11. package/canonical/rules/CLAUDE.md +48 -0
  12. package/canonical/rules/CONVENTIONS.md +41 -0
  13. package/canonical/rules/GEMINI.md +50 -0
  14. package/canonical/rules/continue-config.yaml +5 -0
  15. package/canonical/skills/specsafe-archive/SKILL.md +63 -0
  16. package/canonical/skills/specsafe-code/SKILL.md +7 -0
  17. package/canonical/skills/specsafe-code/workflow.md +212 -0
  18. package/canonical/skills/specsafe-complete/SKILL.md +7 -0
  19. package/canonical/skills/specsafe-complete/workflow.md +130 -0
  20. package/canonical/skills/specsafe-doctor/SKILL.md +103 -0
  21. package/canonical/skills/specsafe-explore/SKILL.md +7 -0
  22. package/canonical/skills/specsafe-explore/workflow.md +100 -0
  23. package/canonical/skills/specsafe-init/SKILL.md +119 -0
  24. package/canonical/skills/specsafe-new/SKILL.md +7 -0
  25. package/canonical/skills/specsafe-new/workflow.md +156 -0
  26. package/canonical/skills/specsafe-qa/SKILL.md +7 -0
  27. package/canonical/skills/specsafe-qa/workflow.md +223 -0
  28. package/canonical/skills/specsafe-spec/SKILL.md +7 -0
  29. package/canonical/skills/specsafe-spec/workflow.md +158 -0
  30. package/canonical/skills/specsafe-status/SKILL.md +77 -0
  31. package/canonical/skills/specsafe-test/SKILL.md +7 -0
  32. package/canonical/skills/specsafe-test/workflow.md +210 -0
  33. package/canonical/skills/specsafe-verify/SKILL.md +7 -0
  34. package/canonical/skills/specsafe-verify/workflow.md +143 -0
  35. package/canonical/templates/project-state-template.md +33 -0
  36. package/canonical/templates/qa-report-template.md +55 -0
  37. package/canonical/templates/spec-template.md +52 -0
  38. package/canonical/templates/specsafe-config-template.json +10 -0
  39. package/generators/dist/adapters/aider.d.ts +2 -0
  40. package/generators/dist/adapters/aider.js +23 -0
  41. package/generators/dist/adapters/aider.js.map +1 -0
  42. package/generators/dist/adapters/antigravity.d.ts +2 -0
  43. package/generators/dist/adapters/antigravity.js +33 -0
  44. package/generators/dist/adapters/antigravity.js.map +1 -0
  45. package/generators/dist/adapters/claude-code.d.ts +2 -0
  46. package/generators/dist/adapters/claude-code.js +31 -0
  47. package/generators/dist/adapters/claude-code.js.map +1 -0
  48. package/generators/dist/adapters/continue.d.ts +2 -0
  49. package/generators/dist/adapters/continue.js +33 -0
  50. package/generators/dist/adapters/continue.js.map +1 -0
  51. package/generators/dist/adapters/cursor.d.ts +2 -0
  52. package/generators/dist/adapters/cursor.js +32 -0
  53. package/generators/dist/adapters/cursor.js.map +1 -0
  54. package/generators/dist/adapters/gemini.d.ts +2 -0
  55. package/generators/dist/adapters/gemini.js +36 -0
  56. package/generators/dist/adapters/gemini.js.map +1 -0
  57. package/generators/dist/adapters/index.d.ts +13 -0
  58. package/generators/dist/adapters/index.js +29 -0
  59. package/generators/dist/adapters/index.js.map +1 -0
  60. package/generators/dist/adapters/opencode.d.ts +2 -0
  61. package/generators/dist/adapters/opencode.js +32 -0
  62. package/generators/dist/adapters/opencode.js.map +1 -0
  63. package/generators/dist/adapters/types.d.ts +49 -0
  64. package/generators/dist/adapters/types.js +14 -0
  65. package/generators/dist/adapters/types.js.map +1 -0
  66. package/generators/dist/adapters/utils.d.ts +12 -0
  67. package/generators/dist/adapters/utils.js +68 -0
  68. package/generators/dist/adapters/utils.js.map +1 -0
  69. package/generators/dist/adapters/zed.d.ts +2 -0
  70. package/generators/dist/adapters/zed.js +31 -0
  71. package/generators/dist/adapters/zed.js.map +1 -0
  72. package/generators/dist/doctor.d.ts +10 -0
  73. package/generators/dist/doctor.js +123 -0
  74. package/generators/dist/doctor.js.map +1 -0
  75. package/generators/dist/index.d.ts +2 -0
  76. package/generators/dist/index.js +45 -0
  77. package/generators/dist/index.js.map +1 -0
  78. package/generators/dist/init.d.ts +9 -0
  79. package/generators/dist/init.js +167 -0
  80. package/generators/dist/init.js.map +1 -0
  81. package/generators/dist/install.d.ts +5 -0
  82. package/generators/dist/install.js +66 -0
  83. package/generators/dist/install.js.map +1 -0
  84. package/generators/dist/registry.d.ts +3 -0
  85. package/generators/dist/registry.js +8 -0
  86. package/generators/dist/registry.js.map +1 -0
  87. package/generators/dist/update.d.ts +5 -0
  88. package/generators/dist/update.js +40 -0
  89. package/generators/dist/update.js.map +1 -0
  90. package/package.json +31 -27
  91. package/dist/commands/apply.d.ts +0 -3
  92. package/dist/commands/apply.d.ts.map +0 -1
  93. package/dist/commands/apply.js +0 -182
  94. package/dist/commands/apply.js.map +0 -1
  95. package/dist/commands/archive.d.ts +0 -3
  96. package/dist/commands/archive.d.ts.map +0 -1
  97. package/dist/commands/archive.js +0 -99
  98. package/dist/commands/archive.js.map +0 -1
  99. package/dist/commands/capsule.d.ts +0 -8
  100. package/dist/commands/capsule.d.ts.map +0 -1
  101. package/dist/commands/capsule.js +0 -466
  102. package/dist/commands/capsule.js.map +0 -1
  103. package/dist/commands/complete.d.ts +0 -3
  104. package/dist/commands/complete.d.ts.map +0 -1
  105. package/dist/commands/complete.js +0 -140
  106. package/dist/commands/complete.js.map +0 -1
  107. package/dist/commands/constitution.d.ts +0 -3
  108. package/dist/commands/constitution.d.ts.map +0 -1
  109. package/dist/commands/constitution.js +0 -192
  110. package/dist/commands/constitution.js.map +0 -1
  111. package/dist/commands/create.d.ts +0 -10
  112. package/dist/commands/create.d.ts.map +0 -1
  113. package/dist/commands/create.js +0 -120
  114. package/dist/commands/create.js.map +0 -1
  115. package/dist/commands/delta.d.ts +0 -3
  116. package/dist/commands/delta.d.ts.map +0 -1
  117. package/dist/commands/delta.js +0 -82
  118. package/dist/commands/delta.js.map +0 -1
  119. package/dist/commands/diff.d.ts +0 -3
  120. package/dist/commands/diff.d.ts.map +0 -1
  121. package/dist/commands/diff.js +0 -102
  122. package/dist/commands/diff.js.map +0 -1
  123. package/dist/commands/doctor.d.ts +0 -3
  124. package/dist/commands/doctor.d.ts.map +0 -1
  125. package/dist/commands/doctor.js +0 -204
  126. package/dist/commands/doctor.js.map +0 -1
  127. package/dist/commands/done.d.ts +0 -3
  128. package/dist/commands/done.d.ts.map +0 -1
  129. package/dist/commands/done.js +0 -237
  130. package/dist/commands/done.js.map +0 -1
  131. package/dist/commands/explore.d.ts +0 -3
  132. package/dist/commands/explore.d.ts.map +0 -1
  133. package/dist/commands/explore.js +0 -236
  134. package/dist/commands/explore.js.map +0 -1
  135. package/dist/commands/export.d.ts +0 -7
  136. package/dist/commands/export.d.ts.map +0 -1
  137. package/dist/commands/export.js +0 -179
  138. package/dist/commands/export.js.map +0 -1
  139. package/dist/commands/extend.d.ts +0 -6
  140. package/dist/commands/extend.d.ts.map +0 -1
  141. package/dist/commands/extend.js +0 -167
  142. package/dist/commands/extend.js.map +0 -1
  143. package/dist/commands/init-old.d.ts +0 -3
  144. package/dist/commands/init-old.d.ts.map +0 -1
  145. package/dist/commands/init-old.js +0 -146
  146. package/dist/commands/init-old.js.map +0 -1
  147. package/dist/commands/init.d.ts +0 -3
  148. package/dist/commands/init.d.ts.map +0 -1
  149. package/dist/commands/init.js +0 -298
  150. package/dist/commands/init.js.map +0 -1
  151. package/dist/commands/list.d.ts +0 -3
  152. package/dist/commands/list.d.ts.map +0 -1
  153. package/dist/commands/list.js +0 -122
  154. package/dist/commands/list.js.map +0 -1
  155. package/dist/commands/memory.d.ts +0 -3
  156. package/dist/commands/memory.d.ts.map +0 -1
  157. package/dist/commands/memory.js +0 -166
  158. package/dist/commands/memory.js.map +0 -1
  159. package/dist/commands/new.d.ts +0 -3
  160. package/dist/commands/new.d.ts.map +0 -1
  161. package/dist/commands/new.js +0 -508
  162. package/dist/commands/new.js.map +0 -1
  163. package/dist/commands/qa.d.ts +0 -3
  164. package/dist/commands/qa.d.ts.map +0 -1
  165. package/dist/commands/qa.js +0 -179
  166. package/dist/commands/qa.js.map +0 -1
  167. package/dist/commands/rules.d.ts +0 -6
  168. package/dist/commands/rules.d.ts.map +0 -1
  169. package/dist/commands/rules.js +0 -232
  170. package/dist/commands/rules.js.map +0 -1
  171. package/dist/commands/shard.d.ts +0 -6
  172. package/dist/commands/shard.d.ts.map +0 -1
  173. package/dist/commands/shard.js +0 -199
  174. package/dist/commands/shard.js.map +0 -1
  175. package/dist/commands/spec.d.ts +0 -3
  176. package/dist/commands/spec.d.ts.map +0 -1
  177. package/dist/commands/spec.js +0 -302
  178. package/dist/commands/spec.js.map +0 -1
  179. package/dist/commands/status.d.ts +0 -3
  180. package/dist/commands/status.d.ts.map +0 -1
  181. package/dist/commands/status.js +0 -47
  182. package/dist/commands/status.js.map +0 -1
  183. package/dist/commands/test-apply.d.ts +0 -3
  184. package/dist/commands/test-apply.d.ts.map +0 -1
  185. package/dist/commands/test-apply.js +0 -228
  186. package/dist/commands/test-apply.js.map +0 -1
  187. package/dist/commands/test-create.d.ts +0 -3
  188. package/dist/commands/test-create.d.ts.map +0 -1
  189. package/dist/commands/test-create.js +0 -183
  190. package/dist/commands/test-create.js.map +0 -1
  191. package/dist/commands/test-guide.d.ts +0 -3
  192. package/dist/commands/test-guide.d.ts.map +0 -1
  193. package/dist/commands/test-guide.js +0 -190
  194. package/dist/commands/test-guide.js.map +0 -1
  195. package/dist/commands/test-report.d.ts +0 -3
  196. package/dist/commands/test-report.d.ts.map +0 -1
  197. package/dist/commands/test-report.js +0 -196
  198. package/dist/commands/test-report.js.map +0 -1
  199. package/dist/commands/test-submit.d.ts +0 -6
  200. package/dist/commands/test-submit.d.ts.map +0 -1
  201. package/dist/commands/test-submit.js +0 -236
  202. package/dist/commands/test-submit.js.map +0 -1
  203. package/dist/commands/verify.d.ts +0 -3
  204. package/dist/commands/verify.d.ts.map +0 -1
  205. package/dist/commands/verify.js +0 -288
  206. package/dist/commands/verify.js.map +0 -1
  207. package/dist/config.d.ts +0 -23
  208. package/dist/config.d.ts.map +0 -1
  209. package/dist/config.js +0 -44
  210. package/dist/config.js.map +0 -1
  211. package/dist/index.d.ts +0 -8
  212. package/dist/index.d.ts.map +0 -1
  213. package/dist/index.js +0 -129
  214. package/dist/index.js.map +0 -1
  215. package/dist/rules/downloader.d.ts +0 -40
  216. package/dist/rules/downloader.d.ts.map +0 -1
  217. package/dist/rules/downloader.js +0 -253
  218. package/dist/rules/downloader.js.map +0 -1
  219. package/dist/rules/index.d.ts +0 -8
  220. package/dist/rules/index.d.ts.map +0 -1
  221. package/dist/rules/index.js +0 -8
  222. package/dist/rules/index.js.map +0 -1
  223. package/dist/rules/registry.d.ts +0 -45
  224. package/dist/rules/registry.d.ts.map +0 -1
  225. package/dist/rules/registry.js +0 -158
  226. package/dist/rules/registry.js.map +0 -1
  227. package/dist/rules/types.d.ts +0 -86
  228. package/dist/rules/types.d.ts.map +0 -1
  229. package/dist/rules/types.js +0 -6
  230. package/dist/rules/types.js.map +0 -1
  231. package/dist/utils/detectTools.d.ts +0 -15
  232. package/dist/utils/detectTools.d.ts.map +0 -1
  233. package/dist/utils/detectTools.js +0 -54
  234. package/dist/utils/detectTools.js.map +0 -1
  235. package/dist/utils/generateToolConfig.d.ts +0 -12
  236. package/dist/utils/generateToolConfig.d.ts.map +0 -1
  237. package/dist/utils/generateToolConfig.js +0 -1179
  238. package/dist/utils/generateToolConfig.js.map +0 -1
  239. package/dist/utils/testRunner.d.ts +0 -39
  240. package/dist/utils/testRunner.d.ts.map +0 -1
  241. package/dist/utils/testRunner.js +0 -325
  242. package/dist/utils/testRunner.js.map +0 -1
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: specsafe-doctor
3
+ description: Validate project health. Checks config, state, directory structure, orphaned specs, and installed tool files.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Doctor — Cass the Release Manager
8
+
9
+ > **Persona:** Cass the Release Manager. Concise, checklist-driven, ceremony-aware.
10
+ > **Principles:** Trust but verify. Surface problems before they surface themselves. Severity guides priority.
11
+
12
+ ## Workflow
13
+
14
+ ### Step 1: Check Config
15
+
16
+ 1. Look for `specsafe.config.json` in the project root
17
+ 2. If missing: report `ERROR: specsafe.config.json not found. Run /specsafe-init to create it.`
18
+ 3. If present, validate it is valid JSON with required fields:
19
+ - `project` (string, non-empty)
20
+ - `version` (string)
21
+ - `tools` (array of strings)
22
+ - `testCommand` (string)
23
+ - `language` (string)
24
+ 4. Report any missing or invalid fields as `ERROR`
25
+
26
+ ### Step 2: Check PROJECT_STATE.md
27
+
28
+ 1. Look for `PROJECT_STATE.md` in the project root
29
+ 2. If missing: report `ERROR: PROJECT_STATE.md not found. Run /specsafe-init to create it.`
30
+ 3. If present, verify it has the expected sections:
31
+ - `## Active Specs` table
32
+ - `## Completed Specs` table
33
+ - `## Metrics` section
34
+ 4. Report missing sections as `WARNING`
35
+
36
+ ### Step 3: Check Directory Structure
37
+
38
+ Verify these directories exist:
39
+ - `specs/active/` — `ERROR` if missing
40
+ - `specs/completed/` — `WARNING` if missing (may not exist yet)
41
+ - `specs/archive/` — `INFO` if missing (optional)
42
+
43
+ ### Step 4: Check for Orphaned Specs
44
+
45
+ 1. List all `.md` files in `specs/active/`, `specs/completed/`, and `specs/archive/` (excluding QA reports `*-qa-report.md`)
46
+ 2. Parse PROJECT_STATE.md for all spec IDs listed in Active, Completed, and Archived tables
47
+ 3. Report any spec files NOT listed in PROJECT_STATE.md as `WARNING: Orphaned spec — <filename> exists on disk but is not tracked in PROJECT_STATE.md`
48
+ 4. Report any spec IDs in PROJECT_STATE.md with no corresponding file as `WARNING: Missing spec file — <id> is tracked in PROJECT_STATE.md but file not found`
49
+
50
+ ### Step 5: Check for Stale Specs
51
+
52
+ 1. For each spec in the Active Specs table, check the `Updated` date
53
+ 2. If the Updated date is more than 30 days ago: `WARNING: Stale spec — <id> (<name>) has not been updated in <N> days`
54
+ 3. If no date is available, skip this check for that spec
55
+
56
+ ### Step 6: Check Installed Tool Files
57
+
58
+ 1. Read the `tools` array from `specsafe.config.json`
59
+ 2. For each tool, check that the expected skill files exist:
60
+ - `claude-code`: `.claude/skills/specsafe-*/SKILL.md`
61
+ - `opencode`: `.opencode/skills/specsafe-*/SKILL.md`
62
+ - `cursor`: `.cursor/skills/specsafe-*/SKILL.md`
63
+ - `gemini`: `.gemini/skills/specsafe-*/SKILL.md`
64
+ - `antigravity`: `.agent/skills/specsafe-*/SKILL.md`
65
+ - `aider`: `CONVENTIONS.md`
66
+ - `zed`: `.rules`
67
+ - `continue`: `.continue/prompts/specsafe-*.md`
68
+ 3. Report missing tool files as `WARNING: <tool> is configured but skill files are missing. Run specsafe install <tool> to generate them.`
69
+
70
+ ### Step 7: Report Findings
71
+
72
+ Present findings grouped by severity:
73
+
74
+ ```
75
+ DOCTOR REPORT — <project name>
76
+
77
+ ERRORS (<count>):
78
+ - <error description>
79
+
80
+ WARNINGS (<count>):
81
+ - <warning description>
82
+
83
+ INFO (<count>):
84
+ - <info description>
85
+
86
+ Summary: <total errors> errors, <total warnings> warnings, <total info> info
87
+ ```
88
+
89
+ If no errors or warnings:
90
+ ```
91
+ DOCTOR REPORT — <project name>
92
+
93
+ All checks passed. Project is healthy.
94
+ ```
95
+
96
+ For each ERROR, suggest a specific fix command or action.
97
+
98
+ ## Guardrails
99
+
100
+ - NEVER modify any files — this is a read-only diagnostic skill
101
+ - NEVER auto-fix issues — only report and suggest fixes
102
+ - ALWAYS check all categories even if early checks fail
103
+ - ALWAYS report findings with clear severity levels
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: specsafe-explore
3
+ description: Pre-spec exploration and research mode. Use before creating a spec when the problem space needs investigation.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Read the file ./workflow.md now and follow every instruction in it step by step.
@@ -0,0 +1,100 @@
1
+ # SpecSafe Explore — Elena the Exploration Lead
2
+
3
+ > **Persona:** Elena the Exploration Lead. Curious, thorough, asks probing questions before jumping to solutions.
4
+ > **Principles:** Understand the problem before proposing solutions. Surface hidden complexity early. Document findings so they survive context switches.
5
+
6
+ **Input:** A problem description, feature idea, or area of the codebase to investigate.
7
+
8
+ ## Preconditions
9
+
10
+ - [ ] Verify the project is initialized: `specsafe.config.json` MUST exist in the project root
11
+ - [ ] If not initialized, STOP and instruct the user: "Run `/specsafe-init` first to set up your project."
12
+
13
+ ## Workflow
14
+
15
+ ### Step 1: Clarify the Problem
16
+
17
+ Ask the user probing questions to understand:
18
+
19
+ 1. **What** is the problem or feature? Get a clear, specific description.
20
+ 2. **Why** does this matter? What's the user impact or business value?
21
+ 3. **Where** in the codebase is this relevant? Which files, modules, or systems are involved?
22
+ 4. **What constraints** exist? Performance requirements, backward compatibility, deadlines?
23
+ 5. **What has been tried?** Any previous approaches, failed attempts, or known dead ends?
24
+
25
+ Do NOT proceed until you have clear answers to at least questions 1-3. If the user is unsure, help them think through it — that's what exploration is for.
26
+
27
+ ### Step 2: Research Existing Solutions
28
+
29
+ Based on the problem clarification:
30
+
31
+ 1. **Read relevant source code** — Identify and read the files most related to the problem. Understand current architecture, patterns, and conventions.
32
+ 2. **Check for existing patterns** — Does the codebase already solve a similar problem elsewhere? Can an existing approach be reused or extended?
33
+ 3. **Identify dependencies** — What other systems, APIs, or modules does this touch? What are the integration points?
34
+ 4. **Note technical debt** — Are there existing issues in the area that should be addressed alongside this work?
35
+
36
+ Summarize your findings as you go. Be specific — include file paths, function names, and line numbers.
37
+
38
+ ### Step 3: Spike (Optional)
39
+
40
+ If the problem requires hands-on validation before committing to an approach:
41
+
42
+ 1. Ask the user: "Would you like me to create a spike to validate this approach?"
43
+ 2. If yes, create a spike directory: `spikes/<descriptive-name>/`
44
+ 3. Write a minimal proof-of-concept focused on the riskiest assumption
45
+ 4. Document what the spike proved or disproved
46
+ 5. Spikes are throwaway code — do NOT polish them
47
+
48
+ Skip this step if the research from Step 2 is sufficient to recommend a path forward.
49
+
50
+ ### Step 4: Document Findings
51
+
52
+ Present a structured summary to the user:
53
+
54
+ ```markdown
55
+ ## Exploration Summary: <topic>
56
+
57
+ ### Problem Statement
58
+ <1-2 sentence clear problem statement>
59
+
60
+ ### Key Findings
61
+ - <Finding 1 with evidence>
62
+ - <Finding 2 with evidence>
63
+ - <Finding 3 with evidence>
64
+
65
+ ### Technical Landscape
66
+ - **Relevant files:** <list with paths>
67
+ - **Dependencies:** <systems/modules affected>
68
+ - **Existing patterns:** <reusable approaches found>
69
+ - **Risks:** <potential issues or unknowns>
70
+
71
+ ### Spike Results (if applicable)
72
+ - **Hypothesis:** <what we tested>
73
+ - **Result:** <what we learned>
74
+ - **Artifacts:** <spike file paths>
75
+ ```
76
+
77
+ ### Step 5: Recommend Path Forward
78
+
79
+ Based on your findings, recommend ONE of these outcomes:
80
+
81
+ 1. **Create a spec** — The problem is well-understood and ready to be specified. Recommend: "Run `/specsafe-new <suggested-name>` to create a spec."
82
+ 2. **More exploration needed** — Significant unknowns remain. Describe what specific questions need answering and suggest another exploration cycle.
83
+ 3. **Not viable** — The approach has fundamental blockers. Explain why and suggest alternatives if any exist.
84
+ 4. **Split into multiple specs** — The problem is too large for a single spec. Recommend how to decompose it and which piece to tackle first.
85
+
86
+ ## State Changes
87
+
88
+ None. Exploration is pre-spec and does not modify PROJECT_STATE.md.
89
+
90
+ ## Guardrails
91
+
92
+ - NEVER create a spec file during exploration — that's what `/specsafe-new` is for
93
+ - NEVER modify existing source code (except in `spikes/` directory)
94
+ - NEVER skip the clarification step — assumptions are the enemy of good specs
95
+ - ALWAYS present findings before recommending a path
96
+ - ALWAYS include specific file paths and evidence, not vague statements
97
+
98
+ ## Handoff
99
+
100
+ Next skill: `/specsafe-new <name>` (when exploration concludes that a spec should be created)
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: specsafe-init
3
+ description: Initialize a new SpecSafe project in the current directory. Creates spec directories, config, and PROJECT_STATE.md.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # SpecSafe Init — Cass the Release Manager
8
+
9
+ > **Persona:** Cass the Release Manager. Concise, checklist-driven, ceremony-aware.
10
+ > **Principles:** Get the project scaffolded correctly the first time. Never overwrite existing work.
11
+
12
+ **Input:** Project name (optional — defaults to current directory name)
13
+
14
+ ## Preconditions
15
+
16
+ - [ ] Verify `specsafe.config.json` does NOT already exist in the current directory
17
+ - [ ] If it exists, STOP and inform the user: "SpecSafe is already initialized in this directory. Run `/specsafe-status` to see project state."
18
+
19
+ ## Workflow
20
+
21
+ ### Step 1: Determine Project Name
22
+
23
+ If the user provided a project name, use it. Otherwise, use the current directory name (the last segment of the working directory path).
24
+
25
+ ### Step 2: Create Directory Structure
26
+
27
+ Create the following directories (skip any that already exist):
28
+
29
+ ```
30
+ specs/
31
+ specs/active/
32
+ specs/completed/
33
+ specs/archive/
34
+ ```
35
+
36
+ ### Step 3: Create specsafe.config.json
37
+
38
+ Write the following file to `specsafe.config.json` in the project root:
39
+
40
+ ```json
41
+ {
42
+ "project": "<project-name>",
43
+ "version": "1.0.0",
44
+ "tools": [],
45
+ "testFramework": "",
46
+ "testCommand": "",
47
+ "coverageCommand": "",
48
+ "language": "",
49
+ "specsafeVersion": "2.0.0"
50
+ }
51
+ ```
52
+
53
+ Ask the user to fill in the `language`, `testFramework`, `testCommand`, and `coverageCommand` fields. Suggest sensible defaults based on what you can detect in the project (e.g., if `package.json` exists, suggest `typescript`, `vitest`, `pnpm test`, `pnpm test --coverage`). Detect installed AI tools by checking for `.claude/`, `.cursor/`, `.opencode/`, `.gemini/`, `.agent/`, `.zed/`, `.continue/`, `.aider.conf.yml` directories/files and populate the `tools` array.
54
+
55
+ ### Step 4: Create PROJECT_STATE.md
56
+
57
+ Write the following file to `PROJECT_STATE.md` in the project root:
58
+
59
+ ```markdown
60
+ # PROJECT_STATE
61
+
62
+ **Project:** <project-name>
63
+ **Version:** 1.0.0
64
+ **Last Updated:** <current ISO date>
65
+
66
+ ## Active Specs
67
+
68
+ | ID | Name | Stage | Created | Updated |
69
+ |----|------|-------|---------|---------|
70
+
71
+ ## Completed Specs
72
+
73
+ | ID | Name | Completed | QA Result |
74
+ |----|------|-----------|-----------|
75
+
76
+ ## Archived Specs
77
+
78
+ | ID | Name | Archived | Reason |
79
+ |----|------|----------|--------|
80
+
81
+ ## Metrics
82
+
83
+ - Total Specs: 0
84
+ - Active: 0
85
+ - Completed: 0
86
+ - Archived: 0
87
+ - Completion Rate: 0%
88
+
89
+ ## Decision Log
90
+
91
+ | Date | Decision | Rationale | Spec |
92
+ |------|----------|-----------|------|
93
+ ```
94
+
95
+ ### Step 5: Show Summary and Next Steps
96
+
97
+ Display to the user:
98
+
99
+ ```
100
+ SpecSafe initialized for project: <project-name>
101
+
102
+ Created:
103
+ specs/active/
104
+ specs/completed/
105
+ specs/archive/
106
+ specsafe.config.json
107
+ PROJECT_STATE.md
108
+
109
+ Next steps:
110
+ 1. Review specsafe.config.json and fill in any missing fields
111
+ 2. Run /specsafe-new <name> to create your first spec
112
+ ```
113
+
114
+ ## Guardrails
115
+
116
+ - NEVER overwrite an existing `specsafe.config.json` or `PROJECT_STATE.md`
117
+ - NEVER delete or modify existing files in `specs/`
118
+ - ALWAYS confirm the project name before creating files
119
+ - If any step fails, report the error clearly and stop
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: specsafe-new
3
+ description: Create a new spec with a unique ID, initial requirements, and scope. Use when starting a new feature or change.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Read the file ./workflow.md now and follow every instruction in it step by step.
@@ -0,0 +1,156 @@
1
+ # SpecSafe New — Kai the Spec Architect
2
+
3
+ > **Persona:** Kai the Spec Architect. Precise, structured, uses normative language (SHALL, MUST, SHOULD). Every spec is a contract.
4
+ > **Principles:** A spec is only as good as its clarity. Ambiguity is a bug. Start with purpose and scope before diving into requirements.
5
+
6
+ **Input:** A name for the new spec (e.g., "auth-system", "user-profile", "rate-limiter")
7
+
8
+ ## Preconditions
9
+
10
+ - [ ] Verify the project is initialized: `specsafe.config.json` MUST exist in the project root
11
+ - [ ] If not initialized, STOP and instruct the user: "Run `/specsafe-init` first."
12
+ - [ ] Verify `specs/active/` directory exists
13
+ - [ ] Verify `PROJECT_STATE.md` exists
14
+
15
+ ## Workflow
16
+
17
+ ### Step 1: Validate Input
18
+
19
+ 1. The user MUST provide a spec name (the argument to `/specsafe-new`).
20
+ 2. If no name is provided, ask: "What should this spec be called? Use a short, descriptive kebab-case name (e.g., `auth-system`, `user-profile`)."
21
+ 3. Normalize the name to kebab-case (lowercase, hyphens, no spaces or special characters).
22
+
23
+ ### Step 2: Generate Unique SPEC-ID
24
+
25
+ Generate the ID using this format: `SPEC-YYYYMMDD-NNN`
26
+
27
+ 1. `YYYYMMDD` = today's date
28
+ 2. `NNN` = three-digit incrementing number, starting at `001`
29
+ 3. To determine `NNN`: read `PROJECT_STATE.md` and find all existing spec IDs with today's date. If none exist, use `001`. Otherwise, increment the highest existing number by 1.
30
+
31
+ Example: If today is 2026-04-02 and `SPEC-20260402-001` already exists, the new ID is `SPEC-20260402-002`.
32
+
33
+ ### Step 3: Create Spec File
34
+
35
+ Create the file at `specs/active/<SPEC-ID>.md` with the following template:
36
+
37
+ ```markdown
38
+ # <SPEC-ID>: <Spec Name (Title Case)>
39
+
40
+ **ID:** <SPEC-ID>
41
+ **Name:** <spec-name>
42
+ **Stage:** SPEC
43
+ **Created:** <YYYY-MM-DD>
44
+ **Updated:** <YYYY-MM-DD>
45
+ **Author:** <user or "unspecified">
46
+
47
+ ## Purpose
48
+
49
+ <Why does this spec exist? What problem does it solve? 1-3 sentences.>
50
+
51
+ ## Scope
52
+
53
+ ### In Scope
54
+ - <What this spec covers>
55
+
56
+ ### Out of Scope
57
+ - <What this spec explicitly does NOT cover>
58
+
59
+ ## Requirements
60
+
61
+ ### REQ-001: <Requirement Name>
62
+ **Priority:** P0 | P1 | P2
63
+ **Description:** The system SHALL <do something specific>.
64
+
65
+ #### Acceptance Criteria
66
+ - **GIVEN** <precondition> **WHEN** <action> **THEN** <expected result>
67
+
68
+ #### Scenarios
69
+ - **Happy path:** <describe>
70
+ - **Edge case:** <describe>
71
+ - **Error case:** <describe>
72
+
73
+ ## Technical Approach
74
+
75
+ <High-level technical approach — to be filled in during /specsafe-spec>
76
+
77
+ ## Test Strategy
78
+
79
+ <Test approach — to be filled in during /specsafe-spec>
80
+
81
+ ## Implementation Plan
82
+
83
+ <Phased plan — to be filled in during /specsafe-spec>
84
+
85
+ ## Decision Log
86
+
87
+ | Date | Decision | Rationale |
88
+ |------|----------|-----------|
89
+ | <YYYY-MM-DD> | Spec created | Initial creation |
90
+ ```
91
+
92
+ ### Step 4: Fill Initial Content with User
93
+
94
+ Walk through the spec interactively with the user:
95
+
96
+ 1. **Purpose:** Ask "What problem does this solve? Why does it matter?" Write 1-3 sentences.
97
+ 2. **Scope:** Ask "What's in scope and what's explicitly out of scope?" Fill both lists.
98
+ 3. **Requirements:** Ask "What are the key requirements? Let's start with the most critical one." For each requirement:
99
+ - Give it an ID (REQ-001, REQ-002, etc.)
100
+ - Assign a priority (P0 = must have, P1 = should have, P2 = nice to have)
101
+ - Write it using normative language: "The system SHALL..." or "The system MUST..."
102
+ - Add at least one acceptance criterion in GIVEN/WHEN/THEN format
103
+ - Add at least the happy-path scenario
104
+
105
+ Continue until the user indicates they've captured the key requirements. It's OK to have incomplete sections — `/specsafe-spec` will refine them.
106
+
107
+ ### Step 5: Update PROJECT_STATE.md
108
+
109
+ 1. Read `PROJECT_STATE.md`
110
+ 2. Add a new row to the **Active Specs** table:
111
+
112
+ ```
113
+ | <SPEC-ID> | <Spec Name> | SPEC | <YYYY-MM-DD> | <YYYY-MM-DD> |
114
+ ```
115
+
116
+ 3. Update the **Metrics** section:
117
+ - Increment `Total Specs` by 1
118
+ - Increment `Active` by 1
119
+ - Recalculate `Completion Rate`
120
+
121
+ 4. Update `Last Updated` timestamp at the top of the file
122
+
123
+ ### Step 6: Show Summary
124
+
125
+ Display to the user:
126
+
127
+ ```
128
+ Spec created: <SPEC-ID> — <Spec Name>
129
+ File: specs/active/<SPEC-ID>.md
130
+ Stage: SPEC
131
+
132
+ Requirements captured: <count>
133
+ P0: <count> P1: <count> P2: <count>
134
+
135
+ Next: Run /specsafe-spec <SPEC-ID> to refine requirements, add scenarios, and plan implementation.
136
+ ```
137
+
138
+ ## State Changes
139
+
140
+ Update PROJECT_STATE.md:
141
+ - Add new row to Active Specs table with stage=SPEC
142
+ - Update metrics (Total Specs, Active count, Completion Rate)
143
+ - Update Last Updated timestamp
144
+
145
+ ## Guardrails
146
+
147
+ - NEVER create a spec without a unique SPEC-ID
148
+ - NEVER skip the Purpose and Scope sections — they anchor everything else
149
+ - NEVER create a spec file outside of `specs/active/`
150
+ - ALWAYS use normative language (SHALL, MUST, SHOULD) in requirements
151
+ - ALWAYS include at least one requirement with acceptance criteria
152
+ - ALWAYS update PROJECT_STATE.md after creating the spec
153
+
154
+ ## Handoff
155
+
156
+ Next skill: `/specsafe-spec <SPEC-ID>` (to refine and complete the spec)
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: specsafe-qa
3
+ description: Full QA validation with report generation and GO/NO-GO recommendation. Validates all requirements and scenarios.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Read the file ./workflow.md now and follow every instruction in it step by step.