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,233 +0,0 @@
1
- # Claude Code Adapter
2
-
3
- **Automation Level**: Full (Best-in-class experience)
4
-
5
- ## Overview
6
-
7
- The Claude Code adapter provides **full automation** for SpecWeave, leveraging Claude Code's native capabilities for skills, agents, hooks, and slash commands.
8
-
9
- This adapter represents the **gold standard** - all other adapters attempt to approximate this experience within their tool's capabilities.
10
-
11
- ## Why Claude Code Provides Superior Results
12
-
13
- **Anthropic Defines Industry Standards:**
14
-
15
- ### 1. MCP (Model Context Protocol)
16
- - **What**: Standardized protocol for context management
17
- - **Why**: Efficient, tool-integrated, proven pattern
18
- - **Benefit**: Native context loading, 70%+ token reduction
19
-
20
- ### 2. Skills + Agents Architecture
21
- - **What**: Proven pattern for AI capabilities and roles
22
- - **Skills**: Auto-activating capabilities (specweave-detector, skill-router)
23
- - **Agents**: Specialized roles with separate context windows (PM, Architect, DevOps)
24
- - **Why**: Context isolation, role-based expertise, automatic activation
25
- - **Benefit**: More accurate, faster, better UX
26
-
27
- ### 3. Native Tool Integration
28
- - **What**: Direct access to Read, Write, Edit, Bash, Grep, Glob
29
- - **Why**: Real-time file system access, command execution
30
- - **Benefit**: Seamless development workflow
31
-
32
- ## What This Adapter Provides
33
-
34
- ### Skills (Auto-Activating)
35
- | Skill | Purpose | Activation |
36
- |-------|---------|------------|
37
- | `specweave-detector` | Detect SpecWeave projects | Always (proactive) |
38
- | `skill-router` | Route requests to appropriate skills/agents | Automatic |
39
- | `context-loader` | Load context manifests (70%+ token savings) | When loading context |
40
- | `increment-planner` | Plan features with context awareness | When creating features |
41
- | `role-orchestrator` | Coordinate multi-agent workflows | Complex tasks |
42
- | `brownfield-analyzer` | Analyze existing codebases | Brownfield projects |
43
-
44
- **Plus 18+ more skills** (see `src/skills/`)
45
-
46
- ### Agents (Specialized Roles)
47
- | Agent | Role | When Used |
48
- |-------|------|-----------|
49
- | `pm` | Product Manager | Requirements, user stories |
50
- | `architect` | System Architect | Design, ADRs, architecture |
51
- | `devops` | DevOps Engineer | Infrastructure, deployment |
52
- | `qa-lead` | QA Lead | Test strategy, test cases |
53
- | `security` | Security Engineer | Threat modeling, audits |
54
- | `tech-lead` | Technical Lead | Code review, best practices |
55
- | `frontend` | Frontend Developer | UI implementation |
56
- | `python-backend` | Python Backend Dev | FastAPI, Django APIs |
57
- | `nodejs-backend` | Node.js Backend Dev | Express, NestJS APIs |
58
- | `nextjs` | Next.js Specialist | Next.js apps |
59
-
60
- **Plus 10+ more agents** (see `src/agents/`)
61
-
62
- ### Slash Commands
63
- | Command | Purpose |
64
- |---------|---------|
65
- | `/create-increment` | Create new feature increment |
66
- | `/sync-docs` | Review strategic documentation |
67
- | `/sync-github` | Sync to GitHub issues |
68
- | `specweave init` | Bootstrap new project |
69
-
70
- **Plus more commands** (see `.claude/commands/`)
71
-
72
- ### Hooks (Auto-Update)
73
- | Hook | Purpose |
74
- |------|---------|
75
- | `post-task-completion` | Auto-update docs after tasks |
76
- | `pre-implementation` | Check regression risk |
77
- | `docs-changed` | Validate documentation |
78
-
79
- ## Installation
80
-
81
- ```bash
82
- # Install SpecWeave with Claude adapter (default)
83
- npx specweave init my-project
84
-
85
- # Or explicitly specify Claude adapter
86
- npx specweave init my-project --adapter claude
87
-
88
- # Install skills and agents
89
- cd my-project
90
- npm run install:skills
91
- npm run install:agents
92
- ```
93
-
94
- ## Directory Structure
95
-
96
- ```
97
- .claude/
98
- ā”œā”€ā”€ skills/ # Auto-activating capabilities
99
- │ ā”œā”€ā”€ specweave-detector/
100
- │ ā”œā”€ā”€ skill-router/
101
- │ ā”œā”€ā”€ context-loader/
102
- │ └── ...
103
- ā”œā”€ā”€ agents/ # Specialized roles
104
- │ ā”œā”€ā”€ pm/
105
- │ ā”œā”€ā”€ architect/
106
- │ ā”œā”€ā”€ devops/
107
- │ └── ...
108
- ā”œā”€ā”€ commands/ # Slash commands
109
- │ ā”œā”€ā”€ create-increment.md
110
- │ ā”œā”€ā”€ sync-docs.md
111
- │ └── ...
112
- └── hooks/ # Auto-update mechanisms
113
- ā”œā”€ā”€ post-task-completion.sh
114
- ā”œā”€ā”€ pre-implementation.sh
115
- └── ...
116
- ```
117
-
118
- ## Usage Examples
119
-
120
- ### Example 1: Create Feature (Full Automation)
121
-
122
- **User**: "Create increment for user authentication"
123
-
124
- **What Happens** (Automatic):
125
- 1. āœ… `specweave-detector` skill activates (detects SpecWeave project)
126
- 2. āœ… `skill-router` routes to `increment-planner`
127
- 3. āœ… `increment-planner` invokes `pm` agent
128
- 4. āœ… `pm` agent creates `spec.md` (WHAT/WHY)
129
- 5. āœ… `increment-planner` invokes `architect` agent
130
- 6. āœ… `architect` agent creates `plan.md` (HOW)
131
- 7. āœ… `increment-planner` creates `tasks.md` (implementation steps)
132
- 8. āœ… `context-loader` creates `context-manifest.yaml` (70%+ token savings)
133
-
134
- **Result**: Complete increment ready for implementation!
135
-
136
- ### Example 2: Review Documentation
137
-
138
- **User**: `/sync-docs`
139
-
140
- **What Happens** (Automatic):
141
- 1. āœ… Slash command loads `.claude/commands/sync-docs.md`
142
- 2. āœ… Reviews strategic docs (.specweave/docs/internal/strategy/)
143
- 3. āœ… Compares against actual implementation
144
- 4. āœ… Identifies gaps (undocumented features, outdated docs, tech debt)
145
- 5. āœ… Generates report
146
-
147
- ### Example 3: Sync to GitHub
148
-
149
- **User**: `/sync-github`
150
-
151
- **What Happens** (Automatic):
152
- 1. āœ… Reads increment spec.md and tasks.md
153
- 2. āœ… Creates/updates GitHub issue
154
- 3. āœ… Adds user stories as description
155
- 4. āœ… Adds tasks as checkable checklist
156
- 5. āœ… Stores issue number for bidirectional sync
157
-
158
- ## Comparison with Other Adapters
159
-
160
- | Feature | Claude | Cursor | Copilot | Generic |
161
- |---------|--------|--------|---------|---------|
162
- | **Automation** | Full | Semi | Basic | Manual |
163
- | **Skills** | Native | Simulated | N/A | N/A |
164
- | **Agents** | Native | Manual invoke | Manual invoke | Copy-paste |
165
- | **Hooks** | Native | N/A | N/A | N/A |
166
- | **Commands** | Slash commands | Instructions | Instructions | Copy-paste |
167
- | **Context Loading** | Auto | Manual ref | Manual ref | Copy-paste |
168
- | **File Access** | Native | Native | Native | Manual |
169
-
170
- **Claude Code = Gold Standard**
171
-
172
- ## Technical Details
173
-
174
- ### Skills Activation
175
-
176
- Skills activate automatically based on:
177
- - Description matching user's request
178
- - Keywords in skill YAML frontmatter
179
- - Context (SpecWeave project detected)
180
-
181
- **Example**:
182
- ```yaml
183
- ---
184
- name: increment-planner
185
- description: Plan features with context awareness. Activates for: create feature, plan increment, new feature.
186
- ---
187
- ```
188
-
189
- When user says "create feature", Claude Code automatically activates `increment-planner` skill.
190
-
191
- ### Agents Invocation
192
-
193
- Agents are invoked explicitly via Task tool:
194
-
195
- ```typescript
196
- await Task({
197
- subagent_type: "pm",
198
- prompt: "Create product requirements for user authentication",
199
- description: "Product requirements analysis"
200
- });
201
- ```
202
-
203
- Agents have separate context windows to prevent pollution of main conversation.
204
-
205
- ### Hooks Execution
206
-
207
- Hooks run automatically on events:
208
-
209
-
210
-
211
- When task completes → hook fires → docs auto-update.
212
-
213
- ## Why Other Tools Can't Fully Replicate This
214
-
215
- 1. **No native skills/agents support** - Must simulate via instruction files
216
- 2. **No separate context windows** - All context shared (can cause pollution)
217
- 3. **No hooks** - Can't auto-update on events
218
- 4. **No native MCP** - Context loading less efficient
219
-
220
- **But they can get close!** See Cursor, Copilot, and Generic adapters for approximations.
221
-
222
- ## Related Documentation
223
-
224
- - [SPECWEAVE.md](../../SPECWEAVE.md) - Complete development guide
225
- - [src/skills/](../../skills/) - All available skills
226
- - [src/agents/](../../agents/) - All available agents
227
- - [Adapter Architecture](../README.md) - Multi-tool design philosophy
228
-
229
- ---
230
-
231
- **Status**: Active (v0.1.0-beta.1+)
232
- **Market Share**: ~10% (Claude Code users)
233
- **Priority**: P1 (baseline/reference adapter)
@@ -1,468 +0,0 @@
1
- /**
2
- * Claude Code Adapter
3
- *
4
- * Full automation adapter for Claude Code.
5
- * Provides best-in-class experience with native skills, agents, hooks, and slash commands.
6
- *
7
- * This is the BASELINE adapter - all other adapters try to approximate this experience
8
- * within their tool's capabilities.
9
- */
10
-
11
- import * as path from 'path';
12
- import fs from 'fs-extra';
13
- import { AdapterBase } from '../adapter-base.js';
14
- import { AdapterOptions, AdapterFile } from '../adapter-interface.js';
15
- import type { Plugin } from '../../core/types/plugin.js';
16
- import { LanguageManager, getSystemPromptForLanguage } from '../../core/i18n/language-manager.js';
17
- import type { SupportedLanguage, I18nConfig } from '../../core/i18n/types.js';
18
-
19
- export class ClaudeAdapter extends AdapterBase {
20
- name = 'claude';
21
- description = 'Claude Code adapter - Full automation with skills, agents, hooks, and slash commands';
22
- automationLevel = 'full' as const;
23
-
24
- /**
25
- * Detect if Claude Code is available
26
- *
27
- * Checks for:
28
- * - claude command in PATH
29
- * - Claude Code CLI installation
30
- */
31
- async detect(): Promise<boolean> {
32
- // Check if claude CLI exists
33
- const hasClaudeCLI = await this.commandExists('claude');
34
-
35
- // Check if .claude directory exists (already using Claude)
36
- const hasClaudeDir = await this.fileExists('.claude');
37
-
38
- return hasClaudeCLI || hasClaudeDir;
39
- }
40
-
41
- /**
42
- * Get files to install for Claude adapter
43
- *
44
- * Claude Code v0.5.0+ uses native plugin loading via marketplace.
45
- * No file copying needed!
46
- */
47
- getFiles(): AdapterFile[] {
48
- return []; // No files to copy - native loading!
49
- }
50
-
51
- /**
52
- * Install Claude adapter
53
- *
54
- * Claude Code v0.5.0+ uses native plugin system with marketplace.
55
- * Installation steps:
56
- * 1. Create .specweave/ structure (project data)
57
- * 2. Show marketplace installation instructions
58
- * 3. User adds marketplace: /plugin marketplace add anton-abyzov/specweave
59
- * 4. User installs plugins: /plugin install specweave@specweave
60
- */
61
- async install(options: AdapterOptions): Promise<void> {
62
- console.log('\nšŸ“¦ Installing Claude Code Adapter (Native Plugin System)\n');
63
-
64
- // Create .specweave/ structure (project data only)
65
- const specweaveDir = path.join(options.projectPath, '.specweave');
66
- await fs.ensureDir(specweaveDir);
67
- await fs.ensureDir(path.join(specweaveDir, 'increments'));
68
- await fs.ensureDir(path.join(specweaveDir, 'increments', '_backlog'));
69
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'strategy'));
70
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'architecture', 'adr'));
71
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'architecture', 'rfc'));
72
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'architecture', 'diagrams'));
73
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'delivery'));
74
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'public', 'guides'));
75
- await fs.ensureDir(path.join(specweaveDir, 'logs'));
76
-
77
- console.log('\nāœ… Created .specweave/ structure');
78
- console.log('\nšŸ“‹ Next steps - Install SpecWeave plugins:');
79
- console.log('\n 1ļøāƒ£ Add SpecWeave marketplace:');
80
- console.log(' /plugin marketplace add anton-abyzov/specweave');
81
- console.log('\n 2ļøāƒ£ Install SpecWeave core:');
82
- console.log(' /plugin install specweave@specweave');
83
- console.log('\n 3ļøāƒ£ (Optional) Install GitHub plugin:');
84
- console.log(' /plugin install specweave-github@specweave');
85
- console.log('\n 4ļøāƒ£ Start using SpecWeave:');
86
- console.log(' /specweave.inc "create a todo app"');
87
- console.log('\nšŸ’” Tip: Plugins load natively - no file copying needed!');
88
- }
89
-
90
- /**
91
- * Post-installation instructions
92
- */
93
- async postInstall(options: AdapterOptions): Promise<void> {
94
- console.log(this.getInstructions());
95
- }
96
-
97
- /**
98
- * Get usage instructions for Claude adapter
99
- */
100
- getInstructions(): string {
101
- return `
102
-
103
- ================================================================
104
- Claude Code Adapter - Full Automation
105
- ================================================================
106
-
107
- Your project is now configured for Claude Code with FULL automation!
108
-
109
- QUICK START:
110
-
111
- 1. Install components:
112
- npm run install:skills # Install all skills
113
- npm run install:agents # Install all agents
114
-
115
- 2. Create your first feature:
116
- Just ask Claude: "Create increment for user authentication"
117
- - specweave-detector skill activates automatically
118
- - skill-router routes to increment-planner
119
- - PM agent creates spec.md
120
- - Architect agent creates plan.md
121
-
122
- 3. Use slash commands:
123
- /create-increment "payment processing"
124
- /review-docs
125
- /sync-github
126
-
127
- WHAT THIS PROVIDES:
128
-
129
- - Skills (Auto-Activating): specweave-detector, skill-router, context-loader, increment-planner
130
- - Agents (Specialized Roles): PM, Architect, DevOps, QA, Security, and 14 more
131
- - Slash Commands: /specweave inc, /specweave do, /specweave validate, /specweave sync-github
132
- - Hooks (Auto-Update): post-task-completion, pre-implementation, docs-changed
133
-
134
- WHY CLAUDE CODE IS BEST:
135
-
136
- Anthropic Sets Standards (MCP, Skills, Agents) that provide superior results:
137
- - MCP Protocol: Native context management, efficient, standardized
138
- - Skills + Agents: Proven patterns, auto-activation, role-based, separate contexts
139
- - Native Tools: Direct file access, real-time execution
140
- - Result: Superior accuracy, speed, and developer UX
141
-
142
- DOCUMENTATION:
143
-
144
- - SPECWEAVE.md: Complete development guide
145
- - .specweave/docs/: Project documentation (5-pillar)
146
- - src/skills/: All available skills
147
- - src/agents/: All available agents
148
-
149
- You're ready to build with SpecWeave on Claude Code!
150
-
151
- For complete documentation, see: .claude/README.md
152
- `;
153
- }
154
-
155
- /**
156
- * Check if Claude adapter supports plugins
157
- *
158
- * Claude Code has FULL plugin support via native .claude/ directory
159
- *
160
- * @returns boolean Always true
161
- */
162
- supportsPlugins(): boolean {
163
- return true;
164
- }
165
-
166
- /**
167
- * Check if Claude Code native plugin system is available
168
- *
169
- * Detects if /plugin commands are supported in current Claude Code version
170
- *
171
- * @returns boolean True if native plugin commands available
172
- */
173
- async supportsNativePlugins(): Promise<boolean> {
174
- // Check if .claude/plugins directory exists (indicates native plugin support)
175
- const projectPath = process.cwd();
176
- const nativePluginsDir = path.join(projectPath, '.claude', 'plugins');
177
-
178
- if (await fs.pathExists(nativePluginsDir)) {
179
- return true;
180
- }
181
-
182
- // Check if plugin.json format is present in any installed plugins
183
- const claudeDir = path.join(projectPath, '.claude');
184
- if (await fs.pathExists(claudeDir)) {
185
- const entries = await fs.readdir(claudeDir, { withFileTypes: true });
186
- for (const entry of entries) {
187
- if (entry.isDirectory()) {
188
- const pluginJsonPath = path.join(claudeDir, entry.name, '.claude-plugin', 'plugin.json');
189
- if (await fs.pathExists(pluginJsonPath)) {
190
- return true;
191
- }
192
- }
193
- }
194
- }
195
-
196
- return false;
197
- }
198
-
199
- /**
200
- * Get installation instructions based on available plugin system
201
- *
202
- * Returns instructions for either:
203
- * - Native /plugin commands (if supported)
204
- * - SpecWeave CLI fallback (always available)
205
- *
206
- * @param pluginName Name of plugin to install
207
- * @returns Installation instructions
208
- */
209
- async getPluginInstallInstructions(pluginName: string): Promise<string> {
210
- const hasNativePlugins = await this.supportsNativePlugins();
211
-
212
- if (hasNativePlugins) {
213
- return `
214
- Installation Options:
215
-
216
- Option 1 (Recommended): Native Claude Code
217
- /plugin marketplace add specweave/marketplace
218
- /plugin install ${pluginName}@specweave
219
-
220
- Option 2: SpecWeave CLI
221
- specweave plugin install ${pluginName}
222
-
223
- Both methods install the same plugin - choose based on preference!
224
- `.trim();
225
- }
226
-
227
- return `
228
- Installation:
229
- specweave plugin install ${pluginName}
230
-
231
- Note: Native /plugin commands not detected in your Claude Code version.
232
- Using SpecWeave CLI for plugin management.
233
- `.trim();
234
- }
235
-
236
- /**
237
- * Read language configuration from project config
238
- *
239
- * @returns Language setting from config, defaults to 'en'
240
- */
241
- private async getLanguageConfig(): Promise<SupportedLanguage> {
242
- const projectPath = process.cwd();
243
- const configPath = path.join(projectPath, '.specweave', 'config.json');
244
-
245
- if (!(await fs.pathExists(configPath))) {
246
- return 'en'; // Default to English if no config
247
- }
248
-
249
- try {
250
- const config = await fs.readJson(configPath);
251
- return (config.language as SupportedLanguage) || 'en';
252
- } catch (error) {
253
- console.warn('āš ļø Could not read language from config, defaulting to English');
254
- return 'en';
255
- }
256
- }
257
-
258
- /**
259
- * Inject system prompt for non-English languages
260
- *
261
- * Prepends language instruction to markdown content if language !== 'en'
262
- *
263
- * @param content Original markdown content
264
- * @param language Target language
265
- * @returns Modified content with system prompt (or unchanged if English)
266
- */
267
- private injectSystemPrompt(content: string, language: SupportedLanguage): string {
268
- if (language === 'en') {
269
- return content; // No changes for English - preserve default behavior
270
- }
271
-
272
- // Get system prompt for target language
273
- const systemPrompt = getSystemPromptForLanguage(language);
274
-
275
- // Inject system prompt at the top (after YAML frontmatter if present)
276
- if (content.startsWith('---')) {
277
- // Has YAML frontmatter - inject after closing ---
278
- const endOfFrontmatter = content.indexOf('---', 3);
279
- if (endOfFrontmatter !== -1) {
280
- const frontmatter = content.substring(0, endOfFrontmatter + 3);
281
- const body = content.substring(endOfFrontmatter + 3);
282
- return `${frontmatter}\n\n${systemPrompt}\n${body}`;
283
- }
284
- }
285
-
286
- // No frontmatter - inject at the very top
287
- return `${systemPrompt}\n\n${content}`;
288
- }
289
-
290
- /**
291
- * Compile and install a plugin for Claude Code
292
- *
293
- * Claude uses native plugin installation:
294
- * - Copy skills to .claude/skills/{plugin-name}/{skill-name}/
295
- * - Copy agents to .claude/agents/{plugin-name}/{agent-name}/
296
- * - Copy commands to .claude/commands/
297
- *
298
- * Supports both:
299
- * - Native /plugin install (if Claude Code supports it)
300
- * - SpecWeave CLI fallback (always available)
301
- *
302
- * NEW: Injects system prompts for non-English languages
303
- *
304
- * @param plugin Plugin to install
305
- */
306
- async compilePlugin(plugin: Plugin): Promise<void> {
307
- const projectPath = process.cwd();
308
- const claudeDir = path.join(projectPath, '.claude');
309
-
310
- console.log(`\nšŸ“¦ Installing plugin: ${plugin.manifest.name}`);
311
-
312
- // Get language configuration for system prompt injection
313
- const language = await this.getLanguageConfig();
314
- if (language !== 'en') {
315
- console.log(` 🌐 Language: ${language} (system prompts will be injected)`);
316
- }
317
-
318
- // Check for native plugin support
319
- const hasNativePlugins = await this.supportsNativePlugins();
320
- if (hasNativePlugins) {
321
- console.log(' šŸ’” Tip: You can also use native /plugin commands:');
322
- console.log(` /plugin marketplace add specweave/marketplace`);
323
- console.log(` /plugin install ${plugin.manifest.name.replace('specweave-', '')}@specweave`);
324
- console.log('');
325
- }
326
-
327
- // Ensure base directories exist
328
- await fs.ensureDir(path.join(claudeDir, 'skills'));
329
- await fs.ensureDir(path.join(claudeDir, 'agents'));
330
- await fs.ensureDir(path.join(claudeDir, 'commands'));
331
-
332
- // Install skills
333
- for (const skill of plugin.skills) {
334
- const targetPath = path.join(claudeDir, 'skills', skill.name);
335
- await fs.ensureDir(targetPath);
336
-
337
- // Copy SKILL.md (with language injection if needed)
338
- const skillMdPath = path.join(skill.path, 'SKILL.md');
339
- if (await fs.pathExists(skillMdPath)) {
340
- const content = await fs.readFile(skillMdPath, 'utf-8');
341
- const modifiedContent = this.injectSystemPrompt(content, language);
342
- await fs.writeFile(path.join(targetPath, 'SKILL.md'), modifiedContent, 'utf-8');
343
- }
344
-
345
- // Copy test cases if they exist
346
- const testCasesDir = path.join(skill.path, 'test-cases');
347
- if (await fs.pathExists(testCasesDir)) {
348
- await fs.copy(testCasesDir, path.join(targetPath, 'test-cases'));
349
- }
350
-
351
- console.log(` āœ“ Skill: ${skill.name}`);
352
- }
353
-
354
- // Install agents
355
- for (const agent of plugin.agents) {
356
- const targetPath = path.join(claudeDir, 'agents', agent.name);
357
- await fs.ensureDir(targetPath);
358
-
359
- // Copy AGENT.md (with language injection if needed)
360
- const agentMdPath = path.join(agent.path, 'AGENT.md');
361
- if (await fs.pathExists(agentMdPath)) {
362
- const content = await fs.readFile(agentMdPath, 'utf-8');
363
- const modifiedContent = this.injectSystemPrompt(content, language);
364
- await fs.writeFile(path.join(targetPath, 'AGENT.md'), modifiedContent, 'utf-8');
365
- }
366
-
367
- console.log(` āœ“ Agent: ${agent.name}`);
368
- }
369
-
370
- // Install commands
371
- for (const command of plugin.commands) {
372
- // Commands use their full name as filename
373
- const fileName = command.name.replace(/\./g, '-') + '.md';
374
- const targetPath = path.join(claudeDir, 'commands', fileName);
375
-
376
- if (await fs.pathExists(command.path)) {
377
- const content = await fs.readFile(command.path, 'utf-8');
378
- const modifiedContent = this.injectSystemPrompt(content, language);
379
- await fs.writeFile(targetPath, modifiedContent, 'utf-8');
380
- }
381
-
382
- console.log(` āœ“ Command: /${command.name}`);
383
- }
384
-
385
- console.log(`\nāœ… Plugin ${plugin.manifest.name} installed!`);
386
- }
387
-
388
- /**
389
- * Unload a plugin from Claude Code
390
- *
391
- * Removes plugin files from .claude/ directory
392
- *
393
- * @param pluginName Name of plugin to unload
394
- */
395
- async unloadPlugin(pluginName: string): Promise<void> {
396
- const projectPath = process.cwd();
397
- const claudeDir = path.join(projectPath, '.claude');
398
-
399
- console.log(`\nšŸ—‘ļø Unloading plugin: ${pluginName}`);
400
-
401
- // Read plugin manifest to know what to remove
402
- const pluginsDir = path.join(projectPath, 'src', 'plugins');
403
- const pluginPath = path.join(pluginsDir, pluginName);
404
-
405
- if (!(await fs.pathExists(pluginPath))) {
406
- console.warn(`āš ļø Plugin ${pluginName} not found`);
407
- return;
408
- }
409
-
410
- // Load plugin to get its components
411
- const { PluginLoader } = await import('../../core/plugin-loader.js');
412
- const loader = new PluginLoader();
413
- const plugin = await loader.loadFromDirectory(pluginPath);
414
-
415
- // Remove skills
416
- for (const skill of plugin.skills) {
417
- const skillPath = path.join(claudeDir, 'skills', skill.name);
418
- if (await fs.pathExists(skillPath)) {
419
- await fs.remove(skillPath);
420
- console.log(` āœ“ Removed skill: ${skill.name}`);
421
- }
422
- }
423
-
424
- // Remove agents
425
- for (const agent of plugin.agents) {
426
- const agentPath = path.join(claudeDir, 'agents', agent.name);
427
- if (await fs.pathExists(agentPath)) {
428
- await fs.remove(agentPath);
429
- console.log(` āœ“ Removed agent: ${agent.name}`);
430
- }
431
- }
432
-
433
- // Remove commands
434
- for (const command of plugin.commands) {
435
- const fileName = command.name.replace(/\./g, '-') + '.md';
436
- const commandPath = path.join(claudeDir, 'commands', fileName);
437
- if (await fs.pathExists(commandPath)) {
438
- await fs.remove(commandPath);
439
- console.log(` āœ“ Removed command: /${command.name}`);
440
- }
441
- }
442
-
443
- console.log(`\nāœ… Plugin ${pluginName} unloaded!`);
444
- }
445
-
446
- /**
447
- * Get list of installed plugins
448
- *
449
- * Returns plugin names that are currently installed in .claude/
450
- *
451
- * @returns Array of installed plugin names
452
- */
453
- async getInstalledPlugins(): Promise<string[]> {
454
- const projectPath = process.cwd();
455
- const configPath = path.join(projectPath, '.specweave', 'config.yaml');
456
-
457
- if (!(await fs.pathExists(configPath))) {
458
- return [];
459
- }
460
-
461
- // Read config to get enabled plugins
462
- const yaml = await import('js-yaml');
463
- const content = await fs.readFile(configPath, 'utf-8');
464
- const config = yaml.load(content) as any;
465
-
466
- return config.plugins?.enabled || [];
467
- }
468
- }