specweave 0.1.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 (288) hide show
  1. package/INSTALL.md +848 -0
  2. package/LICENSE +21 -0
  3. package/README.md +675 -0
  4. package/SPECWEAVE.md +665 -0
  5. package/bin/install-agents.sh +57 -0
  6. package/bin/install-all.sh +49 -0
  7. package/bin/install-commands.sh +56 -0
  8. package/bin/install-skills.sh +57 -0
  9. package/bin/specweave.js +81 -0
  10. package/dist/adapters/adapter-base.d.ts +50 -0
  11. package/dist/adapters/adapter-base.d.ts.map +1 -0
  12. package/dist/adapters/adapter-base.js +146 -0
  13. package/dist/adapters/adapter-base.js.map +1 -0
  14. package/dist/adapters/adapter-interface.d.ts +108 -0
  15. package/dist/adapters/adapter-interface.d.ts.map +1 -0
  16. package/dist/adapters/adapter-interface.js +9 -0
  17. package/dist/adapters/adapter-interface.js.map +1 -0
  18. package/dist/adapters/claude/adapter.d.ts +54 -0
  19. package/dist/adapters/claude/adapter.d.ts.map +1 -0
  20. package/dist/adapters/claude/adapter.js +184 -0
  21. package/dist/adapters/claude/adapter.js.map +1 -0
  22. package/dist/adapters/copilot/adapter.d.ts +42 -0
  23. package/dist/adapters/copilot/adapter.d.ts.map +1 -0
  24. package/dist/adapters/copilot/adapter.js +239 -0
  25. package/dist/adapters/copilot/adapter.js.map +1 -0
  26. package/dist/adapters/cursor/adapter.d.ts +42 -0
  27. package/dist/adapters/cursor/adapter.d.ts.map +1 -0
  28. package/dist/adapters/cursor/adapter.js +297 -0
  29. package/dist/adapters/cursor/adapter.js.map +1 -0
  30. package/dist/adapters/generic/adapter.d.ts +40 -0
  31. package/dist/adapters/generic/adapter.d.ts.map +1 -0
  32. package/dist/adapters/generic/adapter.js +155 -0
  33. package/dist/adapters/generic/adapter.js.map +1 -0
  34. package/dist/cli/commands/init.d.ts +6 -0
  35. package/dist/cli/commands/init.d.ts.map +1 -0
  36. package/dist/cli/commands/init.js +247 -0
  37. package/dist/cli/commands/init.js.map +1 -0
  38. package/dist/cli/commands/install.d.ts +7 -0
  39. package/dist/cli/commands/install.d.ts.map +1 -0
  40. package/dist/cli/commands/install.js +160 -0
  41. package/dist/cli/commands/install.js.map +1 -0
  42. package/dist/cli/commands/list.d.ts +6 -0
  43. package/dist/cli/commands/list.d.ts.map +1 -0
  44. package/dist/cli/commands/list.js +154 -0
  45. package/dist/cli/commands/list.js.map +1 -0
  46. package/package.json +90 -0
  47. package/src/adapters/README.md +312 -0
  48. package/src/adapters/adapter-base.ts +146 -0
  49. package/src/adapters/adapter-interface.ts +120 -0
  50. package/src/adapters/claude/README.md +241 -0
  51. package/src/adapters/claude/adapter.ts +157 -0
  52. package/src/adapters/copilot/.github/copilot/instructions.md +376 -0
  53. package/src/adapters/copilot/README.md +200 -0
  54. package/src/adapters/copilot/adapter.ts +210 -0
  55. package/src/adapters/cursor/.cursor/context/docs-context.md +62 -0
  56. package/src/adapters/cursor/.cursor/context/increments-context.md +71 -0
  57. package/src/adapters/cursor/.cursor/context/strategy-context.md +73 -0
  58. package/src/adapters/cursor/.cursor/context/tests-context.md +89 -0
  59. package/src/adapters/cursor/.cursorrules +325 -0
  60. package/src/adapters/cursor/README.md +243 -0
  61. package/src/adapters/cursor/adapter.ts +268 -0
  62. package/src/adapters/generic/README.md +277 -0
  63. package/src/adapters/generic/SPECWEAVE-MANUAL.md +676 -0
  64. package/src/adapters/generic/adapter.ts +159 -0
  65. package/src/adapters/registry.yaml +126 -0
  66. package/src/agents/architect/AGENT.md +416 -0
  67. package/src/agents/devops/AGENT.md +1738 -0
  68. package/src/agents/docs-writer/AGENT.md +239 -0
  69. package/src/agents/performance/AGENT.md +228 -0
  70. package/src/agents/pm/AGENT.md +751 -0
  71. package/src/agents/qa-lead/AGENT.md +150 -0
  72. package/src/agents/security/AGENT.md +179 -0
  73. package/src/agents/sre/AGENT.md +582 -0
  74. package/src/agents/sre/modules/backend-diagnostics.md +481 -0
  75. package/src/agents/sre/modules/database-diagnostics.md +509 -0
  76. package/src/agents/sre/modules/infrastructure.md +561 -0
  77. package/src/agents/sre/modules/monitoring.md +439 -0
  78. package/src/agents/sre/modules/security-incidents.md +421 -0
  79. package/src/agents/sre/modules/ui-diagnostics.md +302 -0
  80. package/src/agents/sre/playbooks/01-high-cpu-usage.md +204 -0
  81. package/src/agents/sre/playbooks/02-database-deadlock.md +241 -0
  82. package/src/agents/sre/playbooks/03-memory-leak.md +252 -0
  83. package/src/agents/sre/playbooks/04-slow-api-response.md +269 -0
  84. package/src/agents/sre/playbooks/05-ddos-attack.md +293 -0
  85. package/src/agents/sre/playbooks/06-disk-full.md +314 -0
  86. package/src/agents/sre/playbooks/07-service-down.md +333 -0
  87. package/src/agents/sre/playbooks/08-data-corruption.md +337 -0
  88. package/src/agents/sre/playbooks/09-cascade-failure.md +430 -0
  89. package/src/agents/sre/playbooks/10-rate-limit-exceeded.md +464 -0
  90. package/src/agents/sre/scripts/health-check.sh +230 -0
  91. package/src/agents/sre/scripts/log-analyzer.py +213 -0
  92. package/src/agents/sre/scripts/metrics-collector.sh +294 -0
  93. package/src/agents/sre/scripts/trace-analyzer.js +257 -0
  94. package/src/agents/sre/templates/incident-report.md +249 -0
  95. package/src/agents/sre/templates/mitigation-plan.md +375 -0
  96. package/src/agents/sre/templates/post-mortem.md +418 -0
  97. package/src/agents/sre/templates/runbook-template.md +412 -0
  98. package/src/agents/tech-lead/AGENT.md +263 -0
  99. package/src/commands/add-tasks.md +176 -0
  100. package/src/commands/close-increment.md +347 -0
  101. package/src/commands/create-increment.md +223 -0
  102. package/src/commands/create-project.md +528 -0
  103. package/src/commands/generate-docs.md +623 -0
  104. package/src/commands/list-increments.md +180 -0
  105. package/src/commands/review-docs.md +331 -0
  106. package/src/commands/start-increment.md +139 -0
  107. package/src/commands/sync-github.md +115 -0
  108. package/src/commands/validate-increment.md +800 -0
  109. package/src/hooks/README.md +252 -0
  110. package/src/hooks/docs-changed.sh +59 -0
  111. package/src/hooks/human-input-required.sh +55 -0
  112. package/src/hooks/post-task-completion.sh +57 -0
  113. package/src/hooks/pre-implementation.sh +47 -0
  114. package/src/skills/ado-sync/README.md +449 -0
  115. package/src/skills/ado-sync/SKILL.md +245 -0
  116. package/src/skills/ado-sync/test-cases/test-1.yaml +9 -0
  117. package/src/skills/ado-sync/test-cases/test-2.yaml +8 -0
  118. package/src/skills/ado-sync/test-cases/test-3.yaml +9 -0
  119. package/src/skills/bmad-method-expert/SKILL.md +628 -0
  120. package/src/skills/bmad-method-expert/scripts/analyze-project.js +318 -0
  121. package/src/skills/bmad-method-expert/scripts/check-setup.js +208 -0
  122. package/src/skills/bmad-method-expert/scripts/generate-template.js +1149 -0
  123. package/src/skills/bmad-method-expert/scripts/validate-documents.js +340 -0
  124. package/src/skills/bmad-method-expert/test-cases/test-1-placeholder.yaml +12 -0
  125. package/src/skills/bmad-method-expert/test-cases/test-2-placeholder.yaml +12 -0
  126. package/src/skills/bmad-method-expert/test-cases/test-3-placeholder.yaml +12 -0
  127. package/src/skills/brownfield-analyzer/SKILL.md +523 -0
  128. package/src/skills/brownfield-analyzer/test-cases/test-1-basic-analysis.yaml +48 -0
  129. package/src/skills/brownfield-analyzer/test-cases/test-2-placeholder.yaml +12 -0
  130. package/src/skills/brownfield-analyzer/test-cases/test-3-placeholder.yaml +12 -0
  131. package/src/skills/brownfield-onboarder/SKILL.md +625 -0
  132. package/src/skills/brownfield-onboarder/test-cases/test-1-placeholder.yaml +12 -0
  133. package/src/skills/brownfield-onboarder/test-cases/test-2-placeholder.yaml +12 -0
  134. package/src/skills/brownfield-onboarder/test-cases/test-3-placeholder.yaml +12 -0
  135. package/src/skills/calendar-system/test-cases/test-1-placeholder.yaml +12 -0
  136. package/src/skills/calendar-system/test-cases/test-2-placeholder.yaml +12 -0
  137. package/src/skills/calendar-system/test-cases/test-3-placeholder.yaml +12 -0
  138. package/src/skills/context-loader/SKILL.md +734 -0
  139. package/src/skills/context-loader/test-cases/test-1-basic-loading.yaml +39 -0
  140. package/src/skills/context-loader/test-cases/test-2-token-budget-exceeded.yaml +44 -0
  141. package/src/skills/context-loader/test-cases/test-3-section-anchors.yaml +45 -0
  142. package/src/skills/context-optimizer/SKILL.md +618 -0
  143. package/src/skills/context-optimizer/test-cases/test-1-bug-fix-narrow.yaml +97 -0
  144. package/src/skills/context-optimizer/test-cases/test-2-feature-focused.yaml +109 -0
  145. package/src/skills/context-optimizer/test-cases/test-3-architecture-broad.yaml +98 -0
  146. package/src/skills/cost-optimizer/SKILL.md +190 -0
  147. package/src/skills/cost-optimizer/test-cases/test-1-basic-comparison.yaml +75 -0
  148. package/src/skills/cost-optimizer/test-cases/test-2-budget-constraint.yaml +52 -0
  149. package/src/skills/cost-optimizer/test-cases/test-3-scale-requirement.yaml +63 -0
  150. package/src/skills/cost-optimizer/test-results/README.md +46 -0
  151. package/src/skills/design-system-architect/SKILL.md +107 -0
  152. package/src/skills/design-system-architect/test-cases/test-1-token-structure.yaml +23 -0
  153. package/src/skills/design-system-architect/test-cases/test-2-component-hierarchy.yaml +24 -0
  154. package/src/skills/design-system-architect/test-cases/test-3-accessibility-checklist.yaml +23 -0
  155. package/src/skills/diagrams-architect/SKILL.md +763 -0
  156. package/src/skills/diagrams-generator/SKILL.md +25 -0
  157. package/src/skills/diagrams-generator/test-cases/test-1.yaml +9 -0
  158. package/src/skills/diagrams-generator/test-cases/test-2.yaml +9 -0
  159. package/src/skills/diagrams-generator/test-cases/test-3.yaml +8 -0
  160. package/src/skills/docs-updater/README.md +48 -0
  161. package/src/skills/docs-updater/test-cases/test-1-placeholder.yaml +12 -0
  162. package/src/skills/docs-updater/test-cases/test-2-placeholder.yaml +12 -0
  163. package/src/skills/docs-updater/test-cases/test-3-placeholder.yaml +12 -0
  164. package/src/skills/dotnet-backend/SKILL.md +250 -0
  165. package/src/skills/e2e-playwright/README.md +506 -0
  166. package/src/skills/e2e-playwright/SKILL.md +457 -0
  167. package/src/skills/e2e-playwright/execute.js +373 -0
  168. package/src/skills/e2e-playwright/lib/utils.js +514 -0
  169. package/src/skills/e2e-playwright/package.json +33 -0
  170. package/src/skills/e2e-playwright/test-cases/TC-001-basic-navigation.yaml +54 -0
  171. package/src/skills/e2e-playwright/test-cases/TC-002-form-interaction.yaml +64 -0
  172. package/src/skills/e2e-playwright/test-cases/TC-003-specweave-integration.yaml +74 -0
  173. package/src/skills/e2e-playwright/test-cases/TC-004-accessibility-check.yaml +98 -0
  174. package/src/skills/figma-designer/SKILL.md +149 -0
  175. package/src/skills/figma-implementer/SKILL.md +148 -0
  176. package/src/skills/figma-mcp-connector/SKILL.md +136 -0
  177. package/src/skills/figma-mcp-connector/test-cases/test-1-read-file-desktop.yaml +22 -0
  178. package/src/skills/figma-mcp-connector/test-cases/test-2-read-file-framelink.yaml +21 -0
  179. package/src/skills/figma-mcp-connector/test-cases/test-3-error-handling.yaml +18 -0
  180. package/src/skills/figma-to-code/SKILL.md +128 -0
  181. package/src/skills/figma-to-code/test-cases/test-1-token-generation.yaml +29 -0
  182. package/src/skills/figma-to-code/test-cases/test-2-component-generation.yaml +27 -0
  183. package/src/skills/figma-to-code/test-cases/test-3-typescript-generation.yaml +28 -0
  184. package/src/skills/frontend/SKILL.md +177 -0
  185. package/src/skills/github-sync/SKILL.md +252 -0
  186. package/src/skills/github-sync/test-cases/test-1-placeholder.yaml +12 -0
  187. package/src/skills/github-sync/test-cases/test-2-placeholder.yaml +12 -0
  188. package/src/skills/github-sync/test-cases/test-3-placeholder.yaml +12 -0
  189. package/src/skills/hetzner-provisioner/README.md +308 -0
  190. package/src/skills/hetzner-provisioner/SKILL.md +251 -0
  191. package/src/skills/hetzner-provisioner/test-cases/test-1-basic-provision.yaml +71 -0
  192. package/src/skills/hetzner-provisioner/test-cases/test-2-postgres-provision.yaml +85 -0
  193. package/src/skills/hetzner-provisioner/test-cases/test-3-ssl-config.yaml +126 -0
  194. package/src/skills/hetzner-provisioner/test-results/README.md +259 -0
  195. package/src/skills/increment-planner/SKILL.md +889 -0
  196. package/src/skills/increment-planner/scripts/feature-utils.js +250 -0
  197. package/src/skills/increment-planner/test-cases/test-1-basic-feature.yaml +27 -0
  198. package/src/skills/increment-planner/test-cases/test-2-complex-feature.yaml +30 -0
  199. package/src/skills/increment-planner/test-cases/test-3-auto-numbering.yaml +24 -0
  200. package/src/skills/increment-quality-judge/SKILL.md +566 -0
  201. package/src/skills/increment-quality-judge/test-cases/test-1-good-spec.yaml +95 -0
  202. package/src/skills/increment-quality-judge/test-cases/test-2-poor-spec.yaml +108 -0
  203. package/src/skills/increment-quality-judge/test-cases/test-3-export-suggestions.yaml +87 -0
  204. package/src/skills/jira-sync/README.md +328 -0
  205. package/src/skills/jira-sync/SKILL.md +209 -0
  206. package/src/skills/jira-sync/test-cases/test-1.yaml +9 -0
  207. package/src/skills/jira-sync/test-cases/test-2.yaml +9 -0
  208. package/src/skills/jira-sync/test-cases/test-3.yaml +10 -0
  209. package/src/skills/nextjs/SKILL.md +176 -0
  210. package/src/skills/nodejs-backend/SKILL.md +181 -0
  211. package/src/skills/notification-system/test-cases/test-1-placeholder.yaml +12 -0
  212. package/src/skills/notification-system/test-cases/test-2-placeholder.yaml +12 -0
  213. package/src/skills/notification-system/test-cases/test-3-placeholder.yaml +12 -0
  214. package/src/skills/python-backend/SKILL.md +226 -0
  215. package/src/skills/role-orchestrator/README.md +197 -0
  216. package/src/skills/role-orchestrator/SKILL.md +1184 -0
  217. package/src/skills/role-orchestrator/test-cases/test-1-simple-product.yaml +98 -0
  218. package/src/skills/role-orchestrator/test-cases/test-2-quality-gate-failure.yaml +73 -0
  219. package/src/skills/role-orchestrator/test-cases/test-3-security-workflow.yaml +121 -0
  220. package/src/skills/role-orchestrator/test-cases/test-4-parallel-execution.yaml +145 -0
  221. package/src/skills/role-orchestrator/test-cases/test-5-feedback-loops.yaml +149 -0
  222. package/src/skills/skill-creator/LICENSE.txt +202 -0
  223. package/src/skills/skill-creator/SKILL.md +209 -0
  224. package/src/skills/skill-creator/scripts/init_skill.py +303 -0
  225. package/src/skills/skill-creator/scripts/package_skill.py +110 -0
  226. package/src/skills/skill-creator/scripts/quick_validate.py +65 -0
  227. package/src/skills/skill-creator/test-cases/test-1-placeholder.yaml +12 -0
  228. package/src/skills/skill-creator/test-cases/test-2-placeholder.yaml +12 -0
  229. package/src/skills/skill-creator/test-cases/test-3-placeholder.yaml +12 -0
  230. package/src/skills/skill-router/SKILL.md +497 -0
  231. package/src/skills/skill-router/test-cases/test-1-basic-routing.yaml +33 -0
  232. package/src/skills/skill-router/test-cases/test-2-ambiguous-request.yaml +42 -0
  233. package/src/skills/skill-router/test-cases/test-3-nested-orchestration.yaml +50 -0
  234. package/src/skills/spec-driven-brainstorming/README.md +264 -0
  235. package/src/skills/spec-driven-brainstorming/SKILL.md +439 -0
  236. package/src/skills/spec-driven-brainstorming/test-cases/TC-001-simple-idea-to-design.yaml +148 -0
  237. package/src/skills/spec-driven-brainstorming/test-cases/TC-002-complex-ultrathink-design.yaml +190 -0
  238. package/src/skills/spec-driven-brainstorming/test-cases/TC-003-unclear-requirements-socratic.yaml +233 -0
  239. package/src/skills/spec-driven-debugging/README.md +479 -0
  240. package/src/skills/spec-driven-debugging/SKILL.md +652 -0
  241. package/src/skills/spec-driven-debugging/test-cases/TC-001-simple-auth-bug.yaml +212 -0
  242. package/src/skills/spec-driven-debugging/test-cases/TC-002-race-condition-ultrathink.yaml +461 -0
  243. package/src/skills/spec-driven-debugging/test-cases/TC-003-brownfield-missing-spec.yaml +366 -0
  244. package/src/skills/spec-kit-expert/SKILL.md +1012 -0
  245. package/src/skills/spec-kit-expert/test-cases/test-1-placeholder.yaml +12 -0
  246. package/src/skills/spec-kit-expert/test-cases/test-2-placeholder.yaml +12 -0
  247. package/src/skills/spec-kit-expert/test-cases/test-3-placeholder.yaml +12 -0
  248. package/src/skills/specweave-ado-mapper/SKILL.md +501 -0
  249. package/src/skills/specweave-detector/SKILL.md +420 -0
  250. package/src/skills/specweave-detector/test-cases/test-1-basic-detection.yaml +37 -0
  251. package/src/skills/specweave-detector/test-cases/test-2-missing-config.yaml +37 -0
  252. package/src/skills/specweave-detector/test-cases/test-3-non-specweave-project.yaml +34 -0
  253. package/src/skills/specweave-jira-mapper/SKILL.md +500 -0
  254. package/src/skills/stripe-integrator/test-cases/test-1-placeholder.yaml +12 -0
  255. package/src/skills/stripe-integrator/test-cases/test-2-placeholder.yaml +12 -0
  256. package/src/skills/stripe-integrator/test-cases/test-3-placeholder.yaml +12 -0
  257. package/src/skills/task-builder/README.md +90 -0
  258. package/src/skills/task-builder/test-cases/test-1-placeholder.yaml +12 -0
  259. package/src/skills/task-builder/test-cases/test-2-placeholder.yaml +12 -0
  260. package/src/skills/task-builder/test-cases/test-3-placeholder.yaml +12 -0
  261. package/src/templates/.env.example +144 -0
  262. package/src/templates/.gitignore.template +81 -0
  263. package/src/templates/CLAUDE.md.template +383 -0
  264. package/src/templates/README.md.template +240 -0
  265. package/src/templates/config.yaml +333 -0
  266. package/src/templates/docs/README.md +124 -0
  267. package/src/templates/docs/adr-template.md +118 -0
  268. package/src/templates/docs/hld-template.md +220 -0
  269. package/src/templates/docs/lld-template.md +580 -0
  270. package/src/templates/docs/prd-template.md +132 -0
  271. package/src/templates/docs/rfc-template.md +229 -0
  272. package/src/templates/docs/runbook-template.md +298 -0
  273. package/src/templates/environments/minimal/.env.production +16 -0
  274. package/src/templates/environments/minimal/README.md +54 -0
  275. package/src/templates/environments/minimal/deploy-production.yml +52 -0
  276. package/src/templates/environments/progressive/.env.qa +28 -0
  277. package/src/templates/environments/progressive/README.md +129 -0
  278. package/src/templates/environments/progressive/deploy-production.yml +93 -0
  279. package/src/templates/environments/progressive/deploy-qa.yml +62 -0
  280. package/src/templates/environments/progressive/deploy-staging.yml +67 -0
  281. package/src/templates/environments/standard/.env.development +20 -0
  282. package/src/templates/environments/standard/.env.production +30 -0
  283. package/src/templates/environments/standard/.env.staging +23 -0
  284. package/src/templates/environments/standard/README.md +97 -0
  285. package/src/templates/environments/standard/deploy-production.yml +68 -0
  286. package/src/templates/environments/standard/deploy-staging.yml +61 -0
  287. package/src/templates/environments/standard/docker-compose.yml +43 -0
  288. package/src/templates/increment-metadata-template.yaml +138 -0
@@ -0,0 +1,889 @@
1
+ ---
2
+ name: increment-planner
3
+ description: Creates comprehensive implementation plans for SpecWeave increments (aka features - both terms are interchangeable). This skill should be used when planning new increments/features, creating specifications, or organizing implementation work. Activates for: increment planning, feature planning, implementation plan, create increment, create feature, plan increment, plan feature, organize work, break down increment, break down feature.
4
+ ---
5
+
6
+ # Increment Planner Skill
7
+
8
+ ## 📚 Required Reading (LOAD FIRST)
9
+
10
+ **CRITICAL**: Before planning features, read this guide:
11
+ - **[Increment Lifecycle Guide](.specweave/docs/internal/delivery/guides/increment-lifecycle.md)**
12
+
13
+ This guide contains:
14
+ - Complete increment structure (spec.md, plan.md, tasks.md, tests.md)
15
+ - WIP limits and status progression
16
+ - Task vs increment decision tree
17
+ - Context manifest creation for 70%+ token reduction
18
+
19
+ **Load this guide using the Read tool BEFORE creating feature plans.**
20
+
21
+ ---
22
+
23
+ This skill creates comprehensive, well-structured implementation plans for SpecWeave features following the Spec-Driven Development methodology.
24
+
25
+ ## Purpose
26
+
27
+ The increment-planner skill automates the creation of feature implementation plans, ensuring:
28
+ - Auto-numbered feature directories (`0001-9999` 4-digit format)
29
+ - Duplicate detection (prevents creating 0002 when 0002 already exists)
30
+ - Complete feature artifacts (spec.md, plan.md, tasks.md, tests.md)
31
+ - Proper context manifests for selective loading
32
+ - Constitutional compliance
33
+ - Separation of WHAT/WHY (spec) from HOW (plan) from STEPS (tasks)
34
+
35
+ ## When to Use This Skill
36
+
37
+ Use this skill when:
38
+ - Creating a new feature from a description
39
+ - Planning implementation for a user story
40
+ - Organizing work for a complex task
41
+ - Breaking down epics into executable features
42
+ - Structuring brownfield modifications
43
+
44
+ ## Activation Triggers
45
+
46
+ This skill activates automatically when users say:
47
+ - "Plan a feature for..."
48
+ - "Create implementation plan for..."
49
+ - "I want to add [feature description]"
50
+ - "Help me structure [feature]"
51
+ - "Break down this feature: ..."
52
+
53
+ ---
54
+
55
+ ## ⚠️ CRITICAL: Living Documentation Workflow
56
+
57
+ **MANDATORY**: Feature planner must orchestrate **BOTH** living docs and increment files.
58
+
59
+ ### Correct Workflow (MUST FOLLOW)
60
+
61
+ ```
62
+ User: "I want to build real-time price tracking"
63
+
64
+ increment-planner skill
65
+
66
+ STEP 1: Scan existing docs
67
+ ├─ Read .specweave/docs/internal/strategy/ (existing requirements)
68
+ ├─ Read .specweave/docs/internal/architecture/adr/ (existing decisions)
69
+ └─ Pass existing context to agents
70
+
71
+ STEP 2: Invoke PM Agent
72
+ ├─ PM creates .specweave/docs/internal/strategy/crypto-trading/
73
+ │ ├── overview.md (product vision, problem, users)
74
+ │ ├── requirements.md (FR-001, NFR-001, technology-agnostic)
75
+ │ ├── user-stories.md (US1, US2, US3...)
76
+ │ └── success-criteria.md (KPIs, metrics)
77
+ └─ PM creates .specweave/increments/0001-*/spec.md (summary, references strategy docs)
78
+
79
+ STEP 3: Invoke Architect Agent
80
+ ├─ Architect READS strategy docs from PM
81
+ ├─ Architect creates .specweave/docs/internal/architecture/
82
+ │ ├── system-design.md (overall architecture)
83
+ │ ├── adr/0001-websocket-vs-polling.md (decision record)
84
+ │ ├── adr/0002-database-choice.md (PostgreSQL vs MongoDB)
85
+ │ ├── adr/0003-deployment-platform.md (Railway vs Hetzner)
86
+ │ └── diagrams/crypto-trading/ (Mermaid C4 diagrams)
87
+ └─ Architect creates .specweave/increments/0001-*/plan.md (summary, references architecture docs)
88
+
89
+ STEP 4: Validate Living Docs
90
+ ├─ Check .specweave/docs/internal/strategy/{module}/ is NOT empty
91
+ ├─ Check .specweave/docs/internal/architecture/adr/ has ADRs
92
+ ├─ Check increment spec.md REFERENCES (not duplicates) strategy docs
93
+ └─ Check increment plan.md REFERENCES (not duplicates) architecture docs
94
+
95
+ ✅ SUCCESS: Living docs updated, increment created
96
+ ```
97
+
98
+ ### What Gets Created
99
+
100
+ #### Living Docs (Source of Truth) ✅
101
+ ```
102
+ .specweave/docs/
103
+ ├── internal/
104
+ │ ├── strategy/
105
+ │ │ └── {module}/ # ← PM Agent creates this
106
+ │ │ ├── overview.md # Product vision, problem statement
107
+ │ │ ├── requirements.md # Complete FR/NFR (technology-agnostic)
108
+ │ │ ├── user-stories.md # All user stories (US1, US2, ...)
109
+ │ │ └── success-criteria.md # KPIs, business metrics
110
+ │ │
111
+ │ └── architecture/
112
+ │ ├── system-design.md # ← Architect updates this
113
+ │ ├── adr/ # ← Architect creates ADRs
114
+ │ │ ├── ####-websocket-vs-polling.md
115
+ │ │ ├── ####-database-choice.md
116
+ │ │ └── ####-deployment-platform.md
117
+ │ ├── diagrams/ # ← Architect creates diagrams
118
+ │ │ └── {module}/
119
+ │ │ ├── system-context.mmd # C4 Level 1
120
+ │ │ └── system-container.mmd # C4 Level 2
121
+ │ └── data-models/
122
+ │ └── {module}-schema.sql
123
+ ```
124
+
125
+ #### Increment Files (Summary) ✅
126
+ ```
127
+ .specweave/increments/0001-feature-name/
128
+ ├── spec.md # ← PM Agent (< 250 lines, references strategy docs)
129
+ ├── plan.md # ← Architect Agent (< 500 lines, references architecture docs)
130
+ ├── tasks.md # ← Tech Lead Agent (generated later)
131
+ ├── tests.md # ← QA Agent (generated later)
132
+ └── context-manifest.yaml # ← increment-planner creates
133
+ ```
134
+
135
+ ---
136
+
137
+ ### Validation Rules (MANDATORY)
138
+
139
+ Before completing feature planning, verify:
140
+
141
+ **Living Docs Created**:
142
+ - [ ] `.specweave/docs/internal/strategy/{module}/requirements.md` exists
143
+ - [ ] `.specweave/docs/internal/architecture/adr/` has ≥3 ADRs
144
+ - [ ] `requirements.md` is technology-agnostic (no PostgreSQL, WebSocket, etc.)
145
+ - [ ] ADRs follow template (Context, Decision, Alternatives, Consequences)
146
+
147
+ **Increment Files Reference Living Docs**:
148
+ - [ ] `spec.md` has links to `../../docs/internal/strategy/{module}/`
149
+ - [ ] `plan.md` has links to `../../docs/internal/architecture/adr/`
150
+ - [ ] `spec.md` is < 250 lines (summary only)
151
+ - [ ] `plan.md` is < 500 lines (summary only)
152
+
153
+ **Agents Followed Process**:
154
+ - [ ] PM Agent scanned existing strategy docs before creating new ones
155
+ - [ ] Architect Agent read PM's strategy docs before creating architecture
156
+ - [ ] Architect created ADRs for ALL technical decisions
157
+
158
+ ---
159
+
160
+ ## Feature Planning Process
161
+
162
+ ### Step 1: Analyze Feature Description
163
+
164
+ When a user provides a feature description:
165
+
166
+ 1. **Extract Requirements**:
167
+ - What is the core user value?
168
+ - Why is this feature needed?
169
+ - What problem does it solve?
170
+
171
+ 2. **Identify Scope**:
172
+ - What functionality is included?
173
+ - What is explicitly excluded?
174
+ - Are there dependencies?
175
+
176
+ 3. **Determine Priority**:
177
+ - P1 (Critical): Must-have for MVP
178
+ - P2 (Important): High-value enhancement
179
+ - P3 (Nice-to-have): Polish and optimization
180
+
181
+ ### Step 2: Generate Short Name
182
+
183
+ From feature description, create a short name following these rules:
184
+
185
+ 1. **Extract Keywords**:
186
+ - Remove stop words (the, a, an, for, with, etc.)
187
+ - Identify 2-4 most meaningful words
188
+ - Use action-noun format where possible
189
+
190
+ 2. **Format**:
191
+ - Lowercase
192
+ - Hyphen-separated
193
+ - Max 50 characters
194
+ - Example: `stripe-payment-integration` from "Integrate Stripe payment processing"
195
+
196
+ 3. **Validate**:
197
+ - Check for existing features with similar names
198
+ - Ensure uniqueness
199
+ - Avoid abbreviations unless well-known
200
+
201
+ ### Step 3: Auto-Number Feature
202
+
203
+ Determine the next feature number:
204
+
205
+ 1. **Scan Existing**:
206
+ - Read `.specweave/increments/` directory
207
+ - Extract all `0001-9999` prefixes (4-digit format)
208
+ - Also check legacy `001-999` formats (3-digit) to prevent conflicts
209
+ - Find highest number
210
+
211
+ 2. **Increment**:
212
+ - Add 1 to highest number
213
+ - Zero-pad to 4 digits (e.g., 0001, 0002, ..., 0010, 0011, ..., 0999, 1000, ..., 9999)
214
+
215
+ 3. **Duplicate Detection**:
216
+ - Check if increment number already exists
217
+ - Throw error if duplicate found (prevents creating 0002 when 0002 exists)
218
+ - This prevents the naming conflict shown in the image where two 0002-* increments existed
219
+
220
+ 4. **Create Path**:
221
+ - Format: `.specweave/increments/0001-short-name/`
222
+ - Example: `.specweave/increments/0003-stripe-payment-integration/`
223
+
224
+ ### Step 4: Create Feature Structure
225
+
226
+ Generate the complete feature directory with all required files:
227
+
228
+ ```
229
+ .specweave/increments/####-short-name/
230
+ ├── spec.md # Feature specification (WHAT and WHY)
231
+ ├── plan.md # Implementation plan (HOW)
232
+ ├── tasks.md # Executable tasks (STEPS)
233
+ ├── tests.md # Test strategy and cases
234
+ └── context-manifest.yaml # Context loading specification
235
+ ```
236
+
237
+ ### Step 5: Generate spec.md
238
+
239
+ **Purpose**: Define WHAT this feature does and WHY it's needed.
240
+
241
+ **Structure**:
242
+ ```yaml
243
+ ---
244
+ feature: 0001-short-name
245
+ title: "Human-Readable Feature Title"
246
+ priority: P1 | P2 | P3
247
+ status: planned
248
+ created: YYYY-MM-DD
249
+ ---
250
+
251
+ # Feature: [Title]
252
+
253
+ ## Overview
254
+ [High-level description of the feature]
255
+
256
+ ## User Value
257
+ [Why this feature matters to users]
258
+
259
+ ## User Stories
260
+
261
+ ### US1: [Title] (P1)
262
+ **As a** [user type]
263
+ **I want** [goal]
264
+ **So that** [benefit]
265
+
266
+ **Acceptance Criteria**:
267
+ - [ ] [Specific, measurable criterion]
268
+ - [ ] [Another criterion]
269
+
270
+ ### US2: [Title] (P2)
271
+ ...
272
+
273
+ ## Functional Requirements
274
+
275
+ ### FR-001: [Requirement]
276
+ [Detailed description]
277
+
278
+ ### FR-002: [Requirement]
279
+ ...
280
+
281
+ ## Success Criteria
282
+ [Measurable outcomes that define feature success]
283
+
284
+ ## Out of Scope
285
+ [What this feature explicitly does NOT include]
286
+
287
+ ## Dependencies
288
+ [Other features or systems this depends on]
289
+
290
+ ## References
291
+ - [Related specs]
292
+ - [Architecture docs]
293
+ - [ADRs]
294
+ ```
295
+
296
+ **Key Principles**:
297
+ - Technology-agnostic (no HOW, only WHAT and WHY)
298
+ - Focused on user value
299
+ - Measurable acceptance criteria
300
+ - Prioritized user stories (P1/P2/P3)
301
+
302
+ ### Step 6: Generate plan.md
303
+
304
+ **Purpose**: Define HOW to implement the feature technically.
305
+
306
+ **Structure**:
307
+ ```markdown
308
+ # Implementation Plan: [Feature Title]
309
+
310
+ ## Overview
311
+ [Technical summary of implementation approach]
312
+
313
+ ## Architecture
314
+
315
+ ### Components
316
+ [List major components to build/modify]
317
+
318
+ ### Data Model
319
+ [Entities, relationships, schema changes]
320
+
321
+ ### API Contracts
322
+ [Endpoints, methods, request/response formats]
323
+
324
+ ### Integration Points
325
+ [External services, internal modules]
326
+
327
+ ## Technology Decisions
328
+
329
+ ### Technology Stack
330
+ - [Language/framework]
331
+ - [Libraries]
332
+ - [Tools]
333
+
334
+ ### ADRs Required
335
+ - [List architecture decisions to document]
336
+
337
+ ## Implementation Approach
338
+
339
+ ### Phase 1: Foundation
340
+ [Setup, infrastructure, base components]
341
+
342
+ ### Phase 2: Core Functionality
343
+ [Primary features from P1 user stories]
344
+
345
+ ### Phase 3: Enhancement
346
+ [P2 features and optimizations]
347
+
348
+ ### Phase 4: Polish
349
+ [P3 features, error handling, edge cases]
350
+
351
+ ## Technical Challenges
352
+
353
+ ### Challenge 1: [Description]
354
+ **Solution**: [Approach]
355
+ **Risk**: [Mitigation strategy]
356
+
357
+ ## File Structure
358
+ ```
359
+ [Show directory structure of code to create/modify]
360
+ ```
361
+
362
+ ## Testing Strategy
363
+ [High-level testing approach, see tests.md for details]
364
+
365
+ ## Deployment Considerations
366
+ [Infrastructure, environment, rollout]
367
+
368
+ ## Performance Targets
369
+ [Response times, throughput, resource usage]
370
+
371
+ ## Security Considerations
372
+ [Authentication, authorization, data protection]
373
+ ```
374
+
375
+ **Key Principles**:
376
+ - Technology-specific (HOW to build it)
377
+ - Architectural decisions documented
378
+ - Challenges and solutions identified
379
+ - Constitutional compliance checked
380
+
381
+ ### Step 7: Generate tasks.md
382
+
383
+ **Purpose**: Break down implementation into executable steps.
384
+
385
+ **Structure**:
386
+ ```markdown
387
+ # Tasks: [Feature Title]
388
+
389
+ ## Task Notation
390
+
391
+ - `[T###]`: Sequential task ID
392
+ - `[P]`: Parallelizable (no file conflicts)
393
+ - `[US#]`: User story reference
394
+ - `[ ]`: Not started
395
+ - `[x]`: Completed
396
+
397
+ ## Phase 1: Setup and Foundation
398
+
399
+ - [ ] [T001] [P] Initialize project structure
400
+ - [ ] [T002] [P] Setup testing framework
401
+ - [ ] [T003] Install dependencies
402
+
403
+ ## Phase 2: Core Implementation
404
+
405
+ ### US1: [User Story Title] (P1)
406
+
407
+ - [ ] [T004] Write test for [component]
408
+ - [ ] [T005] Implement [component] in src/path/file.ts
409
+ - [ ] [T006] [P] Create [another component]
410
+ - [ ] [T007] Integrate components
411
+ - [ ] [T008] Verify US1 acceptance criteria
412
+
413
+ ### US2: [User Story Title] (P2)
414
+
415
+ - [ ] [T009] Write test for [feature]
416
+ - [ ] [T010] Implement [feature]
417
+ ...
418
+
419
+ ## Phase 3: Testing and Validation
420
+
421
+ - [ ] [T050] Run integration tests
422
+ - [ ] [T051] Performance testing
423
+ - [ ] [T052] Security review
424
+ - [ ] [T053] Documentation update
425
+
426
+ ## Phase 4: Deployment
427
+
428
+ - [ ] [T060] Prepare deployment scripts
429
+ - [ ] [T061] Staging deployment
430
+ - [ ] [T062] Production deployment
431
+
432
+ ## Dependencies
433
+
434
+ T005 depends on T004 (test must exist first)
435
+ T007 depends on T005, T006 (components must exist)
436
+ T051 depends on T050 (integration must pass first)
437
+ ```
438
+
439
+ **Key Principles**:
440
+ - Story-centric organization (not layer-centric)
441
+ - Test-first sequence (tests before implementation)
442
+ - Exact file paths specified
443
+ - Parallelizable tasks marked `[P]`
444
+ - Dependencies explicitly stated
445
+
446
+ ### Step 8: Generate tests.md
447
+
448
+ **Purpose**: Define comprehensive testing strategy and test cases.
449
+
450
+ **Structure**:
451
+ ```markdown
452
+ # Test Strategy: [Feature Title]
453
+
454
+ ## Test Philosophy
455
+
456
+ Follow SpecWeave Constitution Article III: Test-First Development
457
+ - Tests written before implementation
458
+ - Tests must fail initially (red-green-refactor)
459
+ - Integration tests with real environments
460
+
461
+ ## Test Categories
462
+
463
+ ### Unit Tests
464
+ [Component-level tests]
465
+
466
+ ### Integration Tests
467
+ [Module integration tests]
468
+
469
+ ### E2E Tests
470
+ [End-to-end user flows]
471
+
472
+ ### Performance Tests
473
+ [Load, stress, scalability tests]
474
+
475
+ ## Test Cases
476
+
477
+ ### TC-001: [Test Name]
478
+ **Type**: Unit | Integration | E2E
479
+ **Priority**: P1 | P2 | P3
480
+ **User Story**: US1
481
+
482
+ **Scenario**:
483
+ - Given [precondition]
484
+ - When [action]
485
+ - Then [expected outcome]
486
+
487
+ **Test Data**:
488
+ [Sample inputs]
489
+
490
+ **Expected Results**:
491
+ [Specific, measurable outcomes]
492
+
493
+ ### TC-002: [Test Name]
494
+ ...
495
+
496
+ ## Test Coverage Targets
497
+
498
+ - Unit test coverage: >80%
499
+ - Integration test coverage: Critical paths
500
+ - E2E coverage: All P1 user stories
501
+
502
+ ## Testing Tools
503
+
504
+ - Unit: [Framework]
505
+ - Integration: [Framework]
506
+ - E2E: [Framework]
507
+
508
+ ## Test Environments
509
+
510
+ - Local: [Setup]
511
+ - CI/CD: [Pipeline]
512
+ - Staging: [Environment]
513
+
514
+ ## Regression Testing
515
+
516
+ For brownfield modifications:
517
+ 1. Document existing behavior
518
+ 2. Create tests for current functionality
519
+ 3. User validation of tests
520
+ 4. Implement changes
521
+ 5. Verify regression tests still pass
522
+
523
+ ## Success Criteria
524
+
525
+ - [ ] All P1 tests passing
526
+ - [ ] Coverage targets met
527
+ - [ ] Performance tests pass
528
+ - [ ] No regressions detected
529
+ ```
530
+
531
+ **Key Principles**:
532
+ - Test-first philosophy
533
+ - Comprehensive coverage (unit, integration, E2E)
534
+ - Clear test cases with Given-When-Then
535
+ - Regression prevention for brownfield
536
+ - Measurable success criteria
537
+
538
+ ### Step 9: Generate context-manifest.yaml
539
+
540
+ **Purpose**: Declare exactly what specifications, architecture docs, and ADRs are needed for this feature.
541
+
542
+ **Structure**:
543
+ ```yaml
544
+ ---
545
+ # Context Manifest for Feature: 0001-short-name
546
+
547
+ # Specification sections to load
548
+ spec_sections:
549
+ - specs/modules/[relevant-module]/**/*.md
550
+ - specs/constitution.md#[relevant-article]
551
+ - specs/overview.md
552
+
553
+ # Architecture documents to load
554
+ architecture:
555
+ - architecture/system-design.md#[relevant-section]
556
+ - architecture/data/database-schema.md#[relevant-tables]
557
+ - architecture/[component]/[relevant-doc].md
558
+
559
+ # Architecture Decision Records to reference
560
+ adrs:
561
+ - adrs/0001-[relevant-decision].md
562
+
563
+ # Context budget (max tokens to load)
564
+ max_context_tokens: 10000
565
+
566
+ # Priority level
567
+ priority: high | medium | low
568
+
569
+ # Auto-refresh context on spec changes
570
+ auto_refresh: false
571
+
572
+ # Related features
573
+ related_features:
574
+ - 0001-[other-feature]
575
+
576
+ # Tags for search and categorization
577
+ tags:
578
+ - [category]
579
+ - [domain]
580
+ ---
581
+ ```
582
+
583
+ **Key Principles**:
584
+ - Precision loading (only what's needed)
585
+ - Section-level granularity (e.g., `#authentication-flow`)
586
+ - Token budget to prevent bloat
587
+ - Related features for dependency tracking
588
+
589
+ ### Step 10: Validate and Finalize
590
+
591
+ Before completing:
592
+
593
+ 1. **Constitutional Compliance**:
594
+ - Article V: Modular Scalability (proper structure)
595
+ - Article VI: Separation of Concerns (spec vs plan vs tasks)
596
+ - Article IX: Testing Mandate (tests.md comprehensive)
597
+
598
+ 2. **Quality Checks**:
599
+ - spec.md is technology-agnostic
600
+ - plan.md has sufficient technical detail
601
+ - tasks.md has exact file paths
602
+ - tests.md covers all P1 user stories
603
+ - context-manifest.yaml is precise
604
+
605
+ 3. **Update Features Index**:
606
+ - Add feature to `features/README.md`
607
+ - Update current features list
608
+
609
+ 4. **Notify User**:
610
+ - Feature number and path
611
+ - Next steps (review spec, approve plan)
612
+ - How to start implementation
613
+
614
+ ## Best Practices
615
+
616
+ ### Writing Effective Specs
617
+
618
+ 1. **Focus on User Value**:
619
+ - Start with "As a user, I want..."
620
+ - Explain WHY, not just WHAT
621
+ - Measurable success criteria
622
+
623
+ 2. **Prioritize Ruthlessly**:
624
+ - P1: Must-have for MVP
625
+ - P2: Important but not blocking
626
+ - P3: Nice-to-have
627
+
628
+ 3. **Be Specific**:
629
+ - Acceptance criteria are testable
630
+ - Out-of-scope is explicitly defined
631
+ - Dependencies are identified
632
+
633
+ ### Writing Effective Plans
634
+
635
+ 1. **Document Decisions**:
636
+ - Why this technology choice?
637
+ - What alternatives were considered?
638
+ - What are the trade-offs?
639
+
640
+ 2. **Identify Challenges**:
641
+ - Technical risks
642
+ - Complexity areas
643
+ - Mitigation strategies
644
+
645
+ 3. **Show Structure**:
646
+ - File organization
647
+ - Component relationships
648
+ - Integration points
649
+
650
+ ### Writing Effective Tasks
651
+
652
+ 1. **Story-Centric Organization**:
653
+ - Group by user story, not by layer
654
+ - Enables independent implementation
655
+ - Supports incremental delivery
656
+
657
+ 2. **Test-First Sequencing**:
658
+ - Test task before implementation task
659
+ - Enforce TDD workflow
660
+ - Red-green-refactor
661
+
662
+ 3. **Clear Dependencies**:
663
+ - Explicitly state what depends on what
664
+ - Identify parallelizable work
665
+ - Enable concurrent execution
666
+
667
+ ## Example: Creating a Feature
668
+
669
+ ### User Request
670
+ "I want to add Stripe payment integration to handle subscriptions"
671
+
672
+ ### Execution
673
+
674
+ **Step 1**: Analyze
675
+ - Core value: Process recurring payments
676
+ - Problem: Need subscription billing
677
+ - Priority: P1 (required for MVP)
678
+
679
+ **Step 2**: Short name
680
+ - Keywords: stripe, payment, integration
681
+ - Format: `stripe-payment-integration`
682
+
683
+ **Step 3**: Auto-number
684
+ - Scan .specweave/increments/: 0001, 0002
685
+ - Next: 0003
686
+ - Path: `.specweave/increments/0003-stripe-payment-integration/`
687
+
688
+ **Step 4**: Create structure
689
+ ```
690
+ .specweave/increments/0003-stripe-payment-integration/
691
+ ├── spec.md
692
+ ├── plan.md
693
+ ├── tasks.md
694
+ ├── tests.md
695
+ └── context-manifest.yaml
696
+ ```
697
+
698
+ **Step 5**: Generate spec.md
699
+ ```yaml
700
+ ---
701
+ feature: 003-stripe-payment-integration
702
+ title: "Stripe Payment Integration"
703
+ priority: P1
704
+ status: planned
705
+ created: 2025-01-25
706
+ ---
707
+
708
+ # Feature: Stripe Payment Integration
709
+
710
+ ## Overview
711
+ Integrate Stripe to handle subscription payments...
712
+
713
+ ## User Stories
714
+
715
+ ### US1: Process Subscription Payment (P1)
716
+ As a customer
717
+ I want to subscribe to a plan
718
+ So that I can access premium features
719
+
720
+ Acceptance Criteria:
721
+ - [ ] Customer can select subscription plan
722
+ - [ ] Payment processed via Stripe
723
+ - [ ] Subscription activated on success
724
+ ...
725
+ ```
726
+
727
+ **Step 6**: Generate plan.md
728
+ ```markdown
729
+ # Implementation Plan: Stripe Payment Integration
730
+
731
+ ## Technology Decisions
732
+ - Stripe SDK: stripe-node v11.x
733
+ - Backend: Express.js middleware
734
+ - Frontend: Stripe Elements
735
+
736
+ ## Components
737
+ - StripeService: Payment processing
738
+ - SubscriptionController: API endpoints
739
+ - WebhookHandler: Stripe events
740
+ ...
741
+ ```
742
+
743
+ **Step 7**: Generate tasks.md
744
+ ```markdown
745
+ # Tasks: Stripe Payment Integration
746
+
747
+ ## Phase 2: Core Implementation
748
+
749
+ ### US1: Process Subscription Payment (P1)
750
+
751
+ - [ ] [T001] Write test for StripeService.createSubscription()
752
+ - [ ] [T002] Implement StripeService in src/services/stripe-service.ts
753
+ - [ ] [T003] [P] Create SubscriptionController in src/controllers/subscription.ts
754
+ ...
755
+ ```
756
+
757
+ **Step 8**: Generate tests.md
758
+ ```markdown
759
+ # Test Strategy: Stripe Payment Integration
760
+
761
+ ## Test Cases
762
+
763
+ ### TC-001: Successful Subscription Creation
764
+ Type: Integration
765
+ Priority: P1
766
+ User Story: US1
767
+
768
+ Scenario:
769
+ - Given a valid customer and plan ID
770
+ - When createSubscription() is called
771
+ - Then subscription is created in Stripe
772
+ - And webhook confirms activation
773
+ ...
774
+ ```
775
+
776
+ **Step 9**: Generate context-manifest.yaml
777
+ ```yaml
778
+ spec_sections:
779
+ - specs/modules/payments/overview.md
780
+ - specs/modules/payments/stripe/spec.md
781
+ architecture:
782
+ - architecture/data/database-schema.md#subscriptions
783
+ adrs:
784
+ - adrs/005-payment-provider-choice.md
785
+ max_context_tokens: 8000
786
+ priority: high
787
+ ```
788
+
789
+ **Step 10**: Validate
790
+ - ✅ spec.md is technology-agnostic
791
+ - ✅ plan.md documents Stripe SDK choice
792
+ - ✅ tasks.md follows test-first
793
+ - ✅ tests.md covers all P1 stories
794
+ - ✅ Constitutional compliance verified
795
+
796
+ **Output**:
797
+ ```
798
+ ✅ Feature created: 0003-stripe-payment-integration
799
+
800
+ Location: .specweave/increments/0003-stripe-payment-integration/
801
+ Files created:
802
+ - spec.md
803
+ - plan.md
804
+ - tasks.md
805
+ - tests.md
806
+ - context-manifest.yaml
807
+
808
+ Next steps:
809
+ 1. Review spec.md - verify user stories and acceptance criteria
810
+ 2. Approve plan.md - validate technical approach
811
+ 3. Start implementation: specweave implement 0003
812
+ ```
813
+
814
+ ## Helper Scripts
815
+
816
+ ### `scripts/create-feature.js`
817
+
818
+ Creates feature directory structure and generates all files.
819
+
820
+ **Usage**:
821
+ ```javascript
822
+ const featurePlanner = require('./create-feature.js');
823
+
824
+ const feature = await featurePlanner.createFeature({
825
+ description: "Add Stripe payment integration",
826
+ priority: "P1",
827
+ configPath: ".specweave/config.yaml"
828
+ });
829
+
830
+ console.log(`Created: .specweave/increments/${feature.number}-${feature.shortName}/`);
831
+ ```
832
+
833
+ ### `scripts/generate-short-name.js`
834
+
835
+ Generates short names from descriptions.
836
+
837
+ **Usage**:
838
+ ```javascript
839
+ const { generateShortName } = require('./generate-short-name.js');
840
+
841
+ const shortName = generateShortName("Integrate Stripe payment processing");
842
+ // Returns: "stripe-payment-integration"
843
+ ```
844
+
845
+ ### `scripts/next-feature-number.js`
846
+
847
+ Determines next available feature number.
848
+
849
+ **Usage**:
850
+ ```javascript
851
+ const { getNextFeatureNumber } = require('./feature-utils.js');
852
+
853
+ const next = getNextFeatureNumber(".specweave/increments/");
854
+ // Returns: "0003"
855
+ ```
856
+
857
+ ## Constitutional Compliance
858
+
859
+ This skill enforces:
860
+
861
+ - **Article V**: Modular Scalability - Auto-numbered features prevent conflicts
862
+ - **Article VI**: Separation of Concerns - spec vs plan vs tasks are distinct
863
+ - **Article IX**: Skill Testing Mandate - tests.md ensures comprehensive testing
864
+
865
+ ## Integration with Other Skills
866
+
867
+ - **context-loader**: Uses context manifests to load relevant specs
868
+ - **spec-author**: Collaborates on specification creation
869
+ - **architect**: Collaborates on technical planning
870
+ - **developer**: Consumes tasks.md for implementation
871
+ - **docs-updater**: Updates features/README.md automatically
872
+
873
+ ## Troubleshooting
874
+
875
+ ### Issue: Feature number conflict
876
+ **Solution**: The `incrementNumberExists()` function now prevents this by checking for duplicate numbers before creating new increments. If you see this error, use `getNextFeatureNumber()` to get the next available number.
877
+
878
+ ### Issue: Short name too long
879
+ **Solution**: Use abbreviations for well-known terms (e.g., auth, api, db)
880
+
881
+ ### Issue: Context manifest too broad
882
+ **Solution**: Use section anchors (e.g., `#specific-section`) instead of full files
883
+
884
+ ### Issue: Legacy 3-digit increments (001, 002, 003)
885
+ **Solution**: The utility now detects both 3-digit and 4-digit formats to prevent conflicts. New increments always use 4-digit format (0001-9999).
886
+
887
+ ---
888
+
889
+ This skill ensures every SpecWeave feature is properly planned, structured, and ready for implementation with constitutional compliance and best practices built-in.