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
@@ -1,245 +1,396 @@
1
1
  ---
2
2
  name: ado-sync
3
- description: Sync SpecWeave increments with Azure DevOps Epics/Features/User Stories. Activates for ADO sync, Azure DevOps sync, create ADO work item, import from ADO. Coordinates with specweave-ado-mapper agent.
4
- allowed-tools: Read, Write, Edit, Task, Bash
3
+ description: Bidirectional synchronization between SpecWeave increments and Azure DevOps work items. Creates work items from increments, tracks progress via comments, updates increment status from work item state, and closes work items when increments complete. Activates for: Azure DevOps, ADO, work items, project management, sync to ADO, ADO integration, TFS integration.
5
4
  ---
6
5
 
7
- # ADO Sync Skill
6
+ # Azure DevOps Sync Skill
8
7
 
9
- Coordinates Azure DevOps synchronization by delegating to `specweave-ado-mapper` agent.
8
+ **Purpose**: Seamlessly sync SpecWeave increments with Azure DevOps work items for unified project tracking.
10
9
 
11
- ## Responsibilities
12
-
13
- 1. Detect sync requests (export, import, bidirectional)
14
- 2. Validate prerequisites (ADO PAT, Area Path, Iteration)
15
- 3. Invoke `specweave-ado-mapper` agent
16
- 4. Handle errors gracefully
10
+ **Capabilities**:
11
+ - Create ADO work items from increments
12
+ - Sync task progress ADO comments
13
+ - Update increment status from ADO state
14
+ - Close work items when increments complete
15
+ - Support for Epics, Features, User Stories
17
16
 
18
17
  ---
19
18
 
20
- ## ⚠️ CRITICAL: Secrets Required (MANDATORY CHECK)
19
+ ## When This Skill Activates
20
+
21
+ **Keywords**: Azure DevOps, ADO, work items, sync to ADO, ADO integration, TFS, Visual Studio Team Services
22
+
23
+ **Examples**:
24
+ - "Sync this increment with Azure DevOps"
25
+ - "Create ADO work item for this feature"
26
+ - "Update work item #12345 with progress"
27
+ - "Close ADO work item when done"
21
28
 
22
- **BEFORE attempting Azure DevOps sync, CHECK for ADO credentials.**
29
+ ---
30
+
31
+ ## Prerequisites
23
32
 
24
- ### Step 1: Check If Credentials Exist
33
+ ### 1. ADO Plugin Installed
25
34
 
26
35
  ```bash
27
- # Check .env file for required credentials
28
- if [ -f .env ] && grep -q "AZURE_DEVOPS_PAT" .env; then
29
- echo "✅ Azure DevOps PAT found"
30
- else
31
- # PAT NOT found - STOP and prompt user
32
- fi
36
+ # Check if installed
37
+ /plugin list --installed | grep specweave-ado
38
+
39
+ # Install if needed
40
+ /plugin install specweave-ado@specweave
33
41
  ```
34
42
 
35
- ### Step 2: If Credentials Missing, STOP and Show This Message
43
+ ### 2. Azure DevOps Personal Access Token (PAT)
36
44
 
45
+ **Create PAT**:
46
+ 1. Go to https://dev.azure.com/{organization}/_usersSettings/tokens
47
+ 2. Click "New Token"
48
+ 3. Name: "SpecWeave Sync"
49
+ 4. Scopes: Work Items (Read & Write), Comments (Read & Write)
50
+ 5. Copy token → Set environment variable
51
+
52
+ **Set Token**:
53
+ ```bash
54
+ export AZURE_DEVOPS_PAT="your-token-here"
37
55
  ```
38
- 🔐 **Azure DevOps Personal Access Token (PAT) Required**
39
-
40
- I need your Azure DevOps Personal Access Token to sync with ADO.
41
-
42
- **How to get it**:
43
- 1. Go to: https://dev.azure.com/{organization}/_usersSettings/tokens
44
- 2. Or: User Settings (top right) → Personal Access Tokens
45
- 3. Click "+ New Token"
46
- 4. Give it a name (e.g., "specweave-sync")
47
- 5. Set expiration (recommend: 90 days, then rotate)
48
- 6. Select scopes:
49
- **Work Items** (Read, Write, & Manage)
50
- **Code** (Read) - if syncing commits/PRs
51
- **Project and Team** (Read)
52
- 7. Click "Create"
53
- 8. **Copy the token immediately** (you can't see it again!)
54
-
55
- **Where I'll save it**:
56
- - File: `.env` (gitignored, secure)
57
- - Format:
58
- ```
59
- AZURE_DEVOPS_PAT=your-ado-pat-here-52-chars-base64
60
- AZURE_DEVOPS_ORG=your-organization-name
61
- AZURE_DEVOPS_PROJECT=your-project-name
62
- ```
63
-
64
- **Security**:
65
- ✅ .env is in .gitignore (never committed to git)
66
- ✅ Token is 52 characters, base64-encoded
67
- ✅ Stored locally only (not in source code)
68
-
69
- Please provide:
70
- 1. Your Azure DevOps PAT:
71
- 2. Your organization name (e.g., "mycompany"):
72
- 3. Your project name (e.g., "MyProject"):
56
+
57
+ ### 3. ADO Configuration
58
+
59
+ Add to `.specweave/config.json`:
60
+ ```json
61
+ {
62
+ "externalPM": {
63
+ "tool": "ado",
64
+ "enabled": true,
65
+ "config": {
66
+ "organization": "myorg",
67
+ "project": "MyProject",
68
+ "workItemType": "Epic",
69
+ "areaPath": "MyProject\\Team A",
70
+ "syncOnTaskComplete": true
71
+ }
72
+ }
73
+ }
73
74
  ```
74
75
 
75
- ### Step 3: Validate Credentials Format
76
+ ---
77
+
78
+ ## Commands Available
76
79
 
80
+ ### `/specweave-ado:create-workitem <increment-id>`
81
+
82
+ **Purpose**: Create ADO work item from increment
83
+
84
+ **Example**:
77
85
  ```bash
78
- # Validate PAT format (52 chars, base64)
79
- if [ ${#AZURE_DEVOPS_PAT} -ne 52 ]; then
80
- echo "⚠️ Warning: PAT length unexpected"
81
- echo "Expected: 52 characters (base64-encoded)"
82
- echo "Got: ${#AZURE_DEVOPS_PAT} characters"
83
- echo "This might not be a valid Azure DevOps PAT"
84
- fi
85
-
86
- # Validate organization name (no special chars)
87
- if [[ ! "$AZURE_DEVOPS_ORG" =~ ^[a-zA-Z0-9-]+$ ]]; then
88
- echo "⚠️ Warning: Organization name contains unexpected characters"
89
- echo "Expected: alphanumeric and hyphens only"
90
- echo "Got: $AZURE_DEVOPS_ORG"
91
- fi
92
-
93
- # Validate project name (no special chars except spaces)
94
- if [ -z "$AZURE_DEVOPS_PROJECT" ]; then
95
- echo "❌ Error: Project name is empty"
96
- exit 1
97
- fi
86
+ /specweave-ado:create-workitem 0005
98
87
  ```
99
88
 
100
- ### Step 4: Save Credentials Securely
89
+ **Result**:
90
+ - Creates Epic/Feature/User Story in ADO
91
+ - Links work item to increment (metadata)
92
+ - Adds initial comment with spec summary
93
+ - Sets tags: `specweave`, `increment-0005`
94
+
95
+ ---
96
+
97
+ ### `/specweave-ado:sync <increment-id>`
98
+
99
+ **Purpose**: Sync increment progress with ADO work item
101
100
 
101
+ **Example**:
102
102
  ```bash
103
- # Save to .env
104
- cat >> .env << EOF
105
- AZURE_DEVOPS_PAT=$AZURE_DEVOPS_PAT
106
- AZURE_DEVOPS_ORG=$AZURE_DEVOPS_ORG
107
- AZURE_DEVOPS_PROJECT=$AZURE_DEVOPS_PROJECT
108
- EOF
109
-
110
- # Ensure .env is gitignored
111
- if ! grep -q "^\\.env$" .gitignore; then
112
- echo ".env" >> .gitignore
113
- fi
114
-
115
- # Create .env.example for team
116
- cat > .env.example << 'EOF'
117
- # Azure DevOps Personal Access Token
118
- # Get from: https://dev.azure.com/{org}/_usersSettings/tokens
119
- # Scopes: Work Items (Read, Write, Manage), Code (Read), Project (Read)
120
- AZURE_DEVOPS_PAT=your-ado-pat-52-chars-base64
121
- AZURE_DEVOPS_ORG=your-organization-name
122
- AZURE_DEVOPS_PROJECT=your-project-name
123
- EOF
124
-
125
- echo "✅ Credentials saved to .env (gitignored)"
126
- echo "✅ Created .env.example for team (commit this)"
103
+ /specweave-ado:sync 0005
127
104
  ```
128
105
 
129
- ### Step 5: Use Credentials in Sync
106
+ **Result**:
107
+ - Calculates task completion (%)
108
+ - Updates work item description
109
+ - Adds comment with progress update
110
+ - Updates state (New → Active → Resolved)
130
111
 
112
+ ---
113
+
114
+ ### `/specweave-ado:close-workitem <increment-id>`
115
+
116
+ **Purpose**: Close ADO work item when increment complete
117
+
118
+ **Example**:
131
119
  ```bash
132
- # Export for Azure DevOps API calls
133
- export AZURE_DEVOPS_PAT=$(grep AZURE_DEVOPS_PAT .env | cut -d '=' -f2)
134
- export AZURE_DEVOPS_ORG=$(grep AZURE_DEVOPS_ORG .env | cut -d '=' -f2)
135
- export AZURE_DEVOPS_PROJECT=$(grep AZURE_DEVOPS_PROJECT .env | cut -d '=' -f2)
136
-
137
- # Create Base64 Basic Auth header (PAT as username, empty password)
138
- AUTH=$(echo -n ":$AZURE_DEVOPS_PAT" | base64)
139
-
140
- # Use in Azure DevOps REST API calls
141
- curl -H "Authorization: Basic $AUTH" \
142
- -H "Content-Type: application/json" \
143
- https://dev.azure.com/$AZURE_DEVOPS_ORG/$AZURE_DEVOPS_PROJECT/_apis/wit/workitems/12345?api-version=7.0
120
+ /specweave-ado:close-workitem 0005
144
121
  ```
145
122
 
146
- ### Step 6: Never Log Secrets
123
+ **Result**:
124
+ - Updates work item state → Closed
125
+ - Adds completion comment with summary
126
+ - Marks work item as resolved
127
+
128
+ ---
129
+
130
+ ### `/specweave-ado:status <increment-id>`
131
+
132
+ **Purpose**: Check ADO sync status for increment
147
133
 
134
+ **Example**:
148
135
  ```bash
149
- # ❌ WRONG - Logs secret
150
- echo "Using PAT: $AZURE_DEVOPS_PAT"
136
+ /specweave-ado:status 0005
137
+ ```
151
138
 
152
- # ✅ CORRECT - Masks secret
153
- echo "Using Azure DevOps credentials (PAT present: ✅, org: $AZURE_DEVOPS_ORG, project: $AZURE_DEVOPS_PROJECT)"
139
+ **Result**:
140
+ ```
141
+ ADO Sync Status
142
+ ===============
143
+ Increment: 0005-payment-integration
144
+ Work Item: #12345
145
+ URL: https://dev.azure.com/myorg/MyProject/_workitems/edit/12345
146
+ State: Active
147
+ Completion: 60% (6/10 tasks)
148
+ Last Synced: 2025-11-04 10:30:00
149
+ Sync Enabled: ✅
154
150
  ```
155
151
 
156
- ### Step 7: Error Handling
152
+ ---
157
153
 
158
- ```bash
159
- # If API call fails with 401 Unauthorized
160
- if [ $? -eq 401 ]; then
161
- echo "❌ Azure DevOps PAT invalid or expired"
162
- echo ""
163
- echo "Possible causes:"
164
- echo "1. PAT expired (check expiration date)"
165
- echo "2. PAT revoked"
166
- echo "3. Organization name incorrect (check: $AZURE_DEVOPS_ORG)"
167
- echo "4. Insufficient scopes (need: Work Items Read/Write/Manage)"
168
- echo ""
169
- echo "Please verify or regenerate PAT:"
170
- echo "https://dev.azure.com/$AZURE_DEVOPS_ORG/_usersSettings/tokens"
171
- fi
172
-
173
- # If API call fails with 403 Forbidden
174
- if [ $? -eq 403 ]; then
175
- echo "❌ Azure DevOps permission denied"
176
- echo ""
177
- echo "Your account lacks permissions for this operation."
178
- echo "Required permissions:"
179
- echo "- View work items in this project"
180
- echo "- Edit work items in this project"
181
- echo "- Manage work item tags"
182
- echo "- View project-level information"
183
- echo ""
184
- echo "Contact your Azure DevOps administrator."
185
- fi
186
-
187
- # If API call fails with 404 Not Found
188
- if [ $? -eq 404 ]; then
189
- echo "❌ Azure DevOps project not found"
190
- echo ""
191
- echo "Check your configuration:"
192
- echo "- Organization: $AZURE_DEVOPS_ORG"
193
- echo "- Project: $AZURE_DEVOPS_PROJECT"
194
- echo ""
195
- echo "Verify the project exists:"
196
- echo "https://dev.azure.com/$AZURE_DEVOPS_ORG/$AZURE_DEVOPS_PROJECT"
197
- fi
154
+ ## Automatic Sync
155
+
156
+ ### When Task Completes
157
+
158
+ **Trigger**: Post-task-completion hook fires
159
+
160
+ **Flow**:
161
+ 1. User marks task complete: `[x] T-005: Add payment tests`
162
+ 2. Hook detects ADO sync enabled
163
+ 3. Calculate new completion %
164
+ 4. Update ADO work item comment:
165
+ ```markdown
166
+ ## Progress Update
167
+
168
+ **Increment**: 0005-payment-integration
169
+ **Status**: 60% complete (6/10 tasks)
170
+
171
+ ### Recently Completed
172
+ - [x] T-005: Add payment tests
173
+
174
+ ### Remaining
175
+ - [ ] T-007: Add refund functionality
176
+ - [ ] T-008: Implement subscriptions
177
+ - [ ] T-009: Add analytics
178
+ - [ ] T-010: Security audit
179
+
180
+ ---
181
+ 🤖 Auto-updated by SpecWeave
182
+ ```
183
+
184
+ ### When Increment Completes
185
+
186
+ **Trigger**: `/specweave:done` command
187
+
188
+ **Flow**:
189
+ 1. User runs `/specweave:done 0005`
190
+ 2. Validate all tasks complete
191
+ 3. Close ADO work item automatically
192
+ 4. Add completion comment with summary
193
+
194
+ ---
195
+
196
+ ## Work Item Types
197
+
198
+ ### Epic (Recommended)
199
+
200
+ **Use When**: Large feature spanning multiple sprints
201
+
202
+ **Mapping**:
203
+ - SpecWeave increment → ADO Epic
204
+ - Tasks → Epic description (checklist)
205
+ - Progress → Epic comments
206
+
207
+ ---
208
+
209
+ ### Feature
210
+
211
+ **Use When**: Medium-sized feature within a sprint
212
+
213
+ **Mapping**:
214
+ - SpecWeave increment → ADO Feature
215
+ - Tasks → Feature description (checklist)
216
+ - Progress → Feature comments
217
+
218
+ ---
219
+
220
+ ### User Story
221
+
222
+ **Use When**: Small, single-sprint work
223
+
224
+ **Mapping**:
225
+ - SpecWeave increment → ADO User Story
226
+ - Tasks → User Story description (checklist)
227
+ - Progress → User Story comments
228
+
229
+ ---
230
+
231
+ ## Bidirectional Sync (Optional)
232
+
233
+ **Enable**: Set `bidirectional: true` in config
234
+
235
+ **Flow**: ADO → SpecWeave
236
+ 1. User updates work item state in ADO (Active → Resolved)
237
+ 2. SpecWeave detects change (polling or webhook)
238
+ 3. Updates increment status locally
239
+ 4. Notifies user: "Work item #12345 resolved → Increment 0005 marked complete"
240
+
241
+ **Note**: Bidirectional sync requires webhook or polling setup
242
+
243
+ ---
244
+
245
+ ## Configuration Options
246
+
247
+ **`.specweave/config.json`**:
248
+ ```json
249
+ {
250
+ "externalPM": {
251
+ "tool": "ado",
252
+ "enabled": true,
253
+ "config": {
254
+ "organization": "myorg",
255
+ "project": "MyProject",
256
+ "personalAccessToken": "${AZURE_DEVOPS_PAT}",
257
+ "workItemType": "Epic",
258
+ "areaPath": "MyProject\\Team A",
259
+ "iterationPath": "MyProject\\Sprint 1",
260
+ "syncOnTaskComplete": true,
261
+ "syncOnIncrementComplete": true,
262
+ "createWorkItemsAutomatically": true,
263
+ "bidirectional": false,
264
+ "tags": ["specweave", "increment"],
265
+ "customFields": {
266
+ "incrementId": "Custom.IncrementId"
267
+ }
268
+ }
269
+ }
270
+ }
198
271
  ```
199
272
 
200
- ### Step 8: Production Recommendations
273
+ ---
274
+
275
+ ## Troubleshooting
201
276
 
202
- **For production deployments, use Service Principals or Managed Identities**:
277
+ ### Error: "Personal Access Token invalid"
203
278
 
204
- **Why Service Principals?**
205
- - Not tied to individual user accounts
206
- - Can be scoped to specific projects/resources
207
- - Easier to rotate and manage
208
- - Better audit trail
279
+ **Solution**:
280
+ 1. Verify token is set: `echo $AZURE_DEVOPS_PAT`
281
+ 2. Check token scopes: Work Items (Read & Write)
282
+ 3. Ensure token not expired
283
+ 4. Regenerate token if needed
209
284
 
210
- **How to set up Service Principal**:
211
- 1. Go to: https://portal.azure.com/
212
- 2. Navigate to: Azure Active Directory → App Registrations
213
- 3. Create new registration
214
- 4. Add to Azure DevOps organization
215
- 5. Grant appropriate permissions
216
- 6. Use client credentials flow instead of PAT
285
+ ---
217
286
 
218
- **PAT Best Practices**:
219
- - ✅ Set expiration to 90 days maximum
220
- - ✅ Use minimum required scopes
221
- - ✅ Rotate regularly (set calendar reminder)
222
- - ✅ Revoke immediately when team member leaves
223
- - ✅ Create separate PATs for different purposes (dev, prod, CI/CD)
287
+ ### Error: "Work item not found"
224
288
 
225
- **Alternative: Azure CLI**:
226
- ```bash
227
- # Authenticate once with Azure CLI
228
- az login
289
+ **Solution**:
290
+ 1. Check work item ID is correct
291
+ 2. Verify you have access to the project
292
+ 3. Ensure work item not deleted
293
+
294
+ ---
295
+
296
+ ### Error: "Organization or project not found"
229
297
 
230
- # Azure DevOps commands will use your Azure credentials
231
- az devops configure --defaults organization=https://dev.azure.com/$AZURE_DEVOPS_ORG project=$AZURE_DEVOPS_PROJECT
298
+ **Solution**:
299
+ 1. Verify organization name: https://dev.azure.com/{organization}
300
+ 2. Check project name (case-sensitive)
301
+ 3. Ensure you have access to the project
232
302
 
233
- # No PAT needed if Azure CLI is configured
234
- az boards work-item show --id 12345
303
+ ---
304
+
305
+ ## API Rate Limits
306
+
307
+ **Azure DevOps**:
308
+ - Rate limit: 200 requests per minute per PAT
309
+ - Burst limit: 5000 requests per hour
310
+ - Recommendation: Enable rate limiting in config
311
+
312
+ **Config**:
313
+ ```json
314
+ {
315
+ "externalPM": {
316
+ "config": {
317
+ "rateLimiting": {
318
+ "enabled": true,
319
+ "maxRequestsPerMinute": 150
320
+ }
321
+ }
322
+ }
323
+ }
235
324
  ```
236
325
 
237
326
  ---
238
327
 
239
- ## Usage
328
+ ## Security Best Practices
329
+
330
+ ### DO:
331
+ - ✅ Store PAT in environment variable (`AZURE_DEVOPS_PAT`)
332
+ - ✅ Use `.env` file (gitignored)
333
+ - ✅ Set minimum required scopes
334
+ - ✅ Rotate PAT every 90 days
240
335
 
241
- **Export**: `/sync-ado export 0001`
242
- **Import**: `/sync-ado import 12345`
243
- **Sync**: `/sync-ado sync 0001`
336
+ ### DON'T:
337
+ - Commit PAT to git
338
+ - Share PAT via Slack/email
339
+ - ❌ Use PAT with excessive permissions
340
+ - ❌ Log PAT to console/files
341
+
342
+ ---
343
+
344
+ ## Related Commands
345
+
346
+ - `/specweave:inc` - Create increment (auto-creates ADO work item if enabled)
347
+ - `/specweave:do` - Execute tasks (auto-syncs progress to ADO)
348
+ - `/specweave:done` - Complete increment (auto-closes ADO work item)
349
+ - `/specweave:status` - Show increment status (includes ADO sync status)
350
+
351
+ ---
352
+
353
+ ## Examples
354
+
355
+ ### Example 1: Create Increment with ADO Sync
356
+
357
+ ```bash
358
+ # User
359
+ "Create increment for payment integration"
360
+
361
+ # SpecWeave (if ADO enabled)
362
+ 1. PM agent generates spec.md
363
+ 2. Auto-create ADO Epic #12345
364
+ 3. Link Epic to increment metadata
365
+ 4. Display: "Created increment 0005 → ADO Epic #12345"
366
+ ```
367
+
368
+ ### Example 2: Manual Sync
369
+
370
+ ```bash
371
+ # User completed 3 tasks manually
372
+ # Now sync to ADO
373
+
374
+ /specweave-ado:sync 0005
375
+
376
+ # Result: ADO Epic #12345 updated with 30% progress
377
+ ```
378
+
379
+ ### Example 3: Check Sync Status
380
+
381
+ ```bash
382
+ /specweave-ado:status 0005
383
+
384
+ # Output:
385
+ # Work Item: #12345
386
+ # URL: https://dev.azure.com/myorg/MyProject/_workitems/edit/12345
387
+ # State: Active
388
+ # Completion: 60%
389
+ # Last Synced: 5 minutes ago
390
+ ```
391
+
392
+ ---
244
393
 
245
- All conversion logic is handled by the `specweave-ado-mapper` agent.
394
+ **Status**: Ready to use
395
+ **Version**: 0.1.0
396
+ **Plugin**: specweave-ado@specweave
@@ -61,6 +61,79 @@ Activate this skill when you need to:
61
61
  - "docusaurus from specweave"
62
62
  - "host documentation"
63
63
  - "static docs site"
64
+ - "internal docs"
65
+ - "engineering playbook"
66
+ - "dual docs sites"
67
+
68
+ ## Dual Documentation Sites (SpecWeave)
69
+
70
+ **SpecWeave supports TWO Docusaurus instances** for separating public and internal documentation:
71
+
72
+ ### 1. Public Docs (`docs-site/`)
73
+ - **Purpose**: User-facing documentation
74
+ - **Source**: `.specweave/docs/public/`
75
+ - **Port**: 3013
76
+ - **Deployment**: ✅ spec-weave.com (public)
77
+ - **Search**: Algolia (recommended)
78
+ - **Content**: Guides, API docs, tutorials, FAQ
79
+
80
+ **Commands**:
81
+ ```bash
82
+ # Start public docs
83
+ npm run docs:public
84
+ # OR
85
+ cd docs-site && npm start
86
+
87
+ # Access: http://localhost:3013
88
+ ```
89
+
90
+ ### 2. Internal Docs (`docs-site-internal/`)
91
+ - **Purpose**: Engineering playbook (ADRs, HLD, strategy)
92
+ - **Source**: `.specweave/docs/internal/`
93
+ - **Port**: 3015
94
+ - **Deployment**: ❌ NEVER deploy (local only)
95
+ - **Search**: Local search plugin (no Algolia)
96
+ - **Content**: Architecture, strategy, specs, delivery, operations, governance
97
+
98
+ **Commands**:
99
+ ```bash
100
+ # Start internal docs
101
+ npm run docs:internal
102
+ # OR
103
+ cd docs-site-internal && npm start
104
+
105
+ # Access: http://localhost:3015
106
+ ```
107
+
108
+ ### Running Both Simultaneously
109
+
110
+ ```bash
111
+ # Terminal 1: Public docs
112
+ npm run docs:public
113
+
114
+ # Terminal 2: Internal docs
115
+ npm run docs:internal
116
+
117
+ # Access:
118
+ # - Public: http://localhost:3013
119
+ # - Internal: http://localhost:3015
120
+ ```
121
+
122
+ **Key Differences**:
123
+
124
+ | Aspect | Public Docs | Internal Docs |
125
+ |--------|-------------|---------------|
126
+ | **Directory** | `docs-site/` | `docs-site-internal/` |
127
+ | **Source** | `.specweave/docs/public/` | `.specweave/docs/internal/` |
128
+ | **Port** | 3013 | 3015 |
129
+ | **Deployment** | ✅ Deployed | ❌ Local only |
130
+ | **Search** | Algolia | Local plugin |
131
+ | **Warning** | ❌ None | ✅ Red banner |
132
+ | **Content** | User guides | Engineering docs |
133
+
134
+ **Security**: Internal docs have NO deployment config (no `vercel.json`, `netlify.toml`, or GitHub Actions workflow). This prevents accidental public deployment.
135
+
136
+ ---
64
137
 
65
138
  ## Workflow
66
139