specweave 0.6.8 → 0.7.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 (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 +90 -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
@@ -0,0 +1,552 @@
1
+ # Azure DevOps ↔ SpecWeave Concept Mapping
2
+
3
+ **Purpose**: Quick reference for mapping Azure DevOps work items to SpecWeave architecture
4
+
5
+ **Source of Truth**: [.specweave/docs/internal/delivery/guides/tool-concept-mapping.md](../../../.specweave/docs/internal/delivery/guides/tool-concept-mapping.md)
6
+
7
+ **Last Synced**: 2025-11-04
8
+
9
+ ---
10
+
11
+ ## 🚨 CRITICAL: Agents MUST Follow This Mapping
12
+
13
+ When syncing between Azure DevOps and SpecWeave, you **MUST** use these exact mappings. Do not deviate or create custom mappings.
14
+
15
+ ---
16
+
17
+ ## Core Concept Mapping
18
+
19
+ | ADO Concept | SpecWeave Concept | Location | Mapping Rule |
20
+ |-------------|-------------------|----------|--------------|
21
+ | **Epic** | Increment | `.specweave/increments/####-{name}/` | 1 Epic = 1 Increment (1:1) |
22
+ | **Feature** | PRD or RFC | Context-dependent | Depends on scope (business vs technical) |
23
+ | **User Story** | PRD or RFC | Context-dependent | Same as Feature |
24
+ | **Task** | Task | `.specweave/increments/####-{name}/tasks.md` | Implementation tasks |
25
+ | **Bug** | Incident | `.specweave/docs/internal/operations/incidents/{id}.md` | Operational issues |
26
+ | **Sprint** | Release Plan | `.specweave/docs/internal/delivery/release-v{version}.md` | Sprint planning |
27
+ | **Area** | Module | `.specweave/docs/internal/architecture/{module}/` | Functional areas |
28
+ | **Test Case** | Test | `tests/` or `.specweave/increments/####/tasks.md` | Automated/manual tests |
29
+ | **Iteration** | Release Plan | `.specweave/docs/internal/delivery/release-v{version}.md` | Same as Sprint |
30
+
31
+ ---
32
+
33
+ ## Epic → Increment Mapping (MANDATORY 1:1)
34
+
35
+ **Rule**: **ONE ADO Epic = ONE SpecWeave Increment**
36
+
37
+ This is the **MOST CRITICAL** mapping. Never deviate from this 1:1 relationship.
38
+
39
+ **Bidirectional Link**:
40
+ ```json
41
+ // .specweave/increments/####-{name}/metadata.json
42
+ {
43
+ "external_ids": {
44
+ "ado": {
45
+ "work_item_id": 12345,
46
+ "work_item_url": "https://dev.azure.com/myorg/MyProject/_workitems/edit/12345",
47
+ "work_item_type": "Epic",
48
+ "organization": "myorg",
49
+ "project": "MyProject"
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ **Example**:
56
+ ```
57
+ ADO Epic #12345: "User Authentication"
58
+
59
+ SpecWeave: .specweave/increments/0005-user-authentication/
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Feature/User Story → PRD or RFC (Context-Dependent)
65
+
66
+ **Critical Decision Tree** (use this EXACTLY):
67
+
68
+ ```
69
+ Is the Feature/User Story primarily a business requirement?
70
+ ├─ YES → PRD (.specweave/docs/internal/strategy/prd-{name}.md)
71
+ │ Example: "As a user, I want to log in with email so I can access my account"
72
+
73
+ └─ NO → Is it a technical design/API change?
74
+ ├─ YES → RFC (.specweave/docs/internal/architecture/rfc/####-{name}.md)
75
+ │ Example: "Design OAuth 2.0 authentication API"
76
+
77
+ └─ NO → Is it an architecture decision?
78
+ ├─ YES → ADR (.specweave/docs/internal/architecture/adr/####-{decision}.md)
79
+ │ Example: "Decide between OAuth 2.0 vs SAML"
80
+
81
+ └─ NO → Task (.specweave/increments/####-{name}/tasks.md)
82
+ Example: "Write unit tests for login endpoint"
83
+ ```
84
+
85
+ **Detection Rules** (use ADO fields):
86
+ 1. **Business Feature/Story → PRD**:
87
+ - Work item type: Feature or User Story
88
+ - Tags: `business`, `requirement`, `user-story`
89
+ - Description contains: "As a user", "I want to", "so that"
90
+
91
+ 2. **Technical Feature/Story → RFC**:
92
+ - Work item type: Feature or User Story
93
+ - Tags: `technical`, `design`, `api`, `architecture`
94
+ - Description contains: "Design", "Implement", "API", "Technical"
95
+
96
+ 3. **Architecture Decision → ADR**:
97
+ - Work item type: Task or Feature
98
+ - Tags: `decision`, `adr`, `architecture-decision`
99
+ - Title starts with: "Decide", "Choose", "Select", "Evaluate"
100
+
101
+ 4. **Implementation Task → Task**:
102
+ - Work item type: Task
103
+ - No special tags
104
+ - Specific, actionable work
105
+
106
+ ---
107
+
108
+ ## State Mapping (MUST BE EXACT)
109
+
110
+ | ADO State | SpecWeave Status | Notes |
111
+ |-----------|------------------|-------|
112
+ | `New` | `planned` | Not started |
113
+ | `Active` | `in_progress` | Active development |
114
+ | `Resolved` | `in_progress` | Awaiting deployment, still in progress |
115
+ | `Closed` | `completed` | Fully complete |
116
+ | `Removed` | `cancelled` | Decided not to do |
117
+
118
+ **Custom States** (map to closest standard):
119
+ - `Proposed` → `planned`
120
+ - `Committed` → `planned`
121
+ - `In Progress` → `in_progress`
122
+ - `In Review` → `in_progress`
123
+ - `Done` → `completed`
124
+ - `Cut` → `cancelled`
125
+
126
+ **Why "Resolved" → "in_progress"?**
127
+ - In ADO, "Resolved" typically means code complete but not deployed
128
+ - SpecWeave considers work incomplete until deployed/verified
129
+ - Use `completed` only when fully done (deployed + verified)
130
+
131
+ ---
132
+
133
+ ## Priority Mapping
134
+
135
+ | ADO Priority | SpecWeave Priority | Description |
136
+ |--------------|-------------------|-------------|
137
+ | `1` | `P1` | Critical, must do now |
138
+ | `2` | `P2` | High priority |
139
+ | `3` | `P3` | Medium priority |
140
+ | `4` | `P4` | Low priority, nice-to-have |
141
+ | (unset) | `P3` | Default to medium |
142
+
143
+ ---
144
+
145
+ ## Sprint/Iteration → Release Plan Mapping
146
+
147
+ **Mapping Rule**: 1 ADO Sprint/Iteration = 1 SpecWeave Release Plan
148
+
149
+ **Example**:
150
+ ```
151
+ ADO: Sprint 1 "Jan 1-14" (Path: MyProject\Sprint 1)
152
+
153
+ SpecWeave: .specweave/docs/internal/delivery/release-v1.0.md
154
+ ```
155
+
156
+ **Release Plan Contents**:
157
+ - **What increments are included**: List of increment IDs (0005, 0006, 0007)
158
+ - **What features ship**: User-facing features (login, password reset, 2FA)
159
+ - **Testing strategy**: E2E, integration, unit test plans
160
+ - **Rollout plan**: Blue-green, canary, phased rollout
161
+ - **Rollback plan**: How to revert if issues
162
+ - **Success metrics**: DORA metrics, test coverage, uptime
163
+
164
+ ---
165
+
166
+ ## Task → Task Mapping (Direct)
167
+
168
+ **Mapping Rule**: ADO Tasks map directly to SpecWeave Tasks
169
+
170
+ **Format**:
171
+ ```markdown
172
+ # tasks.md
173
+
174
+ ## Implementation Tasks
175
+
176
+ - [ ] **T-001**: Set up OAuth 2.0 client config (ADO: #45678)
177
+ - [ ] **T-002**: Implement login endpoint (ADO: #45679)
178
+ - [ ] **T-003**: Write unit tests (ADO: #45680)
179
+ - [ ] **T-004**: Write E2E tests (ADO: #45681)
180
+ - [ ] **T-005**: Deploy to staging (ADO: #45682)
181
+ ```
182
+
183
+ **Bidirectional Link**:
184
+ ```json
185
+ // metadata.json
186
+ {
187
+ "external_ids": {
188
+ "ado": {
189
+ "tasks": [
190
+ {"id": "T-001", "work_item_id": 45678},
191
+ {"id": "T-002", "work_item_id": 45679},
192
+ {"id": "T-003", "work_item_id": 45680}
193
+ ]
194
+ }
195
+ }
196
+ }
197
+ ```
198
+
199
+ ---
200
+
201
+ ## Bug → Incident Mapping
202
+
203
+ **Rule**: Bugs are operational incidents, not development tasks
204
+
205
+ **Location**: `.specweave/docs/internal/operations/incidents/{id}.md`
206
+
207
+ **Why**: Bugs discovered in production are operational issues requiring postmortems, not feature work.
208
+
209
+ **Example**:
210
+ ```markdown
211
+ # Incident: Login Failures on 2025-01-20
212
+
213
+ **Incident ID**: INC-001
214
+ **ADO Bug**: #99999
215
+ **Severity**: P1 (Critical)
216
+ **Status**: Resolved
217
+
218
+ ## Timeline
219
+
220
+ - 10:00 AM: Users report login failures
221
+ - 10:15 AM: On-call engineer investigates
222
+ - 10:30 AM: Root cause identified (expired SSL cert)
223
+ - 10:45 AM: SSL cert renewed
224
+ - 11:00 AM: Service restored
225
+
226
+ ## Root Cause
227
+
228
+ SSL certificate expired, causing HTTPS handshake failures.
229
+
230
+ ## Resolution
231
+
232
+ Renewed SSL cert via Let's Encrypt. Implemented automated renewal.
233
+
234
+ ## Prevention
235
+
236
+ - [ ] Set up SSL cert expiration monitoring (created ADO Feature #100000)
237
+ - [ ] Automate cert renewal
238
+ ```
239
+
240
+ ---
241
+
242
+ ## Area → Module Mapping
243
+
244
+ **ADO Area** maps to **SpecWeave Module** (architecture folder)
245
+
246
+ **Example**:
247
+ ```
248
+ ADO Area: "MyProject\Frontend\Authentication"
249
+
250
+ SpecWeave: .specweave/docs/internal/architecture/frontend-auth/
251
+ ```
252
+
253
+ **Module Contents**:
254
+ - HLD (High-Level Design)
255
+ - Component diagrams
256
+ - API contracts
257
+ - Data models
258
+
259
+ ---
260
+
261
+ ## Test Case → Test Mapping
262
+
263
+ **ADO Test Case** maps to **SpecWeave Test** (automated or manual)
264
+
265
+ **Mapping Options**:
266
+
267
+ 1. **Automated Tests**:
268
+ ```
269
+ ADO Test Case #55555: "Verify login with valid credentials"
270
+
271
+ Code: tests/e2e/auth/login.spec.ts
272
+ Function: test('should login with valid credentials', ...)
273
+ ```
274
+
275
+ 2. **Manual Tests** (v0.7.0+):
276
+ ```
277
+ ADO Test Case #55555: "Manual smoke test for production"
278
+
279
+ SpecWeave: .specweave/increments/0005-user-authentication/tasks.md
280
+ Test Case: AC-US1-01 (BDD format: Given/When/Then)
281
+ ```
282
+
283
+ ---
284
+
285
+ ## Sync Scenarios (Step-by-Step)
286
+
287
+ ### Scenario 1: New ADO Epic Created
288
+
289
+ **What Happens**:
290
+ 1. ADO: Epic #12345 "Payment Integration" created
291
+ 2. SpecWeave sync detects new Epic
292
+ 3. SpecWeave creates new increment:
293
+ ```bash
294
+ .specweave/increments/0005-payment-integration/
295
+ ├── metadata.json # external_ids.ado.work_item_id = 12345
296
+ ├── spec.md
297
+ ├── plan.md
298
+ └── tasks.md
299
+ ```
300
+ 4. SpecWeave creates PRD stub:
301
+ ```bash
302
+ .specweave/docs/internal/strategy/prd-payment-integration.md
303
+ ```
304
+ 5. SpecWeave logs sync in `.specweave/logs/ado-sync.json`
305
+
306
+ ### Scenario 2: ADO Epic State Changed
307
+
308
+ **What Happens**:
309
+ 1. ADO: Epic #12345 state changed from "New" → "Active"
310
+ 2. SpecWeave sync detects state change
311
+ 3. SpecWeave updates `metadata.json`:
312
+ ```json
313
+ {
314
+ "status": "in_progress",
315
+ "started": "2025-11-04T10:00:00Z",
316
+ "updated": "2025-11-04T10:00:00Z"
317
+ }
318
+ ```
319
+ 4. SpecWeave commits change: `sync: ADO Epic #12345 state → in_progress`
320
+
321
+ ### Scenario 3: New Feature Added to Epic
322
+
323
+ **What Happens**:
324
+ 1. ADO: Feature #45600 created, linked to Epic #12345
325
+ 2. SpecWeave sync detects new Feature
326
+ 3. SpecWeave analyzes feature:
327
+ - Is it business requirement? → Create PRD
328
+ - Is it technical design? → Create RFC
329
+ 4. SpecWeave updates `metadata.json`:
330
+ ```json
331
+ {
332
+ "external_ids": {
333
+ "ado": {
334
+ "features": [45600]
335
+ }
336
+ },
337
+ "docs": {
338
+ "prd": ".specweave/docs/internal/strategy/prd-payment-integration.md"
339
+ }
340
+ }
341
+ ```
342
+
343
+ ### Scenario 4: SpecWeave ADR Created → Sync to ADO
344
+
345
+ **What Happens**:
346
+ 1. Developer creates ADR locally:
347
+ ```bash
348
+ .specweave/docs/internal/architecture/adr/0001-use-stripe.md
349
+ ```
350
+ 2. Developer commits and pushes
351
+ 3. SpecWeave post-commit hook detects new ADR
352
+ 4. SpecWeave finds related increment (via `metadata.json` → docs.adrs)
353
+ 5. SpecWeave creates ADO Feature:
354
+ - Title: "ADR 0001: Use Stripe for Payments"
355
+ - Type: Feature
356
+ - Parent: Epic #12345
357
+ - Link: URL to ADR in repo
358
+ 6. SpecWeave updates `metadata.json`:
359
+ ```json
360
+ {
361
+ "external_ids": {
362
+ "ado": {
363
+ "features": [45600, 45700]
364
+ }
365
+ },
366
+ "docs": {
367
+ "adrs": [
368
+ ".specweave/docs/internal/architecture/adr/0001-use-stripe.md"
369
+ ]
370
+ }
371
+ }
372
+ ```
373
+
374
+ ---
375
+
376
+ ## Conflict Resolution
377
+
378
+ ### Conflict: Both ADO and SpecWeave Changed State
379
+
380
+ **Scenario**:
381
+ - ADO Epic #12345: State changed from "Active" → "Resolved" (at 10:00 AM)
382
+ - SpecWeave Increment 0005: Status changed from "in_progress" → "on_hold" (at 10:05 AM)
383
+ - Last sync: 9:00 AM
384
+
385
+ **Detection**:
386
+ - Sync runs at 10:15 AM
387
+ - Finds both changed since last sync
388
+
389
+ **Resolution Options**:
390
+
391
+ 1. **Prompt User** (default):
392
+ ```
393
+ Conflict detected for increment 0005-payment-integration:
394
+ - ADO Epic #12345: Resolved (changed at 10:00 AM)
395
+ - SpecWeave: on_hold (changed at 10:05 AM)
396
+
397
+ Which version to keep?
398
+ 1) Use ADO (Resolved → in_progress)
399
+ 2) Use SpecWeave (on_hold)
400
+ 3) Merge manually
401
+ ```
402
+
403
+ 2. **Auto-Resolve (configured)**:
404
+ - SpecWeave wins (local is source of truth)
405
+ - ADO wins (team collaboration via ADO)
406
+
407
+ 3. **Log Conflict**:
408
+ ```json
409
+ // .specweave/logs/ado-sync.json
410
+ {
411
+ "conflicts": [
412
+ {
413
+ "increment": "0005",
414
+ "field": "status",
415
+ "ado_value": "Resolved",
416
+ "specweave_value": "on_hold",
417
+ "timestamp": "2025-11-04T10:15:00Z",
418
+ "resolution": "manual",
419
+ "resolved_by": "@john-doe",
420
+ "resolved_at": "2025-11-04T10:20:00Z",
421
+ "final_value": "on_hold"
422
+ }
423
+ ]
424
+ }
425
+ ```
426
+
427
+ ---
428
+
429
+ ## Traceability Examples
430
+
431
+ ### Example 1: From ADO Epic to Code
432
+
433
+ **Start**: ADO Epic #12345 "Payment Integration"
434
+
435
+ **Trace** (`specweave trace --ado 12345`):
436
+ ```
437
+ ADO Epic: #12345 "Payment Integration"
438
+
439
+ SpecWeave Increment: 0005-payment-integration
440
+
441
+ PRD: .specweave/docs/internal/strategy/prd-payment-integration.md
442
+ (ADO Feature: #45600)
443
+
444
+ HLD: .specweave/docs/internal/architecture/hld-payment-integration.md
445
+
446
+ ADR: .specweave/docs/internal/architecture/adr/0001-use-stripe.md
447
+ (ADO Feature: #45700)
448
+
449
+ RFC: .specweave/docs/internal/architecture/rfc/0001-payment-api.md
450
+ (ADO Feature: #45650)
451
+
452
+ Code: src/services/payment/
453
+
454
+ Tests: tests/e2e/payment.spec.ts
455
+
456
+ Runbook: .specweave/docs/internal/operations/runbook-payment-service.md
457
+ ```
458
+
459
+ ### Example 2: From Code to ADO Epic
460
+
461
+ **Start**: Code file `src/services/payment/stripe.ts`
462
+
463
+ **Trace** (`specweave trace --file src/services/payment/stripe.ts`):
464
+ ```
465
+ File: src/services/payment/stripe.ts
466
+
467
+ Increment: 0005-payment-integration
468
+
469
+ ADO Epic: #12345 "Payment Integration"
470
+ URL: https://dev.azure.com/myorg/MyProject/_workitems/edit/12345
471
+
472
+ PRD: .specweave/docs/internal/strategy/prd-payment-integration.md
473
+ HLD: .specweave/docs/internal/architecture/hld-payment-integration.md
474
+ ADRs:
475
+ - 0001-use-stripe.md (ADO Feature: #45700)
476
+ RFCs:
477
+ - 0001-payment-api.md (ADO Feature: #45650)
478
+ ```
479
+
480
+ ---
481
+
482
+ ## Validation Checklist
483
+
484
+ **Before syncing, verify**:
485
+ - [ ] ADO Epic exists and is accessible
486
+ - [ ] Increment metadata has valid ADO link
487
+ - [ ] State mapping follows rules above (no custom mappings)
488
+ - [ ] Priority mapped correctly (P1/P2/P3/P4)
489
+ - [ ] Feature/Story type detection used decision tree (PRD vs RFC vs ADR vs Task)
490
+ - [ ] Bidirectional links are valid (Epic ↔ Increment)
491
+ - [ ] Task IDs match between ADO and SpecWeave
492
+ - [ ] Conflicts resolved (if any)
493
+
494
+ ---
495
+
496
+ ## Security: Azure DevOps Personal Access Token (PAT)
497
+
498
+ **Required**:
499
+ - Personal Access Token (from https://dev.azure.com/{org}/_usersSettings/tokens)
500
+ - Organization name
501
+ - Project name
502
+
503
+ **Scopes Needed**:
504
+ - Work Items (Read & Write)
505
+ - Comments (Read & Write)
506
+
507
+ **Storage**:
508
+ ```bash
509
+ # .env (gitignored)
510
+ AZURE_DEVOPS_PAT=your-token-here
511
+ AZURE_DEVOPS_ORG=myorg
512
+ AZURE_DEVOPS_PROJECT=MyProject
513
+ ```
514
+
515
+ **Authentication**:
516
+ ```bash
517
+ # Basic Auth: base64(:token)
518
+ AUTH=$(echo -n ":$AZURE_DEVOPS_PAT" | base64)
519
+ ```
520
+
521
+ **Never**:
522
+ - ❌ Log or commit PAT
523
+ - ❌ Share PAT via Slack/email
524
+ - ❌ Use PAT with excessive permissions
525
+
526
+ ---
527
+
528
+ ## API Rate Limits
529
+
530
+ **Azure DevOps Limits**:
531
+ - 200 requests per minute per PAT
532
+ - 5000 requests per hour per PAT
533
+
534
+ **Strategy**:
535
+ - Track request count
536
+ - Implement token bucket algorithm
537
+ - Queue requests if approaching limit
538
+ - Warn user if rate limit hit
539
+
540
+ ---
541
+
542
+ ## Related Documentation
543
+
544
+ - **Full Mapping Guide**: [.specweave/docs/internal/delivery/guides/tool-concept-mapping.md](../../../.specweave/docs/internal/delivery/guides/tool-concept-mapping.md)
545
+ - **ADO Sync Skill**: [../skills/ado-sync/SKILL.md](../skills/ado-sync/SKILL.md)
546
+ - **ADO Manager Agent**: [../agents/ado-manager/AGENT.md](../agents/ado-manager/AGENT.md)
547
+
548
+ ---
549
+
550
+ **Last Updated**: 2025-11-04
551
+ **Version**: 1.0.0
552
+ **Plugin**: specweave-ado