specweave 0.6.8 → 0.7.1

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 (255) hide show
  1. package/.claude-plugin/README.md +1 -1
  2. package/CLAUDE.md +903 -99
  3. package/README.md +143 -207
  4. package/bin/specweave.js +67 -0
  5. package/dist/cli/commands/abandon.d.ts +13 -0
  6. package/dist/cli/commands/abandon.d.ts.map +1 -0
  7. package/dist/cli/commands/abandon.js +15 -0
  8. package/dist/cli/commands/abandon.js.map +1 -0
  9. package/dist/cli/commands/init.d.ts.map +1 -1
  10. package/dist/cli/commands/init.js +94 -18
  11. package/dist/cli/commands/init.js.map +1 -1
  12. package/dist/cli/commands/pause.d.ts +13 -0
  13. package/dist/cli/commands/pause.d.ts.map +1 -0
  14. package/dist/cli/commands/pause.js +15 -0
  15. package/dist/cli/commands/pause.js.map +1 -0
  16. package/dist/cli/commands/qa.d.ts +54 -0
  17. package/dist/cli/commands/qa.d.ts.map +1 -0
  18. package/dist/cli/commands/qa.js +98 -0
  19. package/dist/cli/commands/qa.js.map +1 -0
  20. package/dist/cli/commands/resume.d.ts +12 -0
  21. package/dist/cli/commands/resume.d.ts.map +1 -0
  22. package/dist/cli/commands/resume.js +14 -0
  23. package/dist/cli/commands/resume.js.map +1 -0
  24. package/dist/cli/commands/status.d.ts +12 -0
  25. package/dist/cli/commands/status.d.ts.map +1 -0
  26. package/dist/cli/commands/status.js +23 -0
  27. package/dist/cli/commands/status.js.map +1 -0
  28. package/dist/cli/helpers/issue-tracker/ado.d.ts +57 -0
  29. package/dist/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
  30. package/dist/cli/helpers/issue-tracker/ado.js +223 -0
  31. package/dist/cli/helpers/issue-tracker/ado.js.map +1 -0
  32. package/dist/cli/helpers/issue-tracker/github.d.ts +65 -0
  33. package/dist/cli/helpers/issue-tracker/github.d.ts.map +1 -0
  34. package/dist/cli/helpers/issue-tracker/github.js +284 -0
  35. package/dist/cli/helpers/issue-tracker/github.js.map +1 -0
  36. package/dist/cli/helpers/issue-tracker/index.d.ts +22 -0
  37. package/dist/cli/helpers/issue-tracker/index.d.ts.map +1 -0
  38. package/dist/cli/helpers/issue-tracker/index.js +270 -0
  39. package/dist/cli/helpers/issue-tracker/index.js.map +1 -0
  40. package/dist/cli/helpers/issue-tracker/jira.d.ts +61 -0
  41. package/dist/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
  42. package/dist/cli/helpers/issue-tracker/jira.js +265 -0
  43. package/dist/cli/helpers/issue-tracker/jira.js.map +1 -0
  44. package/dist/cli/helpers/issue-tracker/types.d.ts +86 -0
  45. package/dist/cli/helpers/issue-tracker/types.d.ts.map +1 -0
  46. package/dist/cli/helpers/issue-tracker/types.js +16 -0
  47. package/dist/cli/helpers/issue-tracker/types.js.map +1 -0
  48. package/dist/cli/helpers/issue-tracker/utils.d.ts +103 -0
  49. package/dist/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
  50. package/dist/cli/helpers/issue-tracker/utils.js +240 -0
  51. package/dist/cli/helpers/issue-tracker/utils.js.map +1 -0
  52. package/dist/core/increment/limits.d.ts +68 -0
  53. package/dist/core/increment/limits.d.ts.map +1 -0
  54. package/dist/core/increment/limits.js +224 -0
  55. package/dist/core/increment/limits.js.map +1 -0
  56. package/dist/core/increment/metadata-manager.d.ts +114 -0
  57. package/dist/core/increment/metadata-manager.d.ts.map +1 -0
  58. package/dist/core/increment/metadata-manager.js +320 -0
  59. package/dist/core/increment/metadata-manager.js.map +1 -0
  60. package/dist/core/increment/status-commands.d.ts +43 -0
  61. package/dist/core/increment/status-commands.d.ts.map +1 -0
  62. package/dist/core/increment/status-commands.js +277 -0
  63. package/dist/core/increment/status-commands.js.map +1 -0
  64. package/dist/core/plugin-detector.d.ts +1 -0
  65. package/dist/core/plugin-detector.d.ts.map +1 -1
  66. package/dist/core/plugin-detector.js +25 -0
  67. package/dist/core/plugin-detector.js.map +1 -1
  68. package/dist/core/qa/qa-runner.d.ts +16 -0
  69. package/dist/core/qa/qa-runner.d.ts.map +1 -0
  70. package/dist/core/qa/qa-runner.js +404 -0
  71. package/dist/core/qa/qa-runner.js.map +1 -0
  72. package/dist/core/qa/quality-gate-decider.d.ts +53 -0
  73. package/dist/core/qa/quality-gate-decider.d.ts.map +1 -0
  74. package/dist/core/qa/quality-gate-decider.js +268 -0
  75. package/dist/core/qa/quality-gate-decider.js.map +1 -0
  76. package/dist/core/qa/risk-calculator.d.ts +126 -0
  77. package/dist/core/qa/risk-calculator.d.ts.map +1 -0
  78. package/dist/core/qa/risk-calculator.js +247 -0
  79. package/dist/core/qa/risk-calculator.js.map +1 -0
  80. package/dist/core/qa/types.d.ts +315 -0
  81. package/dist/core/qa/types.d.ts.map +1 -0
  82. package/dist/core/qa/types.js +8 -0
  83. package/dist/core/qa/types.js.map +1 -0
  84. package/dist/core/types/config.d.ts +35 -0
  85. package/dist/core/types/config.d.ts.map +1 -1
  86. package/dist/core/types/config.js +16 -0
  87. package/dist/core/types/config.js.map +1 -1
  88. package/dist/core/types/increment-metadata.d.ts +120 -0
  89. package/dist/core/types/increment-metadata.d.ts.map +1 -0
  90. package/dist/core/types/increment-metadata.js +138 -0
  91. package/dist/core/types/increment-metadata.js.map +1 -0
  92. package/dist/hooks/lib/invoke-translator-skill.d.ts +60 -0
  93. package/dist/hooks/lib/invoke-translator-skill.d.ts.map +1 -0
  94. package/dist/hooks/lib/invoke-translator-skill.js +201 -0
  95. package/dist/hooks/lib/invoke-translator-skill.js.map +1 -0
  96. package/dist/hooks/lib/translate-file.d.ts +59 -0
  97. package/dist/hooks/lib/translate-file.d.ts.map +1 -0
  98. package/dist/hooks/lib/translate-file.js +350 -0
  99. package/dist/hooks/lib/translate-file.js.map +1 -0
  100. package/dist/locales/en/cli.json +3 -1
  101. package/dist/metrics/calculators/change-failure-rate.d.ts +22 -0
  102. package/dist/metrics/calculators/change-failure-rate.d.ts.map +1 -0
  103. package/dist/metrics/calculators/change-failure-rate.js +70 -0
  104. package/dist/metrics/calculators/change-failure-rate.js.map +1 -0
  105. package/dist/metrics/calculators/deployment-frequency.d.ts +20 -0
  106. package/dist/metrics/calculators/deployment-frequency.d.ts.map +1 -0
  107. package/dist/metrics/calculators/deployment-frequency.js +61 -0
  108. package/dist/metrics/calculators/deployment-frequency.js.map +1 -0
  109. package/dist/metrics/calculators/lead-time.d.ts +22 -0
  110. package/dist/metrics/calculators/lead-time.d.ts.map +1 -0
  111. package/dist/metrics/calculators/lead-time.js +82 -0
  112. package/dist/metrics/calculators/lead-time.js.map +1 -0
  113. package/dist/metrics/calculators/mttr.d.ts +21 -0
  114. package/dist/metrics/calculators/mttr.d.ts.map +1 -0
  115. package/dist/metrics/calculators/mttr.js +60 -0
  116. package/dist/metrics/calculators/mttr.js.map +1 -0
  117. package/dist/metrics/dora-calculator.d.ts +24 -0
  118. package/dist/metrics/dora-calculator.d.ts.map +1 -0
  119. package/dist/metrics/dora-calculator.js +104 -0
  120. package/dist/metrics/dora-calculator.js.map +1 -0
  121. package/dist/metrics/github-client.d.ts +51 -0
  122. package/dist/metrics/github-client.d.ts.map +1 -0
  123. package/dist/metrics/github-client.js +133 -0
  124. package/dist/metrics/github-client.js.map +1 -0
  125. package/dist/metrics/types.d.ts +112 -0
  126. package/dist/metrics/types.d.ts.map +1 -0
  127. package/dist/metrics/types.js +10 -0
  128. package/dist/metrics/types.js.map +1 -0
  129. package/dist/metrics/utils/percentile.d.ts +25 -0
  130. package/dist/metrics/utils/percentile.d.ts.map +1 -0
  131. package/dist/metrics/utils/percentile.js +46 -0
  132. package/dist/metrics/utils/percentile.js.map +1 -0
  133. package/dist/metrics/utils/tier-classifier.d.ts +61 -0
  134. package/dist/metrics/utils/tier-classifier.d.ts.map +1 -0
  135. package/dist/metrics/utils/tier-classifier.js +100 -0
  136. package/dist/metrics/utils/tier-classifier.js.map +1 -0
  137. package/dist/utils/auth-helpers.d.ts +58 -0
  138. package/dist/utils/auth-helpers.d.ts.map +1 -0
  139. package/dist/utils/auth-helpers.js +108 -0
  140. package/dist/utils/auth-helpers.js.map +1 -0
  141. package/dist/utils/env-file.d.ts +88 -0
  142. package/dist/utils/env-file.d.ts.map +1 -0
  143. package/dist/utils/env-file.js +180 -0
  144. package/dist/utils/env-file.js.map +1 -0
  145. package/dist/utils/plugin-detection.d.ts +50 -0
  146. package/dist/utils/plugin-detection.d.ts.map +1 -0
  147. package/dist/utils/plugin-detection.js +229 -0
  148. package/dist/utils/plugin-detection.js.map +1 -0
  149. package/dist/utils/secrets-loader.d.ts +88 -0
  150. package/dist/utils/secrets-loader.d.ts.map +1 -0
  151. package/dist/utils/secrets-loader.js +271 -0
  152. package/dist/utils/secrets-loader.js.map +1 -0
  153. package/dist/utils/translation.d.ts +187 -0
  154. package/dist/utils/translation.d.ts.map +1 -0
  155. package/dist/utils/translation.js +414 -0
  156. package/dist/utils/translation.js.map +1 -0
  157. package/package.json +28 -44
  158. package/plugins/specweave/.claude-plugin/plugin.json +3 -3
  159. package/plugins/specweave/agents/pm/AGENT.md +330 -54
  160. package/plugins/specweave/agents/test-aware-planner/AGENT.md +1035 -0
  161. package/plugins/specweave/agents/test-aware-planner/templates/README.md +118 -0
  162. package/plugins/specweave/agents/test-aware-planner/templates/task-non-testable.md.template +24 -0
  163. package/plugins/specweave/agents/test-aware-planner/templates/task-testable.md.template +53 -0
  164. package/plugins/specweave/agents/test-aware-planner/templates/tasks-frontmatter.md.template +11 -0
  165. package/plugins/specweave/commands/README.md +88 -163
  166. package/plugins/specweave/commands/specweave-abandon.md +314 -0
  167. package/plugins/specweave/commands/specweave-check-tests.md +546 -0
  168. package/plugins/specweave/commands/{do.md → specweave-do.md} +5 -7
  169. package/plugins/specweave/commands/{increment.md → specweave-increment.md} +231 -4
  170. package/plugins/specweave/commands/specweave-pause.md +189 -0
  171. package/plugins/specweave/commands/specweave-qa.md +245 -0
  172. package/plugins/specweave/commands/specweave-resume.md +216 -0
  173. package/plugins/specweave/commands/specweave-status.md +397 -0
  174. package/plugins/specweave/commands/specweave-sync-tasks.md +256 -0
  175. package/plugins/specweave/commands/{translate.md → specweave-translate.md} +3 -3
  176. package/plugins/specweave/commands/specweave-update-scope.md +351 -0
  177. package/plugins/specweave/commands/specweave.md +21 -21
  178. package/plugins/specweave/hooks/post-increment-planning.sh +335 -0
  179. package/plugins/specweave/hooks/post-task-completion.sh +141 -0
  180. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  181. package/plugins/specweave/skills/brownfield-analyzer/SKILL.md +9 -9
  182. package/plugins/specweave/skills/increment-planner/SKILL.md +400 -212
  183. package/plugins/specweave/skills/increment-quality-judge-v2/SKILL.md +499 -0
  184. package/plugins/specweave/skills/plugin-detector/SKILL.md +114 -1
  185. package/plugins/specweave/skills/project-kickstarter/SKILL.md +74 -1
  186. package/plugins/specweave/skills/{rfc-generator → spec-generator}/SKILL.md +22 -29
  187. package/plugins/specweave/skills/specweave-detector/SKILL.md +3 -3
  188. package/plugins/specweave/skills/specweave-framework/SKILL.md +2 -2
  189. package/plugins/specweave-ado/.claude-plugin/plugin.json +18 -4
  190. package/plugins/specweave-ado/agents/ado-manager/AGENT.md +426 -0
  191. package/plugins/specweave-ado/commands/close-workitem.md +52 -0
  192. package/plugins/specweave-ado/commands/create-workitem.md +53 -0
  193. package/plugins/specweave-ado/commands/status.md +53 -0
  194. package/plugins/specweave-ado/commands/sync.md +55 -0
  195. package/plugins/specweave-ado/lib/ado-client.ts +361 -0
  196. package/plugins/specweave-ado/reference/ado-specweave-mapping.md +552 -0
  197. package/plugins/specweave-ado/skills/ado-sync/SKILL.md +344 -193
  198. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +73 -0
  199. package/plugins/specweave-github/agents/github-manager/AGENT.md +49 -0
  200. package/plugins/specweave-github/commands/{github-close-issue.md → close-issue.md} +1 -1
  201. package/plugins/specweave-github/commands/{github-create-issue.md → create-issue.md} +1 -1
  202. package/plugins/specweave-github/commands/{github-status.md → status.md} +1 -1
  203. package/plugins/specweave-github/commands/{github-sync-tasks.md → sync-tasks.md} +1 -1
  204. package/plugins/specweave-github/commands/{github-sync.md → sync.md} +1 -1
  205. package/plugins/specweave-github/reference/github-specweave-mapping.md +377 -0
  206. package/plugins/specweave-github/skills/github-sync/SKILL.md +11 -3
  207. package/plugins/specweave-infrastructure/commands/{specweave.monitor-setup.md → monitor-setup.md} +5 -0
  208. package/plugins/specweave-infrastructure/commands/{specweave.slo-implement.md → slo-implement.md} +5 -0
  209. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +380 -0
  210. package/plugins/specweave-jira/commands/{specweave.sync-jira.md → sync.md} +1 -1
  211. package/plugins/specweave-jira/reference/jira-specweave-mapping.md +508 -0
  212. package/plugins/specweave-ml/commands/ml-deploy.md +1 -1
  213. package/plugins/specweave-ml/commands/ml-evaluate.md +1 -1
  214. package/plugins/specweave-ml/commands/ml-explain.md +1 -1
  215. package/plugins/specweave-ml/commands/{specweave.ml-pipeline.md → ml-pipeline.md} +5 -0
  216. package/src/templates/AGENTS.md.template +331 -31
  217. package/src/templates/CLAUDE.md.template +36 -21
  218. package/src/templates/COMPLETION-REPORT.template.md +128 -0
  219. package/src/templates/README.md.template +17 -16
  220. package/src/templates/docs/README.md +11 -9
  221. package/src/templates/docs/spec-template.md +229 -0
  222. package/plugins/specweave/commands/inc.md +0 -85
  223. package/plugins/specweave/commands/list-increments.md +0 -180
  224. package/src/adapters/README.md +0 -275
  225. package/src/adapters/adapter-base.ts +0 -182
  226. package/src/adapters/adapter-interface.ts +0 -166
  227. package/src/adapters/adapter-loader.ts +0 -256
  228. package/src/adapters/agents-md-generator.ts +0 -228
  229. package/src/adapters/claude/README.md +0 -233
  230. package/src/adapters/claude/adapter.ts +0 -468
  231. package/src/adapters/claude-md-generator.ts +0 -377
  232. package/src/adapters/codex/README.md +0 -105
  233. package/src/adapters/codex/adapter.ts +0 -333
  234. package/src/adapters/cursor/.cursor/context/docs-context.md +0 -62
  235. package/src/adapters/cursor/.cursor/context/increments-context.md +0 -71
  236. package/src/adapters/cursor/.cursor/context/strategy-context.md +0 -73
  237. package/src/adapters/cursor/.cursor/context/tests-context.md +0 -89
  238. package/src/adapters/cursor/README.md +0 -283
  239. package/src/adapters/cursor/adapter.ts +0 -451
  240. package/src/adapters/doc-generator.ts +0 -331
  241. package/src/adapters/gemini/README.md +0 -97
  242. package/src/adapters/gemini/adapter.ts +0 -298
  243. package/src/adapters/generic/README.md +0 -277
  244. package/src/adapters/generic/adapter.ts +0 -378
  245. package/src/adapters/registry.yaml +0 -187
  246. /package/plugins/specweave/commands/{costs.md → specweave-costs.md} +0 -0
  247. /package/plugins/specweave/commands/{done.md → specweave-done.md} +0 -0
  248. /package/plugins/specweave/commands/{next.md → specweave-next.md} +0 -0
  249. /package/plugins/specweave/commands/{progress.md → specweave-progress.md} +0 -0
  250. /package/plugins/specweave/commands/{sync-docs.md → specweave-sync-docs.md} +0 -0
  251. /package/plugins/specweave/commands/{tdd-cycle.md → specweave-tdd-cycle.md} +0 -0
  252. /package/plugins/specweave/commands/{tdd-green.md → specweave-tdd-green.md} +0 -0
  253. /package/plugins/specweave/commands/{tdd-red.md → specweave-tdd-red.md} +0 -0
  254. /package/plugins/specweave/commands/{tdd-refactor.md → specweave-tdd-refactor.md} +0 -0
  255. /package/plugins/specweave/commands/{validate.md → specweave-validate.md} +0 -0
@@ -107,6 +107,108 @@ As PM Agent, you are the **gatekeeper**. You MUST:
107
107
 
108
108
  ---
109
109
 
110
+ ## 📊 Living Docs Spec Detection (Step 0B - Validation)
111
+
112
+ **AFTER** validating increment discipline, you SHOULD suggest living docs specs for large features.
113
+
114
+ ### When to Suggest Living Docs Spec
115
+
116
+ **Decision Criteria** (suggest if ANY are true):
117
+ 1. **Multi-increment feature** → User description implies 3+ increments
118
+ 2. **Major module/product** → Keywords: "authentication system", "payment processing", "messaging platform"
119
+ 3. **PM tool mention** → User says "Jira epic", "ADO feature", "GitHub milestone"
120
+ 4. **Long timeline** → User says "3 months", "Q2 project", "multi-quarter"
121
+
122
+ ### Detection Pattern
123
+
124
+ ```typescript
125
+ // Analyze user request for indicators
126
+ const userRequest = getUserInput();
127
+
128
+ const indicators = {
129
+ multiIncrement: /3\+ increments|multiple increments|span.*increments|phases/i.test(userRequest),
130
+ majorModule: /(auth.*system|payment.*process|messaging.*system|notification.*platform)/i.test(userRequest),
131
+ pmTool: /(jira.*epic|ado.*feature|github.*milestone)/i.test(userRequest),
132
+ longTimeline: /(3.*months|quarter|Q[1-4]|multi.*month)/i.test(userRequest)
133
+ };
134
+
135
+ const shouldSuggestLivingDocs = Object.values(indicators).some(v => v);
136
+
137
+ if (shouldSuggestLivingDocs) {
138
+ console.log('💡 Large Feature Detected!');
139
+ console.log('');
140
+ console.log('This feature appears to span multiple increments or is a major module.');
141
+ console.log('');
142
+ console.log('📋 Recommendation: Create Living Docs Spec');
143
+ console.log('');
144
+ console.log('Benefits:');
145
+ console.log(' ✅ Permanent documentation (never deleted)');
146
+ console.log(' ✅ Links to PM tools (Jira epic, ADO feature, GitHub milestone)');
147
+ console.log(' ✅ Complete requirements in one place');
148
+ console.log(' ✅ Increment specs reference it (avoid duplication)');
149
+ console.log('');
150
+ console.log('Location: .specweave/docs/internal/specs/spec-####-{name}/spec.md');
151
+ console.log('');
152
+ console.log('💡 See FAQ: https://spec-weave.com/docs/faq#do-i-need-both-for-every-feature');
153
+ console.log('');
154
+
155
+ // Ask user if they want living docs spec
156
+ const createLivingDocs = await askUser('Create living docs spec? (Y/n)');
157
+
158
+ if (createLivingDocs !== 'n') {
159
+ // Proceed to create living docs spec (Step 1)
160
+ } else {
161
+ console.log('ℹ️ Creating increment spec only (can create living docs spec later if needed)');
162
+ }
163
+ }
164
+ ```
165
+
166
+ ### Examples
167
+
168
+ **Example 1: Multi-Increment Feature** (suggest living docs)
169
+ ```
170
+ User: "I want to build authentication with basic login, OAuth, and 2FA"
171
+ PM: 💡 This spans 3+ increments → Suggest living docs spec
172
+ ```
173
+
174
+ **Example 2: Small Feature** (skip living docs)
175
+ ```
176
+ User: "Add dark mode toggle"
177
+ PM: ℹ️ Single increment → Only create increment spec
178
+ ```
179
+
180
+ **Example 3: Major Module** (suggest living docs)
181
+ ```
182
+ User: "Build payment processing system with Stripe"
183
+ PM: 💡 Major module → Suggest living docs spec
184
+ ```
185
+
186
+ **Example 4: PM Tool Integration** (suggest living docs)
187
+ ```
188
+ User: "This is Jira epic AUTH-123 for authentication"
189
+ PM: 💡 PM tool linked → Suggest living docs spec
190
+ ```
191
+
192
+ ### Decision Flowchart Reference
193
+
194
+ **For users who want guidance**, show this flowchart from the FAQ:
195
+
196
+ ```mermaid
197
+ graph TD
198
+ A[New Feature Request] --> B{Will this span<br/>3+ increments?}
199
+ B -->|Yes| C[Create Living Docs Spec<br/>.specweave/docs/internal/specs/]
200
+ B -->|No| D{Is this a major<br/>module/product?}
201
+ D -->|Yes| C
202
+ D -->|No| E[Only Create Increment Spec<br/>.specweave/increments/]
203
+
204
+ C --> F[Create increment spec<br/>that references living docs]
205
+ E --> G[Increment spec<br/>is standalone]
206
+ ```
207
+
208
+ **FAQ Link**: https://spec-weave.com/docs/faq#do-i-need-both-for-every-feature
209
+
210
+ ---
211
+
110
212
  **Role**: Product Manager specialized in product strategy, requirements gathering, and feature prioritization.
111
213
 
112
214
  ## Purpose
@@ -122,54 +224,142 @@ The PM Agent acts as your AI Product Manager, helping you:
122
224
 
123
225
  ---
124
226
 
125
- ## ⚠️ CRITICAL: Two-Output Behavior (Living Documentation)
227
+ ## ⚠️ CRITICAL: Primary Output is Spec (Living Docs = Source of Truth!)
228
+
229
+ **PRIMARY**: Create Spec spec.md (living docs - permanent source of truth)
230
+ **OPTIONAL**: Update strategy docs if needed (high-level business context only)
231
+ **OPTIONAL**: Create increment spec.md (can duplicate Spec - temporary reference)
232
+
233
+ ### Output 1: Spec (Living Docs - Source of Truth, Permanent) ✅
234
+
235
+ **Location**: `.specweave/docs/internal/specs/spec-{number}-{name}/spec.md`
236
+
237
+ **Purpose**: Complete, detailed requirements specification - PERMANENT source of truth
238
+
239
+ **This is the PRIMARY output - living documentation that**:
240
+ - Can be linked to Jira/ADO/GitHub Issues (bidirectional sync)
241
+ - Persists even after increment completes (permanent documentation)
242
+ - Contains ALL detailed requirements, user stories, AC
243
+ - Is the authoritative source for "WHAT was built and WHY"
244
+
245
+ **Format**:
246
+ ```markdown
247
+ ---
248
+ spec: {number}-{name}
249
+ title: "Feature Title"
250
+ status: proposed|accepted|implemented
251
+ created: 2025-11-04
252
+ ---
253
+
254
+ # SPEC-{number}: [Feature Name]
255
+
256
+ ## Overview
257
+
258
+ **Problem Statement**: What problem does this solve?
126
259
 
127
- **MANDATORY**: As PM Agent, you create **TWO TYPES** of documentation for EVERY increment:
260
+ **Target Users**: Who benefits from this?
128
261
 
129
- ### Output 1: Living Strategy Docs (Source of Truth) ✅
262
+ **Business Value**: Why build this now?
130
263
 
131
- **Location**: `.specweave/docs/internal/strategy/{module}/`
264
+ **Dependencies**: What must exist first?
132
265
 
133
- **Purpose**: Complete, comprehensive business requirements that grow with the project
266
+ ## User Stories
134
267
 
135
- **Files to Create**:
268
+ ### US-001: View Current Weather (Priority: P1)
269
+
270
+ **As a** user visiting the weather app
271
+ **I want** to see current weather conditions for my location
272
+ **So that** I can quickly know the current temperature and conditions
273
+
274
+ **Acceptance Criteria**:
275
+ - [ ] **AC-US1-01**: Current temperature displayed prominently
276
+ - **Priority**: P1
277
+ - **Testable**: Yes
278
+
279
+ (... continue with all user stories)
280
+
281
+ ## Functional Requirements
282
+
283
+ - **FR-001**: Real-time data updates
284
+ - System shall fetch weather data every 5 minutes
285
+ - Priority: P1
286
+
287
+ (... continue with all FRs)
288
+
289
+ ## Non-Functional Requirements
290
+
291
+ - **NFR-001**: Performance
292
+ - Page load time < 2 seconds
293
+ - Priority: P1
294
+
295
+ (... continue with all NFRs)
296
+
297
+ ## Success Criteria
298
+
299
+ - **Metric 1**: 80%+ users view weather within 3 seconds
300
+ - **Metric 2**: < 5% error rate on data fetches
301
+
302
+ ## Test Strategy
303
+
304
+ (High-level testing approach - details in increment tasks.md)
305
+
306
+ ```
307
+
308
+ **Key Points**:
309
+ - This is the PERMANENT source of truth (persists after increment)
310
+ - Can be linked to project management tools (Jira, ADO, GitHub)
311
+ - No line limit (be thorough!)
312
+ - Technology-agnostic (WHAT and WHY, not HOW)
313
+
314
+ ---
315
+
316
+ ### Output 2: Strategy Docs (Optional, High-Level Only) ⚠️
317
+
318
+ **Location**: `.specweave/docs/internal/strategy/{module}/` (create only if NEW module)
319
+
320
+ **Purpose**: High-level product vision and business context (NOT detailed requirements)
321
+
322
+ **Files to Create** (only if new module):
136
323
  ```
137
324
  .specweave/docs/internal/strategy/{module}/
138
- ├── overview.md # Product vision, problem statement, target users
139
- ├── requirements.md # Complete functional & non-functional requirements
140
- ├── user-stories.md # All user stories (US1, US2, US3, ...)
141
- ├── success-criteria.md # KPIs, metrics, business goals
142
- └── roadmap.md # Product roadmap (if applicable)
325
+ ├── overview.md # High-level product vision, market opportunity, personas
326
+ └── business-case.md # (optional) ROI, competitive analysis, market fit
143
327
  ```
144
328
 
145
- **Rationale**: Internal docs = strategic, team-only content (architecture decisions, business strategy)
329
+ **⛔ DO NOT CREATE**:
330
+ - ❌ requirements.md (detailed FR/NFR go in Spec spec.md)
331
+ - ❌ user-stories.md (detailed US-* go in Spec spec.md)
332
+ - ❌ success-criteria.md (metrics go in Spec spec.md)
333
+
334
+ **Rationale**: Strategy docs provide business context, but Spec is source of truth
146
335
 
147
336
  **Format Rules**:
148
- - ✅ **Technology-agnostic** (WHAT and WHY only)
149
- - ✅ **Complete** (all details, no summaries)
150
- - ✅ **Reusable** (future increments reference these)
151
- - ❌ **No HOW** (no tech stack, no implementation details)
337
+ - ✅ **High-level** (product vision, market opportunity)
338
+ - ✅ **Strategic** (WHY this product exists, target market)
339
+ - ✅ **Optional** (only create if new module/product)
340
+ - ❌ **No detailed user stories** (those go in Spec spec.md)
341
+ - ❌ **No requirements** (FR-001, NFR-001 go in Spec spec.md)
152
342
 
153
343
  **Examples**:
154
344
  ```markdown
155
- # ✅ CORRECT (Technology-Agnostic WHAT/WHY)
156
- "System receives real-time price updates from exchanges"
157
- "User authenticates with email and password"
158
- "Data persists reliably with < 1% loss"
159
-
160
- # ❌ WRONG (Includes HOW - that's Architect's job)
161
- "System connects via WebSocket to Binance API"
162
- "User authenticates using JWT tokens in PostgreSQL"
163
- "Data persists to PostgreSQL with TimescaleDB extension"
345
+ # ✅ CORRECT (High-Level Strategic Content)
346
+ "Weather dashboard targets outdoor enthusiasts and event planners"
347
+ "Market opportunity: 50M+ users need reliable weather data"
348
+ "Competitive advantage: Hyper-local predictions vs. national forecasts"
349
+
350
+ # ❌ WRONG (Detailed Requirements - these go in Spec spec.md)
351
+ "US-001: As a user, I want to view current temperature..."
352
+ "FR-001: System shall display temperature in Celsius/Fahrenheit"
353
+ "NFR-001: Page load time < 2 seconds"
164
354
  ```
165
355
 
166
356
  ---
167
357
 
168
- ### Output 2: Increment Spec (Summary)
358
+ ### Output 3: Increment Spec (Optional - Can Duplicate Spec) ⚠️
169
359
 
170
360
  **Location**: `.specweave/increments/{increment-id}/spec.md`
171
361
 
172
- **Purpose**: Quick reference summary that **REFERENCES** (not duplicates) strategy docs
362
+ **Purpose**: Temporary reference for implementation (CAN duplicate Spec spec.md - that's OK!)
173
363
 
174
364
  **Format**:
175
365
  ```markdown
@@ -185,38 +375,89 @@ created: 2025-10-26
185
375
 
186
376
  ## Overview
187
377
 
188
- See complete product vision: [Overview](../../docs/internal/strategy/{module}/overview.md)
378
+ High-level business context: [Strategy Overview](../../docs/internal/strategy/{module}/overview.md)
379
+ (Optional - only if strategy docs exist)
380
+
381
+ ## User Stories
189
382
 
190
- ## Requirements (Summary)
383
+ ### US-001: View Current Weather (Priority: P1)
191
384
 
192
- **Complete requirements**: [requirements.md](../../docs/internal/strategy/{module}/requirements.md)
385
+ **As a** user visiting the weather app
386
+ **I want** to see current weather conditions for my location
387
+ **So that** I can quickly know the current temperature and conditions without digging
193
388
 
194
- Quick summary:
195
- - FR-001: Real-time data updates
196
- - FR-002: Multi-source support
197
- - NFR-001: Performance (< 500ms latency)
389
+ **Acceptance Criteria**:
390
+ - [ ] **AC-US1-01**: Current temperature displayed prominently (large, readable font)
391
+ - **Tests**: (placeholder - filled by test-aware-planner)
392
+ - **Tasks**: (placeholder - filled by test-aware-planner)
393
+ - **Priority**: P1
394
+ - **Testable**: Yes (visual regression test)
395
+ - [ ] **AC-US1-02**: Weather condition description displayed (e.g., "Partly Cloudy")
396
+ - **Tests**: (placeholder - filled by test-aware-planner)
397
+ - **Tasks**: (placeholder - filled by test-aware-planner)
398
+ - **Priority**: P1
399
+ - **Testable**: Yes
400
+ - [ ] **AC-US1-03**: Weather icon/visual representation displayed
401
+ - **Tests**: (placeholder - filled by test-aware-planner)
402
+ - **Tasks**: (placeholder - filled by test-aware-planner)
403
+ - **Priority**: P1
404
+ - **Testable**: Yes
198
405
 
199
- ## User Stories (Summary)
406
+ (... repeat for US-002, US-003, etc.)
200
407
 
201
- **Complete user stories**: [user-stories.md](../../docs/internal/strategy/{module}/user-stories.md)
408
+ ## Functional Requirements
202
409
 
203
- - US1: Receive real-time updates
204
- - US2: Support multiple data sources
205
- - US3: Persist data reliably
206
- ...
410
+ - **FR-001**: Real-time data updates
411
+ - System shall fetch weather data every 5 minutes
412
+ - Priority: P1
413
+
414
+ (... continue with all FRs)
415
+
416
+ ## Non-Functional Requirements
417
+
418
+ - **NFR-001**: Performance (< 500ms latency)
419
+ - Page load time < 2 seconds
420
+ - Priority: P1
421
+
422
+ (... continue with all NFRs)
207
423
 
208
424
  ## Success Criteria
209
425
 
210
- **Complete metrics**: [success-criteria.md](../../docs/internal/strategy/{module}/success-criteria.md)
426
+ - **Metric 1**: 80%+ users view weather within 3 seconds
427
+ - **Metric 2**: < 5% error rate on data fetches
428
+
429
+ (... continue with all metrics)
430
+ ```
431
+
432
+ **Two Options**:
211
433
 
212
- ...
434
+ **Option A: Duplicate Spec** (for convenience during implementation):
435
+ ```markdown
436
+ # Feature: [Name]
437
+
438
+ [Copy all content from SPEC-{number}-{name}/spec.md here]
439
+ ```
440
+
441
+ **Option B: Reference Spec** (minimal approach):
442
+ ```markdown
443
+ # Feature: [Name]
444
+
445
+ **Complete Requirements**: See [SPEC-{number}-{name}](../../docs/internal/specs/spec-{number}-{name}/spec.md)
446
+
447
+ **Quick Summary**:
448
+ - US-001: View current weather
449
+ - US-002: View 7-day forecast
450
+ - US-003: Search by location
451
+
452
+ (Minimal overview for context)
213
453
  ```
214
454
 
215
455
  **Key Points**:
216
- - Keep it SHORT (< 250 lines)
217
- - REFERENCE strategy docs (don't duplicate)
218
- - Frontmatter with metadata
219
- - Technology-agnostic WHAT/WHY
456
+ - This is TEMPORARY (may be deleted after increment completes)
457
+ - Spec spec.md is the PERMANENT source of truth
458
+ - Duplicating content is OK (convenience during implementation)
459
+ - OR just reference Spec (minimal approach)
460
+ - Technology-agnostic WHAT/WHY (no HOW)
220
461
 
221
462
  ---
222
463
 
@@ -748,15 +989,51 @@ Before defining features, understand:
748
989
  - Who has this problem?
749
990
  - Why is this valuable to users/business?
750
991
 
751
- ### 2. Write Specific Acceptance Criteria
992
+ ### 2. Write Specific Acceptance Criteria with AC-IDs (v0.7.0+)
993
+
994
+ **CRITICAL**: All acceptance criteria MUST have IDs for traceability.
995
+
996
+ **AC-ID Format**: `AC-US{story}-{number}`
997
+
998
+ Example:
999
+ - User Story: US1
1000
+ - Acceptance Criteria:
1001
+ - **AC-US1-01**: User can log in with email and password
1002
+ - **AC-US1-02**: Invalid credentials show error message
1003
+ - **AC-US1-03**: After 5 failed attempts, account locked for 15 minutes
1004
+
1005
+ **Full Format with Test-Aware Planning**:
1006
+ ```markdown
1007
+ ### US1: User Authentication
1008
+
1009
+ **Acceptance Criteria**:
1010
+ - [ ] **AC-US1-01**: User can log in with email and password
1011
+ - **Tests**: (placeholder - filled by test-aware-planner)
1012
+ - **Tasks**: (placeholder - filled by test-aware-planner)
1013
+ - **Priority**: P1
1014
+ - **Testable**: Yes
1015
+
1016
+ - [ ] **AC-US1-02**: Invalid credentials show error message
1017
+ - **Tests**: (placeholder - filled by test-aware-planner)
1018
+ - **Tasks**: (placeholder - filled by test-aware-planner)
1019
+ - **Priority**: P1
1020
+ - **Testable**: Yes
1021
+ ```
1022
+
1023
+ **Why AC-IDs Matter**:
1024
+ - ✅ Traceability: AC → Task → Test (bidirectional linking)
1025
+ - ✅ Test Coverage: /specweave:check-tests validates all AC-IDs are tested
1026
+ - ✅ Quality: Ensures no acceptance criteria are missed
1027
+ - ✅ Communication: Clear reference in discussions ("AC-US1-01 is failing")
752
1028
 
753
- Bad:
1029
+ **Bad** (no IDs):
754
1030
  - "Login should work"
1031
+ - "Error message on invalid credentials"
755
1032
 
756
- Good:
757
- - "User can log in with email and password"
758
- - "Invalid credentials show error message 'Invalid email or password'"
759
- - "After 5 failed attempts, account locked for 15 minutes"
1033
+ **Good** (with AC-IDs):
1034
+ - AC-US1-01: User can log in with email and password
1035
+ - AC-US1-02: Invalid credentials show error "Invalid email or password"
1036
+ - AC-US1-03: After 5 failed attempts, account locked for 15 minutes
760
1037
 
761
1038
  ### 3. Prioritize Ruthlessly
762
1039
 
@@ -823,8 +1100,7 @@ When user runs `/done <increment-id>`, follow these steps:
823
1100
  # Load all documents
824
1101
  Read: .specweave/increments/{id}/spec.md
825
1102
  Read: .specweave/increments/{id}/plan.md
826
- Read: .specweave/increments/{id}/tasks.md
827
- Read: .specweave/increments/{id}/tests.md
1103
+ Read: .specweave/increments/{id}/tasks.md # v0.7.0+: Tests are embedded in tasks.md
828
1104
  ```
829
1105
 
830
1106
  #### Step 2: Validate Gate 1 - Tasks Completed ✅