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
@@ -1,6 +1,6 @@
1
1
  ---
2
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, new product, build project, MVP, SaaS, app development, product description, tech stack planning, feature list.
3
+ description: Creates comprehensive implementation plans for ANY type of SpecWeave increment (feature, hotfix, bug, change-request, refactor, experiment). Supports all work types from features to bug investigations to POCs. Activates for: increment planning, feature planning, hotfix, bug investigation, root cause analysis, SRE investigation, change request, refactor, POC, prototype, spike work, experiment, implementation plan, create increment, organize work, break down work, new product, build project, MVP, SaaS, app development, tech stack planning, production issue, critical bug, stakeholder request.
4
4
  ---
5
5
 
6
6
  # Increment Planner Skill
@@ -11,10 +11,11 @@ description: Creates comprehensive implementation plans for SpecWeave increments
11
11
  - **[Increment Lifecycle Guide](.specweave/docs/internal/delivery/guides/increment-lifecycle.md)**
12
12
 
13
13
  This guide contains:
14
- - Complete increment structure (spec.md, plan.md, tasks.md, tests.md)
14
+ - Complete increment structure (spec.md, plan.md, tasks.md with embedded tests)
15
15
  - WIP limits and status progression
16
16
  - Task vs increment decision tree
17
17
  - Context manifest creation for 70%+ token reduction
18
+ - **v0.7.0+**: Test-Aware Planning (tests embedded in tasks.md, no separate tests.md)
18
19
 
19
20
  **Load this guide using the Read tool BEFORE creating feature plans.**
20
21
 
@@ -24,31 +25,62 @@ This skill creates comprehensive, well-structured implementation plans for SpecW
24
25
 
25
26
  ## Purpose
26
27
 
27
- The increment-planner skill automates the creation of feature implementation plans, ensuring:
28
- - Auto-numbered feature directories (`0001-9999` 4-digit format)
28
+ The increment-planner skill automates the creation of implementation plans for ANY type of work:
29
+ - Auto-numbered increment directories (`0001-9999` 4-digit format)
29
30
  - Duplicate detection (prevents creating 0002 when 0002 already exists)
30
- - Complete feature artifacts (spec.md, plan.md, tasks.md, tests.md)
31
+ - Complete increment artifacts (spec.md, plan.md, tasks.md with embedded tests)
31
32
  - Proper context manifests for selective loading
32
33
  - Constitutional compliance
33
- - Separation of WHAT/WHY (spec) from HOW (plan) from STEPS (tasks)
34
+ - Separation of WHAT/WHY (spec) from HOW (plan) from STEPS (tasks with test plans)
35
+ - **v0.7.0+**: Test-Aware Planning (bidirectional AC↔Task↔Test linking)
36
+
37
+ ## Increment Types (v0.7.0+)
38
+
39
+ **Increments can be any type of work**, not just features. SpecWeave supports six types:
40
+
41
+ | Type | Description | Use When | Limit |
42
+ |------|-------------|----------|-------|
43
+ | **feature** | Standard feature development | Adding new functionality | Max 2 active |
44
+ | **hotfix** | Critical production fixes | Production is broken | Unlimited |
45
+ | **bug** | Production bugs with SRE investigation | Bug requires root cause analysis | Unlimited |
46
+ | **change-request** | Stakeholder requests | Business requirements change | Max 2 active |
47
+ | **refactor** | Code improvement | Technical debt, code quality | Max 1 active |
48
+ | **experiment** | POC/spike work | Exploring options, prototypes | Unlimited* |
49
+
50
+ **Examples**:
51
+ - **Feature**: "Add user authentication", "Implement payment processing"
52
+ - **Hotfix**: "Fix critical security vulnerability CVE-2024-1234"
53
+ - **Bug**: "Investigate memory leak in production API", "Performance degradation in checkout flow"
54
+ - **Change Request**: "Redesign dashboard per stakeholder feedback"
55
+ - **Refactor**: "Extract service layer from monolith", "Migrate to TypeScript"
56
+ - **Experiment**: "Evaluate GraphQL vs REST", "Prototype real-time collaboration"
57
+
58
+ **Key Insight**: The increment structure (spec.md, plan.md, tasks.md) works for ALL types. Even a bug investigation needs:
59
+ - **spec.md**: What's broken? Expected vs actual behavior? Impact?
60
+ - **plan.md**: Investigation approach, tools, hypothesis
61
+ - **tasks.md**: Investigation steps, fix implementation, verification
34
62
 
35
63
  ## When to Use This Skill
36
64
 
37
65
  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
66
+ - **Features**: Creating new functionality from a description
67
+ - **Hotfixes**: Planning urgent production fixes
68
+ - **Bugs**: Structuring SRE investigations and root cause analysis
69
+ - **Change Requests**: Organizing stakeholder-driven changes
70
+ - **Refactors**: Planning code improvement work
71
+ - **Experiments**: Structuring POCs and technical spikes
72
+ - **Brownfield**: Structuring modifications to existing codebases
43
73
 
44
74
  ## Activation Triggers
45
75
 
46
76
  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: ..."
77
+ - **Features**: "Plan a feature for...", "Create implementation plan for..."
78
+ - **Hotfixes**: "Fix critical bug in production", "Emergency security patch"
79
+ - **Bugs**: "Investigate memory leak", "Debug performance issue", "Root cause analysis for..."
80
+ - **Change Requests**: "Stakeholder requested...", "Business wants to change..."
81
+ - **Refactors**: "Refactor...", "Extract service layer", "Improve code quality"
82
+ - **Experiments**: "Prototype...", "Evaluate...", "POC for...", "Spike work"
83
+ - **General**: "Create increment for...", "Help me structure [work]", "Break down this work: ..."
52
84
 
53
85
  ---
54
86
 
@@ -79,20 +111,39 @@ Task(
79
111
 
80
112
  Context from existing docs: [summary of strategy docs from Step 1]
81
113
 
82
- You MUST create BOTH living docs AND increment files:
83
-
84
- 1. Living docs (source of truth):
85
- - Create .specweave/docs/internal/strategy/{module-name}/
86
- * overview.md (product vision, problem, users)
87
- * requirements.md (FR-001, NFR-001, technology-agnostic)
88
- * user-stories.md (US1, US2, US3...)
89
- * success-criteria.md (KPIs, metrics)
90
-
91
- 2. Increment file:
114
+ You MUST create living Spec (living docs - source of truth) AND optionally create increment spec.md:
115
+
116
+ 1. Spec (living docs - SOURCE OF TRUTH, permanent):
117
+ - Create .specweave/docs/internal/specs/spec-{number}-{name}/spec.md
118
+ - This is the COMPLETE, PERMANENT source of truth
119
+ - Include ALL of:
120
+ * User stories (US-001, US-002, etc.) with full details
121
+ * Acceptance criteria (AC-US1-01, etc.)
122
+ * Functional requirements (FR-001, etc.)
123
+ * Non-functional requirements (NFR-001, etc.)
124
+ * Success criteria (metrics, KPIs)
125
+ * Test strategy
126
+ - This spec can be linked to Jira/ADO/GitHub Issues
127
+ - Spec persists even after increment completes
128
+ - No line limit (be thorough, this is source of truth)
129
+
130
+ 2. Strategy docs (optional, high-level ONLY):
131
+ - IF this is a NEW module/product, create:
132
+ .specweave/docs/internal/strategy/{module-name}/
133
+ * overview.md (high-level product vision, market opportunity, personas)
134
+ * business-case.md (optional - ROI, competitive analysis)
135
+ - IMPORTANT:
136
+ * ❌ NO detailed user stories (those go in living spec.md)
137
+ * ❌ NO detailed requirements (those go in living spec.md)
138
+ * ❌ NO acceptance criteria (those go in living spec.md)
139
+ * ✅ ONLY strategic, high-level business context
140
+
141
+ 3. Increment spec.md (optional, can duplicate living spec):
92
142
  - Create .specweave/increments/{number}-{name}/spec.md
93
- - Keep spec.md < 250 lines (summary only)
94
- - MUST reference living docs
95
- - Include links to ../../docs/internal/strategy/{module}/
143
+ - This CAN duplicate content from living spec.md (temporary reference - that's OK!)
144
+ - OR it can just reference the spec: \"See SPEC-{number}-{name} for complete requirements\"
145
+ - Increment spec.md may be deleted after increment completes
146
+ - Living spec.md persists as permanent documentation
96
147
 
97
148
  Tech stack: [detected tech stack]"
98
149
  )
@@ -132,74 +183,163 @@ Task(
132
183
 
133
184
  Wait for Architect agent to complete!
134
185
 
135
- STEP 4: Validate Living Docs
136
- ├─ Check .specweave/docs/internal/strategy/{module}/ is NOT empty
186
+ STEP 4: Invoke Test-Aware Planner Agent (🚨 MANDATORY - USE TASK TOOL)
187
+
188
+ YOU MUST USE THE TASK TOOL - DO NOT SKIP:
189
+
190
+ Task(
191
+ subagent_type: "test-aware-planner",
192
+ description: "Generate tasks with embedded tests",
193
+ prompt: "Create tasks.md with embedded test plans for: [user feature description]
194
+
195
+ FIRST, read the increment files:
196
+ - .specweave/increments/{number}-{name}/spec.md (user stories with AC-IDs)
197
+ - .specweave/increments/{number}-{name}/plan.md (technical architecture)
198
+
199
+ You MUST create tasks.md with embedded test plans:
200
+
201
+ Generate .specweave/increments/{number}-{name}/tasks.md:
202
+ - Parse spec.md for user stories (US1, US2) and AC-IDs (AC-US1-01, etc.)
203
+ - Parse plan.md for technical architecture and test strategy
204
+ - Generate tasks with embedded test plans (NO separate tests.md)
205
+ - Each task includes:
206
+ * Test Plan (Given/When/Then in BDD format)
207
+ * Test Cases (unit/integration/E2E with file paths and function names)
208
+ * Coverage Targets (80-90% overall)
209
+ * Implementation steps
210
+ * TDD workflow (if test_mode: TDD)
211
+ - For non-testable tasks (docs, config): Use Validation section
212
+ - Ensure all AC-IDs from spec.md are covered
213
+
214
+ Follow the workflow in plugins/specweave/agents/test-aware-planner/AGENT.md
215
+ Use templates from plugins/specweave/agents/test-aware-planner/templates/
216
+
217
+ Tech stack: [detected tech stack]"
218
+ )
219
+
220
+ Wait for test-aware-planner agent to complete!
221
+
222
+ STEP 5: Validate Living Docs and Increment Files
223
+ ├─ Check .specweave/docs/internal/specs/spec-{number}-{name}/spec.md exists (SOURCE OF TRUTH)
224
+ ├─ Check living spec.md contains ALL user stories, requirements, AC-IDs (with AC-IDs)
137
225
  ├─ Check .specweave/docs/internal/architecture/adr/ has ≥3 ADRs
138
- ├─ Check increment spec.md REFERENCES (not duplicates) strategy docs
139
- └─ Check increment plan.md REFERENCES (not duplicates) architecture docs
226
+ ├─ Check strategy docs (if created) are high-level only (no detailed user stories)
227
+ ├─ Check .specweave/increments/{number}-{name}/spec.md references or duplicates living spec
228
+ ├─ Check .specweave/increments/{number}-{name}/plan.md references architecture docs
229
+ ├─ Check .specweave/increments/{number}-{name}/tasks.md has embedded test plans
230
+ └─ Check tasks.md covers ALL AC-IDs from living spec.md
140
231
 
141
- ✅ SUCCESS: Living docs updated, increment created
232
+ ✅ SUCCESS: Living spec created (permanent), increment created (temporary)
142
233
  ```
143
234
 
144
235
  ### What Gets Created
145
236
 
146
- #### Living Docs (Source of Truth) ✅
237
+ #### Living Spec (Living Docs - Source of Truth) ✅
147
238
  ```
148
- .specweave/docs/
149
- ├── internal/
150
- │ ├── strategy/
151
- │ │ └── {module}/ # PM Agent creates this
152
- │ │ ├── overview.md # Product vision, problem statement
153
- │ │ ├── requirements.md # Complete FR/NFR (technology-agnostic)
154
- │ │ ├── user-stories.md # All user stories (US1, US2, ...)
155
- │ │ └── success-criteria.md # KPIs, business metrics
156
- │ │
157
- │ └── architecture/
158
- │ ├── system-design.md # ← Architect updates this
159
- │ ├── adr/ # ← Architect creates ADRs
160
- │ │ ├── ####-websocket-vs-polling.md
161
- │ │ ├── ####-database-choice.md
162
- │ │ └── ####-deployment-platform.md
163
- │ ├── diagrams/ # ← Architect creates diagrams
164
- │ │ └── {module}/
165
- │ │ ├── system-context.mmd # C4 Level 1
166
- │ │ └── system-container.mmd # C4 Level 2
167
- │ └── data-models/
168
- │ └── {module}-schema.sql
239
+ .specweave/docs/internal/specs/
240
+ └── spec-{number}-{name}/ # ← PM Agent (MANDATORY)
241
+ └── spec.md # COMPLETE user stories, AC, requirements
242
+ # This is the PERMANENT source of truth
243
+ # Can be linked to Jira/ADO/GitHub Issues
244
+ # Persists after increment completes
169
245
  ```
170
246
 
171
- #### Increment Files (Summary)
247
+ #### Strategy Docs (Optional, High-Level) ⚠️
248
+ ```
249
+ .specweave/docs/internal/strategy/
250
+ └── {module}/ # ← PM Agent (only if NEW module)
251
+ ├── overview.md # High-level product vision, market opportunity
252
+ └── business-case.md # (optional) ROI, competitive analysis
253
+
254
+ ❌ NO requirements.md (goes in living spec.md)
255
+ ❌ NO user-stories.md (goes in living spec.md)
256
+ ❌ NO success-criteria.md (goes in living spec.md)
257
+ ```
258
+
259
+ #### Architecture Docs (Living Documentation) ✅
260
+ ```
261
+ .specweave/docs/internal/architecture/
262
+ ├── system-design.md # ← Architect updates this
263
+ ├── adr/ # ← Architect creates ADRs
264
+ │ ├── ####-websocket-vs-polling.md
265
+ │ ├── ####-database-choice.md
266
+ │ └── ####-deployment-platform.md
267
+ ├── diagrams/ # ← Architect creates diagrams
268
+ │ └── {module}/
269
+ │ ├── system-context.mmd # C4 Level 1
270
+ │ └── system-container.mmd # C4 Level 2
271
+ └── data-models/
272
+ └── {module}-schema.sql
273
+ ```
274
+
275
+ #### Increment Files (Temporary Implementation Tracker) ✅
172
276
  ```
173
277
  .specweave/increments/0001-feature-name/
174
- ├── spec.md # ← PM Agent (< 250 lines, references strategy docs)
175
- ├── plan.md # Architect Agent (< 500 lines, references architecture docs)
176
- ├── tasks.md # Tech Lead Agent (generated later)
177
- ├── tests.md # ← QA Agent (generated later)
278
+ ├── spec.md # ← PM Agent (CAN duplicate living spec.md - temporary reference)
279
+ # OR just reference: "See SPEC-0001-feature-name"
280
+ # May be deleted after increment completes
281
+ ├── plan.md # ← Architect Agent (technical design, references ADRs)
282
+ ├── tasks.md # ← test-aware-planner Agent (tasks with embedded test plans)
283
+ │ # v0.7.0+: Tests embedded in each task (BDD format)
284
+ │ # Each task includes: Test Plan, Given/When/Then, test files
178
285
  └── context-manifest.yaml # ← increment-planner creates
179
286
  ```
180
287
 
288
+ **v0.7.0 Architecture Pivot**: tests.md eliminated, tests are now embedded directly in tasks.md
289
+
290
+ **Key Difference**:
291
+ - **Living spec.md** = Permanent source of truth (persists after increment)
292
+ - **Increment spec.md** = Temporary reference (can be deleted after increment)
293
+
181
294
  ---
182
295
 
183
296
  ### Validation Rules (MANDATORY)
184
297
 
185
298
  Before completing feature planning, verify:
186
299
 
187
- **Living Docs Created**:
188
- - [ ] `.specweave/docs/internal/strategy/{module}/requirements.md` exists
300
+ **Living Spec (Living Docs - Source of Truth, Mandatory)**:
301
+ - [ ] `.specweave/docs/internal/specs/spec-{number}-{name}/spec.md` exists
302
+ - [ ] Living spec.md contains ALL user stories (US-001, US-002, etc.) with full details
303
+ - [ ] Living spec.md contains ALL acceptance criteria (AC-US1-01, etc.)
304
+ - [ ] Living spec.md contains ALL requirements (FR-001, NFR-001, etc.)
305
+ - [ ] Living spec.md contains success criteria (metrics, KPIs)
306
+ - [ ] Living spec.md may reference `../../strategy/{module}/overview.md` for context
307
+ - [ ] No line limit on living spec.md (be thorough - this is permanent!)
308
+
309
+ **Strategy Docs (Optional)**:
310
+ - [ ] If created, `.specweave/docs/internal/strategy/{module}/overview.md` is high-level only
311
+ - [ ] No detailed user stories in strategy docs (US-001, etc. - those go in Spec)
312
+ - [ ] No detailed requirements in strategy docs (FR-001, NFR-001, etc. - those go in Spec)
313
+ - [ ] Strategy docs provide business context only (market, opportunity, personas)
314
+
315
+ **Architecture Docs (Mandatory)**:
189
316
  - [ ] `.specweave/docs/internal/architecture/adr/` has ≥3 ADRs
190
- - [ ] `requirements.md` is technology-agnostic (no PostgreSQL, WebSocket, etc.)
191
317
  - [ ] ADRs follow template (Context, Decision, Alternatives, Consequences)
318
+ - [ ] Diagrams created for module (system-context, system-container)
319
+
320
+ **Increment spec.md (Optional - can duplicate living spec)**:
321
+ - [ ] `spec.md` either duplicates living spec.md OR references it ("See SPEC-{number}-{name}")
322
+ - [ ] If duplicated, content matches living spec.md
323
+
324
+ **Increment plan.md (Mandatory)**:
325
+ - [ ] `plan.md` references architecture docs (`../../docs/internal/architecture/adr/`)
326
+ - [ ] `plan.md` contains technical implementation details
192
327
 
193
- **Increment Files Reference Living Docs**:
194
- - [ ] `spec.md` has links to `../../docs/internal/strategy/{module}/`
195
- - [ ] `plan.md` has links to `../../docs/internal/architecture/adr/`
196
- - [ ] `spec.md` is < 250 lines (summary only)
197
- - [ ] `plan.md` is < 500 lines (summary only)
328
+ **Increment tasks.md (Mandatory, v0.7.0+)**:
329
+ - [ ] `tasks.md` contains tasks with embedded test plans (NO separate tests.md)
330
+ - [ ] Each testable task has Test Plan (Given/When/Then)
331
+ - [ ] Each testable task has Test Cases (unit/integration/E2E)
332
+ - [ ] Coverage targets specified (80-90% overall)
333
+ - [ ] ALL AC-IDs from Spec spec.md are covered by tasks
334
+ - [ ] Non-testable tasks have Validation section
198
335
 
199
336
  **Agents Followed Process**:
337
+ - [ ] PM Agent created Spec spec.md as permanent source of truth
200
338
  - [ ] PM Agent scanned existing strategy docs before creating new ones
201
- - [ ] Architect Agent read PM's strategy docs before creating architecture
339
+ - [ ] Architect Agent read Spec spec.md before creating architecture
202
340
  - [ ] Architect created ADRs for ALL technical decisions
341
+ - [ ] test-aware-planner Agent read Spec spec.md and plan.md before creating tasks.md
342
+ - [ ] test-aware-planner covered ALL AC-IDs from Spec with tasks
203
343
 
204
344
  ---
205
345
 
@@ -275,11 +415,12 @@ Generate the complete feature directory with all required files:
275
415
  .specweave/increments/####-short-name/
276
416
  ├── spec.md # Feature specification (WHAT and WHY)
277
417
  ├── plan.md # Implementation plan (HOW)
278
- ├── tasks.md # Executable tasks (STEPS)
279
- ├── tests.md # Test strategy and cases
418
+ ├── tasks.md # Executable tasks (STEPS) with embedded test plans (v0.7.0+)
280
419
  └── context-manifest.yaml # Context loading specification
281
420
  ```
282
421
 
422
+ **v0.7.0 Change**: tests.md eliminated - tests are now embedded in each task in tasks.md
423
+
283
424
  ### Step 5: Generate spec.md
284
425
 
285
426
  **Purpose**: Define WHAT this feature does and WHY it's needed.
@@ -345,11 +486,13 @@ created: YYYY-MM-DD
345
486
  - Measurable acceptance criteria
346
487
  - Prioritized user stories (P1/P2/P3)
347
488
 
348
- ### Step 6: Detect Required Plugins (INTELLIGENT AUTO-LOADING)
489
+ ### Step 6: Detect Required Plugins & Check PM Tool (INTELLIGENT AUTO-LOADING + PM SYNC)
349
490
 
350
- **Purpose**: Analyze spec content to identify required SpecWeave plugins and suggest installation.
491
+ **Purpose**: Analyze spec content to identify required SpecWeave plugins AND check if external PM tool sync is configured.
351
492
 
352
- **Why This Matters**: SpecWeave's plugin system enables context efficiency (70%+ reduction) by loading only relevant capabilities. This step ensures users have the right tools before implementation begins.
493
+ **Why This Matters**:
494
+ 1. SpecWeave's plugin system enables context efficiency (70%+ reduction) by loading only relevant capabilities
495
+ 2. PM tool integration enables automatic sync of increment progress to external systems (GitHub Issues, Jira, Azure DevOps)
353
496
 
354
497
  **Detection Algorithm**:
355
498
 
@@ -357,6 +500,8 @@ created: YYYY-MM-DD
357
500
  ```
358
501
  Keywords → Plugin Mapping:
359
502
  - "GitHub", "issue", "pull request", "PR" → specweave-github
503
+ - "Jira", "ticket", "epic" → specweave-jira
504
+ - "Azure DevOps", "ADO", "work item" → specweave-ado
360
505
  - "Kubernetes", "K8s", "Helm", "kubectl" → specweave-kubernetes
361
506
  - "Figma", "design system", "design tokens" → specweave-figma
362
507
  - "Stripe", "PayPal", "billing", "subscriptions" → specweave-payments
@@ -368,11 +513,19 @@ created: YYYY-MM-DD
368
513
  - "Mermaid", "C4", "diagrams", "architecture diagrams" → specweave-diagrams
369
514
  ```
370
515
 
371
- 2. **Check if plugins are already installed**:
516
+ 2. **Check External PM Tool Configuration** (NEW v0.8.0):
517
+ - Read `.specweave/config.json`
518
+ - If `externalPM.enabled = true` and `externalPM.tool` is set:
519
+ - Check if corresponding plugin installed (specweave-github, specweave-jira, or specweave-ado)
520
+ - Prepare to auto-create external issue/work item after increment creation
521
+ - If `externalPM.enabled = false` or not configured:
522
+ - Skip PM tool sync (local-only mode)
523
+
524
+ 3. **Check if plugins are already installed**:
372
525
  - For Claude Code: Check if plugin available via `/plugin list --installed`
373
526
  - Skip already-installed plugins
374
527
 
375
- 3. **Suggest installation** (if plugins detected):
528
+ 4. **Suggest installation** (if plugins detected):
376
529
  ```
377
530
  🔌 This increment requires additional plugins:
378
531
 
@@ -391,36 +544,102 @@ created: YYYY-MM-DD
391
544
  💡 Plugins will auto-activate during implementation!
392
545
  ```
393
546
 
394
- 4. **Wait for user to install** (don't block, but remind):
547
+ 5. **Auto-Sync to PM Tool** (v0.8.0+):
548
+
549
+ **🚨 CRITICAL: SpecWeave Repo Dog-Food Requirement**:
550
+ - IF repo = "anton-abyzov/specweave"
551
+ - Read `.specweave/config.json`
552
+ - Check: `plugins.settings.specweave-github.repo = "anton-abyzov/specweave"`
553
+ - IF NOT configured → ❌ **HARD ERROR** (block increment creation):
554
+ ```
555
+ ❌ SpecWeave repo MUST use GitHub sync!
556
+
557
+ This is a "dog food" requirement (ADR-0007):
558
+ - SpecWeave demonstrates its own features
559
+ - GitHub Issues show public progress
560
+ - Community can track development
561
+
562
+ Fix: Create .specweave/config.json with GitHub settings
563
+ See: CLAUDE.md for config structure
564
+ ```
565
+ - IF configured → Continue to auto-sync (required)
566
+
567
+ **For All Other Repos** (normal behavior):
568
+ - **If PM tool configured and plugin installed**:
569
+ ```
570
+ 🔗 External PM Tool Sync:
571
+ Tool: GitHub Issues
572
+ Auto-sync: Enabled
573
+
574
+ Creating GitHub issue for increment 0007-user-authentication...
575
+ ✅ GitHub Issue #42 created
576
+ URL: https://github.com/myorg/myapp/issues/42
577
+ Linked to: .specweave/increments/0007-user-authentication/metadata.json
578
+
579
+ Progress will sync automatically after each task completion!
580
+ ```
581
+ - **If PM tool configured but plugin NOT installed**:
582
+ ```
583
+ ⚠️ External PM Tool Configured: GitHub Issues
584
+ Plugin missing: specweave-github
585
+
586
+ To enable auto-sync: /plugin install specweave-github@specweave
587
+ Or continue without PM sync (local-only mode)
588
+ ```
589
+ - **If PM tool not configured**:
590
+ ```
591
+ ℹ️ No external PM tool configured (local-only mode)
592
+ To enable GitHub/Jira/ADO sync: Run project initialization or update config
593
+ ```
594
+
595
+ 6. **Wait for user to install** (don't block, but remind):
395
596
  - If user proceeds without installing, remind them before task execution
396
597
  - Skills from uninstalled plugins won't be available
397
598
  - User can install later: plugins activate on next Claude Code session
398
599
 
399
- **When to Suggest**:
600
+ **When to Execute**:
400
601
  - ✅ After spec.md generation (Step 5 complete)
401
602
  - ✅ Before plan.md generation (gives context for planning)
603
+ - ✅ After ALL increment files created (spec.md, plan.md, tasks.md)
402
604
  - ❌ Don't block increment creation (plugins optional, not required)
403
605
 
404
- **Example Output**:
606
+ **Example Output (Full Flow)**:
405
607
 
406
608
  ```
407
- 📝 Spec created: .specweave/increments/0007-github-sync/spec.md
609
+ 📝 Increment created: 0007-user-authentication
610
+
611
+ Files:
612
+ • spec.md (user stories, acceptance criteria)
613
+ • plan.md (technical architecture)
614
+ • tasks.md (implementation steps with embedded tests)
408
615
 
409
616
  🔌 Plugin Detection:
410
- Detected: "GitHub Issues", "bidirectional sync"
411
- Suggested: specweave-github
617
+ Detected: "user authentication", "JWT tokens", "session management"
618
+ No additional plugins required
619
+
620
+ 🔗 External PM Tool Sync:
621
+ Tool: GitHub Issues
622
+ Plugin: specweave-github ✅ Installed
412
623
 
413
- To install: /plugin install specweave-github@specweave
414
- Or continue without it (can install later)
624
+ Creating GitHub issue...
625
+ Issue #42 created: "Increment 0007: User Authentication"
626
+ URL: https://github.com/myorg/myapp/issues/42
415
627
 
416
- Continue with plan.md generation? [Y/n]
628
+ Auto-sync enabled:
629
+ • Progress updates posted after each task completion
630
+ • Issue closed automatically when increment done
631
+
632
+ Next steps:
633
+ 1. Review spec.md - verify user stories
634
+ 2. Approve plan.md - validate architecture
635
+ 3. Start work: /specweave:do
417
636
  ```
418
637
 
419
638
  **Integration with Existing Workflow**:
420
- - This is a **suggestion step**, not a blocking requirement
421
- - Increment creation continues regardless of plugin installation
422
- - Plugins can be installed any time (they auto-activate when needed)
423
- - This implements the "load on demand" philosophy
639
+ - Plugin detection is a **suggestion step** (not blocking)
640
+ - PM tool sync is **automatic** if configured (zero manual intervention)
641
+ - Increment creation continues regardless of PM tool status
642
+ - This implements the "seamless integration" philosophy
424
643
 
425
644
  ### Step 7: Generate plan.md
426
645
 
@@ -483,7 +702,7 @@ Continue with plan.md generation? [Y/n]
483
702
  ```
484
703
 
485
704
  ## Testing Strategy
486
- [High-level testing approach, see tests.md for details]
705
+ [High-level testing approach - tests embedded in tasks.md (v0.7.0+)]
487
706
 
488
707
  ## Deployment Considerations
489
708
  [Infrastructure, environment, rollout]
@@ -596,97 +815,67 @@ T051 depends on T050 (integration must pass first)
596
815
  - Performance-critical algorithms
597
816
  - Novel problem-solving required
598
817
 
599
- ### Step 9: Generate tests.md
600
-
601
- **Purpose**: Define comprehensive testing strategy and test cases.
602
-
603
- **Structure**:
604
- ```markdown
605
- # Test Strategy: [Feature Title]
606
-
607
- ## Test Philosophy
608
-
609
- Follow SpecWeave Constitution Article III: Test-First Development
610
- - Tests written before implementation
611
- - Tests must fail initially (red-green-refactor)
612
- - Integration tests with real environments
613
-
614
- ## Test Categories
615
-
616
- ### Unit Tests
617
- [Component-level tests]
618
-
619
- ### Integration Tests
620
- [Module integration tests]
621
-
622
- ### E2E Tests
623
- [End-to-end user flows]
624
-
625
- ### Performance Tests
626
- [Load, stress, scalability tests]
627
-
628
- ## Test Cases
629
-
630
- ### TC-001: [Test Name]
631
- **Type**: Unit | Integration | E2E
632
- **Priority**: P1 | P2 | P3
633
- **User Story**: US1
634
-
635
- **Scenario**:
636
- - Given [precondition]
637
- - When [action]
638
- - Then [expected outcome]
639
-
640
- **Test Data**:
641
- [Sample inputs]
642
-
643
- **Expected Results**:
644
- [Specific, measurable outcomes]
645
-
646
- ### TC-002: [Test Name]
647
- ...
648
-
649
- ## Test Coverage Targets
818
+ ### Step 9: Embed Tests in tasks.md (v0.7.0+ Architecture)
650
819
 
651
- - Unit test coverage: >80%
652
- - Integration test coverage: Critical paths
653
- - E2E coverage: All P1 user stories
820
+ **Purpose**: Ensure every task includes comprehensive test plans directly in tasks.md.
654
821
 
655
- ## Testing Tools
822
+ **v0.7.0 Architecture Pivot**: tests.md eliminated. Tests are now embedded in each task for:
823
+ - ✅ Closer proximity to implementation (no sync issues)
824
+ - ✅ Bidirectional AC↔Task↔Test linking
825
+ - ✅ Test-first development (tests defined before implementation)
826
+ - ✅ Clear traceability (each task knows its tests)
656
827
 
657
- - Unit: [Framework]
658
- - Integration: [Framework]
659
- - E2E: [Framework]
660
-
661
- ## Test Environments
662
-
663
- - Local: [Setup]
664
- - CI/CD: [Pipeline]
665
- - Staging: [Environment]
666
-
667
- ## Regression Testing
668
-
669
- For brownfield modifications:
670
- 1. Document existing behavior
671
- 2. Create tests for current functionality
672
- 3. User validation of tests
673
- 4. Implement changes
674
- 5. Verify regression tests still pass
828
+ **Task Structure with Embedded Tests**:
829
+ ```markdown
830
+ ### T-001: Implement login API endpoint
831
+
832
+ **Description**: Create REST API endpoint for user authentication
833
+
834
+ **References**: AC-US1-01, AC-US1-02
835
+
836
+ **Implementation Details**:
837
+ - Validate email format
838
+ - Check password against bcrypt hash
839
+ - Generate JWT token
840
+ - Return 401 for invalid credentials
841
+
842
+ **Test Plan**:
843
+ - **File**: `tests/unit/auth-service.test.ts`
844
+ - **Tests**:
845
+ - **TC-001**: Valid credentials
846
+ - Given valid email and password
847
+ - When POST /api/auth/login
848
+ - Then return 200 with JWT token
849
+ - **TC-002**: Invalid email
850
+ - Given malformed email
851
+ - When POST /api/auth/login
852
+ - Then return 401 with error message
853
+ - **TC-003**: Wrong password
854
+ - Given correct email, wrong password
855
+ - When POST /api/auth/login
856
+ - Then return 401, no details leaked
857
+
858
+ **Dependencies**: None
859
+ **Estimated Effort**: 4 hours
860
+ **Status**: [ ] Not Started
861
+ ```
675
862
 
676
- ## Success Criteria
863
+ **Key Features**:
864
+ - **References**: Links to acceptance criteria (bidirectional traceability)
865
+ - **Test Plan**: Specific test file and test functions
866
+ - **BDD Format**: Given/When/Then for clarity
867
+ - **Coverage**: Each testable task MUST have test plan
677
868
 
678
- - [ ] All P1 tests passing
679
- - [ ] Coverage targets met
680
- - [ ] Performance tests pass
681
- - [ ] No regressions detected
682
- ```
869
+ **test-aware-planner Agent**:
870
+ - Generates tasks.md with embedded tests
871
+ - Ensures 80%+ coverage of testable tasks
872
+ - Marks non-testable tasks (documentation, config)
873
+ - Uses BDD format throughout
683
874
 
684
- **Key Principles**:
685
- - Test-first philosophy
686
- - Comprehensive coverage (unit, integration, E2E)
687
- - Clear test cases with Given-When-Then
688
- - Regression prevention for brownfield
689
- - Measurable success criteria
875
+ **Validation**:
876
+ - Use `/validate-coverage` to check AC and task coverage
877
+ - Target: 80-90% coverage (not 100% - diminishing returns)
878
+ - Integration with `/done` command (runs validation before completion)
690
879
 
691
880
  ### Step 10: Generate context-manifest.yaml
692
881
 
@@ -746,13 +935,13 @@ Before completing:
746
935
  1. **Constitutional Compliance**:
747
936
  - Article V: Modular Scalability (proper structure)
748
937
  - Article VI: Separation of Concerns (spec vs plan vs tasks)
749
- - Article IX: Testing Mandate (tests.md comprehensive)
938
+ - Article IX: Testing Mandate (tasks.md with embedded tests comprehensive)
750
939
 
751
940
  2. **Quality Checks**:
752
941
  - spec.md is technology-agnostic
753
- - plan.md has sufficient technical detail
754
- - tasks.md has exact file paths
755
- - tests.md covers all P1 user stories
942
+ - plan.md has sufficient technical detail + test strategy
943
+ - tasks.md has exact file paths + embedded test plans (BDD format)
944
+ - tasks.md covers all P1 AC-IDs with test cases
756
945
  - context-manifest.yaml is precise
757
946
 
758
947
  3. **Update Features Index**:
@@ -838,14 +1027,13 @@ Before completing:
838
1027
  - Next: 0003
839
1028
  - Path: `.specweave/increments/0003-stripe-payment-integration/`
840
1029
 
841
- **Step 4**: Create structure
1030
+ **Step 4**: Create structure (v0.7.0+)
842
1031
  ```
843
1032
  .specweave/increments/0003-stripe-payment-integration/
844
- ├── spec.md
845
- ├── plan.md
846
- ├── tasks.md
847
- ├── tests.md
848
- └── context-manifest.yaml
1033
+ ├── spec.md # WHAT & WHY
1034
+ ├── plan.md # HOW + test strategy
1035
+ ├── tasks.md # Implementation + embedded tests (BDD)
1036
+ └── context-manifest.yaml # Context loading config
849
1037
  ```
850
1038
 
851
1039
  **Step 5**: Generate spec.md
@@ -907,23 +1095,24 @@ Acceptance Criteria:
907
1095
  ...
908
1096
  ```
909
1097
 
910
- **Step 8**: Generate tests.md
911
- ```markdown
912
- # Test Strategy: Stripe Payment Integration
913
-
914
- ## Test Cases
915
-
916
- ### TC-001: Successful Subscription Creation
917
- Type: Integration
918
- Priority: P1
919
- User Story: US1
920
-
921
- Scenario:
922
- - Given a valid customer and plan ID
923
- - When createSubscription() is called
924
- - Then subscription is created in Stripe
925
- - And webhook confirms activation
926
- ...
1098
+ **Step 8**: Invoke test-aware-planner Agent (v0.7.0+)
1099
+ ```typescript
1100
+ // Use Task tool to invoke test-aware-planner agent
1101
+ Task({
1102
+ subagent_type: "test-aware-planner",
1103
+ description: "Generate tasks with embedded tests",
1104
+ prompt: `Create tasks.md with embedded test plans for Stripe payment integration.
1105
+
1106
+ Read increment files:
1107
+ - .specweave/increments/0003-stripe-payment-integration/spec.md
1108
+ - .specweave/increments/0003-stripe-payment-integration/plan.md
1109
+
1110
+ Generate tasks.md with:
1111
+ - BDD test plans (Given/When/Then) per task
1112
+ - Test cases (unit/integration/E2E with file paths)
1113
+ - Coverage targets (80-90% overall)
1114
+ - AC-ID traceability from spec.md`
1115
+ });
927
1116
  ```
928
1117
 
929
1118
  **Step 9**: Generate context-manifest.yaml
@@ -940,10 +1129,10 @@ priority: high
940
1129
  ```
941
1130
 
942
1131
  **Step 10**: Validate
943
- - ✅ spec.md is technology-agnostic
944
- - ✅ plan.md documents Stripe SDK choice
945
- - ✅ tasks.md follows test-first
946
- - ✅ tests.md covers all P1 stories
1132
+ - ✅ spec.md is technology-agnostic with AC-IDs
1133
+ - ✅ plan.md documents Stripe SDK choice + test strategy
1134
+ - ✅ tasks.md has embedded test plans (BDD format)
1135
+ - ✅ tasks.md covers all P1 AC-IDs with tests
947
1136
  - ✅ Constitutional compliance verified
948
1137
 
949
1138
  **Output**:
@@ -952,10 +1141,9 @@ priority: high
952
1141
 
953
1142
  Location: .specweave/increments/0003-stripe-payment-integration/
954
1143
  Files created:
955
- - spec.md
956
- - plan.md
957
- - tasks.md
958
- - tests.md
1144
+ - spec.md (12 user stories, 34 AC-IDs)
1145
+ - plan.md (5 phases, architecture diagrams, test strategy)
1146
+ - tasks.md (23 tasks with embedded tests, 85% coverage target)
959
1147
  - context-manifest.yaml
960
1148
 
961
1149
  Next steps:
@@ -1013,7 +1201,7 @@ This skill enforces:
1013
1201
 
1014
1202
  - **Article V**: Modular Scalability - Auto-numbered features prevent conflicts
1015
1203
  - **Article VI**: Separation of Concerns - spec vs plan vs tasks are distinct
1016
- - **Article IX**: Skill Testing Mandate - tests.md ensures comprehensive testing
1204
+ - **Article IX**: Testing Mandate - tasks.md with embedded tests ensures comprehensive testing (v0.7.0+)
1017
1205
 
1018
1206
  ## Integration with Other Skills
1019
1207