specweave 0.6.7 → 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 (281) hide show
  1. package/.claude-plugin/README.md +1 -1
  2. package/CLAUDE.md +920 -107
  3. package/README.md +143 -207
  4. package/bin/specweave.js +67 -0
  5. package/dist/adapters/adapter-interface.d.ts +11 -11
  6. package/dist/adapters/adapter-interface.d.ts.map +1 -1
  7. package/dist/adapters/adapter-interface.js +1 -1
  8. package/dist/adapters/adapter-loader.d.ts +1 -2
  9. package/dist/adapters/adapter-loader.d.ts.map +1 -1
  10. package/dist/adapters/adapter-loader.js +3 -6
  11. package/dist/adapters/adapter-loader.js.map +1 -1
  12. package/dist/adapters/agents-md-generator.d.ts +3 -3
  13. package/dist/adapters/agents-md-generator.js +3 -3
  14. package/dist/adapters/generic/adapter.d.ts +2 -2
  15. package/dist/adapters/generic/adapter.d.ts.map +1 -1
  16. package/dist/adapters/generic/adapter.js +28 -9
  17. package/dist/adapters/generic/adapter.js.map +1 -1
  18. package/dist/cli/commands/abandon.d.ts +13 -0
  19. package/dist/cli/commands/abandon.d.ts.map +1 -0
  20. package/dist/cli/commands/abandon.js +15 -0
  21. package/dist/cli/commands/abandon.js.map +1 -0
  22. package/dist/cli/commands/init.d.ts.map +1 -1
  23. package/dist/cli/commands/init.js +141 -40
  24. package/dist/cli/commands/init.js.map +1 -1
  25. package/dist/cli/commands/pause.d.ts +13 -0
  26. package/dist/cli/commands/pause.d.ts.map +1 -0
  27. package/dist/cli/commands/pause.js +15 -0
  28. package/dist/cli/commands/pause.js.map +1 -0
  29. package/dist/cli/commands/qa.d.ts +54 -0
  30. package/dist/cli/commands/qa.d.ts.map +1 -0
  31. package/dist/cli/commands/qa.js +98 -0
  32. package/dist/cli/commands/qa.js.map +1 -0
  33. package/dist/cli/commands/resume.d.ts +12 -0
  34. package/dist/cli/commands/resume.d.ts.map +1 -0
  35. package/dist/cli/commands/resume.js +14 -0
  36. package/dist/cli/commands/resume.js.map +1 -0
  37. package/dist/cli/commands/status.d.ts +12 -0
  38. package/dist/cli/commands/status.d.ts.map +1 -0
  39. package/dist/cli/commands/status.js +23 -0
  40. package/dist/cli/commands/status.js.map +1 -0
  41. package/dist/cli/helpers/issue-tracker/ado.d.ts +57 -0
  42. package/dist/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
  43. package/dist/cli/helpers/issue-tracker/ado.js +223 -0
  44. package/dist/cli/helpers/issue-tracker/ado.js.map +1 -0
  45. package/dist/cli/helpers/issue-tracker/github.d.ts +65 -0
  46. package/dist/cli/helpers/issue-tracker/github.d.ts.map +1 -0
  47. package/dist/cli/helpers/issue-tracker/github.js +284 -0
  48. package/dist/cli/helpers/issue-tracker/github.js.map +1 -0
  49. package/dist/cli/helpers/issue-tracker/index.d.ts +22 -0
  50. package/dist/cli/helpers/issue-tracker/index.d.ts.map +1 -0
  51. package/dist/cli/helpers/issue-tracker/index.js +270 -0
  52. package/dist/cli/helpers/issue-tracker/index.js.map +1 -0
  53. package/dist/cli/helpers/issue-tracker/jira.d.ts +61 -0
  54. package/dist/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
  55. package/dist/cli/helpers/issue-tracker/jira.js +265 -0
  56. package/dist/cli/helpers/issue-tracker/jira.js.map +1 -0
  57. package/dist/cli/helpers/issue-tracker/types.d.ts +86 -0
  58. package/dist/cli/helpers/issue-tracker/types.d.ts.map +1 -0
  59. package/dist/cli/helpers/issue-tracker/types.js +16 -0
  60. package/dist/cli/helpers/issue-tracker/types.js.map +1 -0
  61. package/dist/cli/helpers/issue-tracker/utils.d.ts +103 -0
  62. package/dist/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
  63. package/dist/cli/helpers/issue-tracker/utils.js +240 -0
  64. package/dist/cli/helpers/issue-tracker/utils.js.map +1 -0
  65. package/dist/core/increment/limits.d.ts +68 -0
  66. package/dist/core/increment/limits.d.ts.map +1 -0
  67. package/dist/core/increment/limits.js +224 -0
  68. package/dist/core/increment/limits.js.map +1 -0
  69. package/dist/core/increment/metadata-manager.d.ts +114 -0
  70. package/dist/core/increment/metadata-manager.d.ts.map +1 -0
  71. package/dist/core/increment/metadata-manager.js +320 -0
  72. package/dist/core/increment/metadata-manager.js.map +1 -0
  73. package/dist/core/increment/status-commands.d.ts +43 -0
  74. package/dist/core/increment/status-commands.d.ts.map +1 -0
  75. package/dist/core/increment/status-commands.js +277 -0
  76. package/dist/core/increment/status-commands.js.map +1 -0
  77. package/dist/core/plugin-detector.d.ts +1 -0
  78. package/dist/core/plugin-detector.d.ts.map +1 -1
  79. package/dist/core/plugin-detector.js +25 -0
  80. package/dist/core/plugin-detector.js.map +1 -1
  81. package/dist/core/qa/qa-runner.d.ts +16 -0
  82. package/dist/core/qa/qa-runner.d.ts.map +1 -0
  83. package/dist/core/qa/qa-runner.js +404 -0
  84. package/dist/core/qa/qa-runner.js.map +1 -0
  85. package/dist/core/qa/quality-gate-decider.d.ts +53 -0
  86. package/dist/core/qa/quality-gate-decider.d.ts.map +1 -0
  87. package/dist/core/qa/quality-gate-decider.js +268 -0
  88. package/dist/core/qa/quality-gate-decider.js.map +1 -0
  89. package/dist/core/qa/risk-calculator.d.ts +126 -0
  90. package/dist/core/qa/risk-calculator.d.ts.map +1 -0
  91. package/dist/core/qa/risk-calculator.js +247 -0
  92. package/dist/core/qa/risk-calculator.js.map +1 -0
  93. package/dist/core/qa/types.d.ts +315 -0
  94. package/dist/core/qa/types.d.ts.map +1 -0
  95. package/dist/core/qa/types.js +8 -0
  96. package/dist/core/qa/types.js.map +1 -0
  97. package/dist/core/types/config.d.ts +37 -2
  98. package/dist/core/types/config.d.ts.map +1 -1
  99. package/dist/core/types/config.js +16 -0
  100. package/dist/core/types/config.js.map +1 -1
  101. package/dist/core/types/increment-metadata.d.ts +120 -0
  102. package/dist/core/types/increment-metadata.d.ts.map +1 -0
  103. package/dist/core/types/increment-metadata.js +138 -0
  104. package/dist/core/types/increment-metadata.js.map +1 -0
  105. package/dist/hooks/lib/invoke-translator-skill.d.ts +60 -0
  106. package/dist/hooks/lib/invoke-translator-skill.d.ts.map +1 -0
  107. package/dist/hooks/lib/invoke-translator-skill.js +201 -0
  108. package/dist/hooks/lib/invoke-translator-skill.js.map +1 -0
  109. package/dist/hooks/lib/translate-file.d.ts +59 -0
  110. package/dist/hooks/lib/translate-file.d.ts.map +1 -0
  111. package/dist/hooks/lib/translate-file.js +350 -0
  112. package/dist/hooks/lib/translate-file.js.map +1 -0
  113. package/dist/locales/en/cli.json +3 -1
  114. package/dist/metrics/calculators/change-failure-rate.d.ts +22 -0
  115. package/dist/metrics/calculators/change-failure-rate.d.ts.map +1 -0
  116. package/dist/metrics/calculators/change-failure-rate.js +70 -0
  117. package/dist/metrics/calculators/change-failure-rate.js.map +1 -0
  118. package/dist/metrics/calculators/deployment-frequency.d.ts +20 -0
  119. package/dist/metrics/calculators/deployment-frequency.d.ts.map +1 -0
  120. package/dist/metrics/calculators/deployment-frequency.js +61 -0
  121. package/dist/metrics/calculators/deployment-frequency.js.map +1 -0
  122. package/dist/metrics/calculators/lead-time.d.ts +22 -0
  123. package/dist/metrics/calculators/lead-time.d.ts.map +1 -0
  124. package/dist/metrics/calculators/lead-time.js +82 -0
  125. package/dist/metrics/calculators/lead-time.js.map +1 -0
  126. package/dist/metrics/calculators/mttr.d.ts +21 -0
  127. package/dist/metrics/calculators/mttr.d.ts.map +1 -0
  128. package/dist/metrics/calculators/mttr.js +60 -0
  129. package/dist/metrics/calculators/mttr.js.map +1 -0
  130. package/dist/metrics/dora-calculator.d.ts +24 -0
  131. package/dist/metrics/dora-calculator.d.ts.map +1 -0
  132. package/dist/metrics/dora-calculator.js +104 -0
  133. package/dist/metrics/dora-calculator.js.map +1 -0
  134. package/dist/metrics/github-client.d.ts +51 -0
  135. package/dist/metrics/github-client.d.ts.map +1 -0
  136. package/dist/metrics/github-client.js +133 -0
  137. package/dist/metrics/github-client.js.map +1 -0
  138. package/dist/metrics/types.d.ts +112 -0
  139. package/dist/metrics/types.d.ts.map +1 -0
  140. package/dist/metrics/types.js +10 -0
  141. package/dist/metrics/types.js.map +1 -0
  142. package/dist/metrics/utils/percentile.d.ts +25 -0
  143. package/dist/metrics/utils/percentile.d.ts.map +1 -0
  144. package/dist/metrics/utils/percentile.js +46 -0
  145. package/dist/metrics/utils/percentile.js.map +1 -0
  146. package/dist/metrics/utils/tier-classifier.d.ts +61 -0
  147. package/dist/metrics/utils/tier-classifier.d.ts.map +1 -0
  148. package/dist/metrics/utils/tier-classifier.js +100 -0
  149. package/dist/metrics/utils/tier-classifier.js.map +1 -0
  150. package/dist/utils/auth-helpers.d.ts +58 -0
  151. package/dist/utils/auth-helpers.d.ts.map +1 -0
  152. package/dist/utils/auth-helpers.js +108 -0
  153. package/dist/utils/auth-helpers.js.map +1 -0
  154. package/dist/utils/env-file.d.ts +88 -0
  155. package/dist/utils/env-file.d.ts.map +1 -0
  156. package/dist/utils/env-file.js +180 -0
  157. package/dist/utils/env-file.js.map +1 -0
  158. package/dist/utils/plugin-detection.d.ts +50 -0
  159. package/dist/utils/plugin-detection.d.ts.map +1 -0
  160. package/dist/utils/plugin-detection.js +229 -0
  161. package/dist/utils/plugin-detection.js.map +1 -0
  162. package/dist/utils/secrets-loader.d.ts +88 -0
  163. package/dist/utils/secrets-loader.d.ts.map +1 -0
  164. package/dist/utils/secrets-loader.js +271 -0
  165. package/dist/utils/secrets-loader.js.map +1 -0
  166. package/dist/utils/translation.d.ts +187 -0
  167. package/dist/utils/translation.d.ts.map +1 -0
  168. package/dist/utils/translation.js +414 -0
  169. package/dist/utils/translation.js.map +1 -0
  170. package/package.json +28 -44
  171. package/plugins/specweave/.claude-plugin/plugin.json +3 -3
  172. package/plugins/specweave/agents/pm/AGENT.md +330 -54
  173. package/plugins/specweave/agents/test-aware-planner/AGENT.md +1035 -0
  174. package/plugins/specweave/agents/test-aware-planner/templates/README.md +118 -0
  175. package/plugins/specweave/agents/test-aware-planner/templates/task-non-testable.md.template +24 -0
  176. package/plugins/specweave/agents/test-aware-planner/templates/task-testable.md.template +53 -0
  177. package/plugins/specweave/agents/test-aware-planner/templates/tasks-frontmatter.md.template +11 -0
  178. package/plugins/specweave/commands/README.md +88 -163
  179. package/plugins/specweave/commands/specweave-abandon.md +314 -0
  180. package/plugins/specweave/commands/specweave-check-tests.md +546 -0
  181. package/plugins/specweave/commands/{do.md → specweave-do.md} +5 -5
  182. package/plugins/specweave/commands/{done.md → specweave-done.md} +2 -0
  183. package/plugins/specweave/commands/{increment.md → specweave-increment.md} +231 -4
  184. package/plugins/specweave/commands/specweave-pause.md +189 -0
  185. package/plugins/specweave/commands/specweave-qa.md +245 -0
  186. package/plugins/specweave/commands/specweave-resume.md +216 -0
  187. package/plugins/specweave/commands/specweave-status.md +397 -0
  188. package/plugins/specweave/commands/specweave-sync-tasks.md +256 -0
  189. package/plugins/specweave/commands/{translate.md → specweave-translate.md} +3 -3
  190. package/plugins/specweave/commands/specweave-update-scope.md +351 -0
  191. package/plugins/specweave/commands/{validate.md → specweave-validate.md} +2 -0
  192. package/plugins/specweave/commands/specweave.md +21 -21
  193. package/plugins/specweave/hooks/docs-changed.sh +23 -3
  194. package/plugins/specweave/hooks/human-input-required.sh +23 -3
  195. package/plugins/specweave/hooks/post-increment-planning.sh +335 -0
  196. package/plugins/specweave/hooks/post-task-completion.sh +161 -1
  197. package/plugins/specweave/hooks/pre-implementation.sh +23 -3
  198. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  199. package/plugins/specweave/skills/brownfield-analyzer/SKILL.md +9 -9
  200. package/plugins/specweave/skills/increment-planner/SKILL.md +400 -212
  201. package/plugins/specweave/skills/increment-quality-judge-v2/SKILL.md +499 -0
  202. package/plugins/specweave/skills/plugin-detector/SKILL.md +114 -1
  203. package/plugins/specweave/skills/project-kickstarter/SKILL.md +74 -1
  204. package/plugins/specweave/skills/{rfc-generator → spec-generator}/SKILL.md +22 -29
  205. package/plugins/specweave/skills/specweave-detector/SKILL.md +3 -3
  206. package/plugins/specweave/skills/specweave-framework/SKILL.md +2 -2
  207. package/plugins/specweave-ado/.claude-plugin/plugin.json +18 -4
  208. package/plugins/specweave-ado/agents/ado-manager/AGENT.md +426 -0
  209. package/plugins/specweave-ado/commands/close-workitem.md +52 -0
  210. package/plugins/specweave-ado/commands/create-workitem.md +53 -0
  211. package/plugins/specweave-ado/commands/status.md +53 -0
  212. package/plugins/specweave-ado/commands/sync.md +55 -0
  213. package/plugins/specweave-ado/lib/ado-client.ts +361 -0
  214. package/plugins/specweave-ado/reference/ado-specweave-mapping.md +552 -0
  215. package/plugins/specweave-ado/skills/ado-sync/SKILL.md +344 -193
  216. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +73 -0
  217. package/plugins/specweave-github/agents/github-manager/AGENT.md +49 -0
  218. package/plugins/specweave-github/commands/{github-close-issue.md → close-issue.md} +1 -1
  219. package/plugins/specweave-github/commands/{github-create-issue.md → create-issue.md} +1 -1
  220. package/plugins/specweave-github/commands/{github-status.md → status.md} +1 -1
  221. package/plugins/specweave-github/commands/{github-sync-tasks.md → sync-tasks.md} +1 -1
  222. package/plugins/specweave-github/commands/{github-sync.md → sync.md} +1 -1
  223. package/plugins/specweave-github/reference/github-specweave-mapping.md +377 -0
  224. package/plugins/specweave-github/skills/github-sync/SKILL.md +11 -3
  225. package/plugins/specweave-infrastructure/commands/{specweave.monitor-setup.md → monitor-setup.md} +5 -0
  226. package/plugins/specweave-infrastructure/commands/{specweave.slo-implement.md → slo-implement.md} +5 -0
  227. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +380 -0
  228. package/plugins/specweave-jira/commands/{specweave.sync-jira.md → sync.md} +1 -1
  229. package/plugins/specweave-jira/reference/jira-specweave-mapping.md +508 -0
  230. package/plugins/specweave-ml/commands/ml-deploy.md +1 -1
  231. package/plugins/specweave-ml/commands/ml-evaluate.md +1 -1
  232. package/plugins/specweave-ml/commands/ml-explain.md +1 -1
  233. package/plugins/specweave-ml/commands/{specweave.ml-pipeline.md → ml-pipeline.md} +5 -0
  234. package/src/templates/AGENTS.md.template +652 -1
  235. package/src/templates/CLAUDE.md.template +36 -21
  236. package/src/templates/COMPLETION-REPORT.template.md +128 -0
  237. package/src/templates/README.md.template +17 -16
  238. package/src/templates/docs/README.md +11 -9
  239. package/src/templates/docs/spec-template.md +229 -0
  240. package/dist/adapters/copilot/adapter.d.ts +0 -86
  241. package/dist/adapters/copilot/adapter.d.ts.map +0 -1
  242. package/dist/adapters/copilot/adapter.js +0 -396
  243. package/dist/adapters/copilot/adapter.js.map +0 -1
  244. package/plugins/.specweave/logs/hooks-debug.log +0 -24
  245. package/plugins/.specweave/logs/last-hook-fire +0 -1
  246. package/plugins/.specweave/logs/last-todowrite-time +0 -1
  247. package/plugins/.specweave/logs/tasks.log +0 -6
  248. package/plugins/specweave/commands/inc.md +0 -85
  249. package/plugins/specweave/commands/list-increments.md +0 -180
  250. package/src/adapters/README.md +0 -311
  251. package/src/adapters/adapter-base.ts +0 -182
  252. package/src/adapters/adapter-interface.ts +0 -166
  253. package/src/adapters/adapter-loader.ts +0 -259
  254. package/src/adapters/agents-md-generator.ts +0 -228
  255. package/src/adapters/claude/README.md +0 -233
  256. package/src/adapters/claude/adapter.ts +0 -468
  257. package/src/adapters/claude-md-generator.ts +0 -377
  258. package/src/adapters/codex/README.md +0 -105
  259. package/src/adapters/codex/adapter.ts +0 -333
  260. package/src/adapters/copilot/README.md +0 -240
  261. package/src/adapters/copilot/adapter.ts +0 -444
  262. package/src/adapters/cursor/.cursor/context/docs-context.md +0 -62
  263. package/src/adapters/cursor/.cursor/context/increments-context.md +0 -71
  264. package/src/adapters/cursor/.cursor/context/strategy-context.md +0 -73
  265. package/src/adapters/cursor/.cursor/context/tests-context.md +0 -89
  266. package/src/adapters/cursor/README.md +0 -283
  267. package/src/adapters/cursor/adapter.ts +0 -451
  268. package/src/adapters/doc-generator.ts +0 -331
  269. package/src/adapters/gemini/README.md +0 -97
  270. package/src/adapters/gemini/adapter.ts +0 -298
  271. package/src/adapters/generic/README.md +0 -277
  272. package/src/adapters/generic/adapter.ts +0 -359
  273. package/src/adapters/registry.yaml +0 -187
  274. /package/plugins/specweave/commands/{costs.md → specweave-costs.md} +0 -0
  275. /package/plugins/specweave/commands/{next.md → specweave-next.md} +0 -0
  276. /package/plugins/specweave/commands/{progress.md → specweave-progress.md} +0 -0
  277. /package/plugins/specweave/commands/{sync-docs.md → specweave-sync-docs.md} +0 -0
  278. /package/plugins/specweave/commands/{tdd-cycle.md → specweave-tdd-cycle.md} +0 -0
  279. /package/plugins/specweave/commands/{tdd-green.md → specweave-tdd-green.md} +0 -0
  280. /package/plugins/specweave/commands/{tdd-red.md → specweave-tdd-red.md} +0 -0
  281. /package/plugins/specweave/commands/{tdd-refactor.md → specweave-tdd-refactor.md} +0 -0
@@ -1,166 +0,0 @@
1
- /**
2
- * Adapter Interface for Multi-Tool Support
3
- *
4
- * Defines the contract that all SpecWeave adapters must implement.
5
- * Enables SpecWeave to work with ANY AI coding tool (Claude, Cursor, Copilot, etc.)
6
- */
7
-
8
- import type { Plugin } from '../core/types/plugin.js';
9
-
10
- export interface AdapterOptions {
11
- projectPath: string;
12
- projectName: string;
13
- techStack?: {
14
- language: string;
15
- framework?: string;
16
- };
17
- docsApproach?: 'comprehensive' | 'incremental';
18
- }
19
-
20
- export interface RequirementsResult {
21
- met: boolean;
22
- missing: string[];
23
- warnings: string[];
24
- }
25
-
26
- export interface AdapterFile {
27
- sourcePath: string; // Path in src/adapters/{adapter-name}/
28
- targetPath: string; // Path in user's project (relative to project root)
29
- description: string; // What this file does
30
- }
31
-
32
- export type AutomationLevel = 'full' | 'semi' | 'basic' | 'manual';
33
-
34
- /**
35
- * Base Adapter Interface
36
- *
37
- * All adapters (Claude, Cursor, Copilot, Generic) must implement this interface.
38
- */
39
- export interface IAdapter {
40
- /**
41
- * Adapter name (e.g., 'claude', 'cursor', 'copilot', 'generic')
42
- */
43
- name: string;
44
-
45
- /**
46
- * Human-readable description of what this adapter provides
47
- */
48
- description: string;
49
-
50
- /**
51
- * Automation level this adapter provides
52
- * - full: Complete automation (skills, agents, hooks auto-activate)
53
- * - semi: Semi-automated (context shortcuts, multi-file editing)
54
- * - basic: Basic automation (workspace instructions, suggestions)
55
- * - manual: Manual workflow (step-by-step guide)
56
- */
57
- automationLevel: AutomationLevel;
58
-
59
- /**
60
- * Detect if this adapter's tool is present in the environment
61
- *
62
- * Examples:
63
- * - Claude: Check for Claude Code CLI
64
- * - Cursor: Check for .cursor/ directory or Cursor process
65
- * - Copilot: Check for .github/copilot/ or Copilot extension
66
- *
67
- * @returns Promise<boolean> True if tool detected
68
- */
69
- detect(): Promise<boolean>;
70
-
71
- /**
72
- * Check if system requirements are met for this adapter
73
- *
74
- * Examples:
75
- * - Node.js version >= 18
76
- * - Git installed
77
- * - Tool-specific requirements
78
- *
79
- * @returns Promise<RequirementsResult> Requirements check result
80
- */
81
- checkRequirements(): Promise<RequirementsResult>;
82
-
83
- /**
84
- * Get list of files this adapter will install
85
- *
86
- * @returns AdapterFile[] Array of files to install
87
- */
88
- getFiles(): AdapterFile[];
89
-
90
- /**
91
- * Install this adapter to a project
92
- *
93
- * Creates tool-specific files (e.g., .cursorrules, .github/copilot/instructions.md)
94
- * Installs relevant skills/agents if applicable
95
- *
96
- * @param options Installation options
97
- * @returns Promise<void>
98
- */
99
- install(options: AdapterOptions): Promise<void>;
100
-
101
- /**
102
- * Post-installation actions
103
- *
104
- * Examples:
105
- * - Create symlinks
106
- * - Update config files
107
- * - Display setup instructions to user
108
- *
109
- * @param options Installation options
110
- * @returns Promise<void>
111
- */
112
- postInstall(options: AdapterOptions): Promise<void>;
113
-
114
- /**
115
- * Get human-readable instructions for using this adapter
116
- *
117
- * Displayed to user after installation
118
- *
119
- * @returns string Markdown-formatted instructions
120
- */
121
- getInstructions(): string;
122
-
123
- /**
124
- * Check if this adapter supports plugins
125
- *
126
- * Returns true if the adapter can install and compile plugins
127
- * (Claude native, Cursor AGENTS.md, Copilot instructions.md)
128
- * Returns false for generic/manual adapters
129
- *
130
- * @returns boolean True if plugins are supported
131
- */
132
- supportsPlugins(): boolean;
133
-
134
- /**
135
- * Compile and install a plugin for this adapter
136
- *
137
- * Transforms plugin content (skills/agents/commands) to tool-specific format:
138
- * - Claude: Copy to .claude/skills/, .claude/agents/, .claude/commands/
139
- * - Cursor: Compile to AGENTS.md + team commands JSON
140
- * - Copilot: Compile to .github/copilot/instructions.md
141
- * - Generic: Generate manual copy-paste instructions
142
- *
143
- * @param plugin Plugin to compile and install
144
- * @returns Promise<void>
145
- */
146
- compilePlugin(plugin: Plugin): Promise<void>;
147
-
148
- /**
149
- * Unload (disable) a plugin for this adapter
150
- *
151
- * Removes plugin-specific files and restores previous state
152
- *
153
- * @param pluginName Name of plugin to unload
154
- * @returns Promise<void>
155
- */
156
- unloadPlugin(pluginName: string): Promise<void>;
157
-
158
- /**
159
- * Get plugin installation status
160
- *
161
- * Returns information about which plugins are currently installed
162
- *
163
- * @returns Promise<string[]> Array of installed plugin names
164
- */
165
- getInstalledPlugins(): Promise<string[]>;
166
- }
@@ -1,259 +0,0 @@
1
- /**
2
- * Adapter Loader
3
- *
4
- * Loads adapters from registry, detects tools, and provides API for init command.
5
- * Enables SpecWeave to work with ANY AI coding tool.
6
- */
7
-
8
- import fs from 'fs-extra';
9
- import * as path from 'path';
10
- import * as YAML from 'yaml';
11
- import { execSync } from 'child_process';
12
- import { IAdapter } from './adapter-interface.js';
13
- import { CursorAdapter } from './cursor/adapter.js';
14
- import { CopilotAdapter } from './copilot/adapter.js';
15
- import { GeminiAdapter } from './gemini/adapter.js';
16
- import { CodexAdapter } from './codex/adapter.js';
17
- import { GenericAdapter } from './generic/adapter.js';
18
- import { getDirname } from '../utils/esm-helpers.js';
19
-
20
- const __dirname = getDirname(import.meta.url);
21
-
22
- export interface AdapterRegistry {
23
- version: number;
24
- last_updated: string;
25
- adapters: Array<{
26
- name: string;
27
- description: string;
28
- automation_level: string;
29
- status: string;
30
- directory: string;
31
- market_share: string;
32
- priority: string;
33
- }>;
34
- }
35
-
36
- /**
37
- * Adapter Loader - Main API for working with adapters
38
- */
39
- export class AdapterLoader {
40
- private adapters: Map<string, IAdapter> = new Map();
41
- private registry: AdapterRegistry | null = null;
42
-
43
- constructor() {
44
- this.initializeAdapters();
45
- }
46
-
47
- /**
48
- * Initialize all adapters
49
- *
50
- * NOTE: Claude Code is NOT an adapter - it's the native/default experience!
51
- * Adapters only exist for tools that need to APPROXIMATE Claude's native capabilities.
52
- */
53
- private initializeAdapters(): void {
54
- // Note: No ClaudeAdapter - Claude is the baseline, not an adaptation!
55
- this.adapters.set('cursor', new CursorAdapter());
56
- this.adapters.set('copilot', new CopilotAdapter());
57
- this.adapters.set('gemini', new GeminiAdapter());
58
- this.adapters.set('codex', new CodexAdapter());
59
- this.adapters.set('generic', new GenericAdapter());
60
- }
61
-
62
- /**
63
- * Load registry.yaml
64
- */
65
- async loadRegistry(): Promise<AdapterRegistry> {
66
- if (this.registry) {
67
- return this.registry;
68
- }
69
-
70
- // Try dist first, then fall back to src (for development)
71
- let registryPath = path.join(__dirname, 'registry.yaml');
72
- if (!await fs.pathExists(registryPath)) {
73
- registryPath = path.join(__dirname, '../../src/adapters/registry.yaml');
74
- }
75
-
76
- const content = await fs.readFile(registryPath, 'utf-8');
77
- this.registry = YAML.parse(content) as AdapterRegistry;
78
-
79
- return this.registry;
80
- }
81
-
82
- /**
83
- * Get all available adapters
84
- */
85
- getAllAdapters(): IAdapter[] {
86
- return Array.from(this.adapters.values());
87
- }
88
-
89
- /**
90
- * Get adapter by name
91
- */
92
- getAdapter(name: string): IAdapter | undefined {
93
- return this.adapters.get(name);
94
- }
95
-
96
- /**
97
- * Auto-detect which tool is being used
98
- *
99
- * Detection priority (based on market share and probability):
100
- * 1. Claude Code (DEFAULT - best experience, native support)
101
- * 2. Cursor (if cursor CLI or .cursor/ or .cursorrules exists)
102
- * 3. Gemini CLI (if gemini CLI found)
103
- * 4. Codex (if codex CLI found)
104
- * 5. Copilot (if .github/copilot/ exists)
105
- * 6. Generic (only if explicitly requested via --adapter generic)
106
- *
107
- * @returns Promise<string> Detected tool name (not adapter - Claude has no adapter!)
108
- */
109
- async detectTool(): Promise<string> {
110
- console.log('🔍 Detecting AI coding tool...\n');
111
-
112
- // Check other tools first (if they have specific indicators)
113
- const detectionOrder = ['cursor', 'gemini', 'codex', 'copilot'];
114
-
115
- for (const adapterName of detectionOrder) {
116
- const adapter = this.adapters.get(adapterName);
117
- if (!adapter) continue;
118
-
119
- const detected = await adapter.detect();
120
- if (detected) {
121
- console.log(`✅ Detected: ${adapter.name} (${adapter.automationLevel} automation)`);
122
- return adapterName;
123
- }
124
- }
125
-
126
- // Default to Claude Code (best experience, native support)
127
- // Users can override with --adapter flag if they want a different tool
128
- console.log(`✅ Detected: claude (native - full automation)`);
129
- return 'claude';
130
- }
131
-
132
- /**
133
- * Helper: Check if a command exists in PATH
134
- * Cross-platform: uses 'where' on Windows, 'which' on Unix
135
- */
136
- private async commandExists(command: string): Promise<boolean> {
137
- try {
138
- const isWindows = process.platform === 'win32';
139
- const checkCommand = isWindows ? 'where' : 'which';
140
- execSync(`${checkCommand} ${command}`, { stdio: 'ignore' });
141
- return true;
142
- } catch (error) {
143
- return false;
144
- }
145
- }
146
-
147
- /**
148
- * Helper: Check if a file exists
149
- */
150
- private async fileExists(filePath: string): Promise<boolean> {
151
- try {
152
- await fs.access(filePath);
153
- return true;
154
- } catch (error) {
155
- return false;
156
- }
157
- }
158
-
159
- /**
160
- * Check requirements for a specific adapter
161
- */
162
- async checkRequirements(adapterName: string): Promise<void> {
163
- const adapter = this.adapters.get(adapterName);
164
- if (!adapter) {
165
- throw new Error(`Adapter not found: ${adapterName}`);
166
- }
167
-
168
- const result = await adapter.checkRequirements();
169
-
170
- if (!result.met) {
171
- console.error('\n❌ Requirements not met:\n');
172
- result.missing.forEach(req => console.error(` - ${req}`));
173
- throw new Error('System requirements not met');
174
- }
175
-
176
- if (result.warnings.length > 0) {
177
- console.warn('\n⚠️ Warnings:\n');
178
- result.warnings.forEach(warning => console.warn(` - ${warning}`));
179
- }
180
- }
181
-
182
- /**
183
- * List all available adapters with details
184
- */
185
- async listAdapters(): Promise<void> {
186
- const registry = await this.loadRegistry();
187
-
188
- console.log('\n📋 SpecWeave Tool Support:\n');
189
- console.log('━'.repeat(70));
190
- console.log('');
191
-
192
- // Show Claude first (baseline, not an adapter)
193
- const claudeInfo = registry.adapters.find(a => a.name === 'claude');
194
- if (claudeInfo) {
195
- console.log(`🚀 CLAUDE CODE (Baseline - No Adapter Needed)`);
196
- console.log(` ${claudeInfo.description}`);
197
- console.log(` Native: skills, agents, hooks, slash commands | Market: ${claudeInfo.market_share}`);
198
- console.log('');
199
- }
200
-
201
- console.log('📦 Adapters (For Other Tools):\n');
202
-
203
- // Show other adapters
204
- for (const adapterInfo of registry.adapters) {
205
- if (adapterInfo.name === 'claude') continue; // Skip Claude, already shown
206
-
207
- const adapter = this.adapters.get(adapterInfo.name);
208
- if (!adapter) continue;
209
-
210
- console.log(`${this.getAutomationIcon(adapter.automationLevel)} ${adapter.name.toUpperCase()}`);
211
- console.log(` ${adapter.description}`);
212
- console.log(` Automation: ${adapter.automationLevel} | Market: ${adapterInfo.market_share}`);
213
- console.log('');
214
- }
215
-
216
- console.log('━'.repeat(70));
217
- console.log('\nTotal Market Coverage: 100%');
218
- console.log('SpecWeave works with ANY AI coding tool!');
219
- console.log('\n💡 Claude Code = Native experience (no adapter)');
220
- console.log(' Other tools = Adapters approximate Claude\'s capabilities\n');
221
- }
222
-
223
- /**
224
- * Get icon for automation level
225
- */
226
- private getAutomationIcon(level: string): string {
227
- switch (level) {
228
- case 'full': return '🚀';
229
- case 'semi': return '⚡';
230
- case 'basic': return '📝';
231
- case 'manual': return '📖';
232
- default: return '❓';
233
- }
234
- }
235
-
236
- /**
237
- * Get recommended adapter based on detection and user preference
238
- */
239
- async getRecommendedAdapter(explicitChoice?: string): Promise<IAdapter> {
240
- // If user explicitly chose an adapter, use it
241
- if (explicitChoice) {
242
- const adapter = this.adapters.get(explicitChoice);
243
- if (!adapter) {
244
- throw new Error(`Invalid adapter: ${explicitChoice}. Use 'claude', 'cursor', 'copilot', or 'generic'`);
245
- }
246
- return adapter;
247
- }
248
-
249
- // Otherwise, auto-detect
250
- const detectedName = await this.detectTool();
251
- const adapter = this.adapters.get(detectedName);
252
-
253
- if (!adapter) {
254
- throw new Error(`Detected adapter not found: ${detectedName}`);
255
- }
256
-
257
- return adapter;
258
- }
259
- }
@@ -1,228 +0,0 @@
1
- /**
2
- * AGENTS.md Generator
3
- *
4
- * Generates a universal AGENTS.md file for ALL AI coding tools EXCEPT Claude Code.
5
- * Follows the agents.md standard: https://agents.md/
6
- *
7
- * IMPORTANT:
8
- * - Claude Code does NOT read this file - it only reads CLAUDE.md
9
- * - This file is for: Cursor, Gemini CLI, Codex, GitHub Copilot, and ANY other AI tool
10
- *
11
- * This ONE file replaces:
12
- * - .cursorrules (Cursor)
13
- * - .github/copilot/instructions.md (Copilot)
14
- * - Any other tool-specific configuration files
15
- */
16
-
17
- import { DocGenerator } from './doc-generator.js';
18
- import * as path from 'path';
19
- import fs from 'fs-extra';
20
- import { getDirname } from '../utils/esm-helpers.js';
21
-
22
- const __dirname = getDirname(import.meta.url);
23
-
24
- /**
25
- * Find the package root by walking up the directory tree looking for package.json
26
- * This works reliably on all platforms including Windows with UNC paths
27
- */
28
- function findPackageRoot(startDir: string): string | null {
29
- let currentDir = startDir;
30
- const root = path.parse(currentDir).root;
31
-
32
- while (currentDir !== root) {
33
- const packageJsonPath = path.join(currentDir, 'package.json');
34
- if (fs.existsSync(packageJsonPath)) {
35
- try {
36
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
37
- // Verify this is the specweave package
38
- if (packageJson.name === 'specweave') {
39
- return currentDir;
40
- }
41
- } catch (error) {
42
- // Not a valid package.json, continue searching
43
- }
44
- }
45
- const parentDir = path.dirname(currentDir);
46
- if (parentDir === currentDir) break; // Reached root
47
- currentDir = parentDir;
48
- }
49
-
50
- return null;
51
- }
52
-
53
- /**
54
- * Find template file using package root detection
55
- */
56
- function findTemplateFile(filename: string): string | null {
57
- const packageRoot = findPackageRoot(__dirname);
58
-
59
- if (packageRoot) {
60
- // Try src/templates/ first (for npm installs)
61
- const srcPath = path.normalize(path.join(packageRoot, 'src', 'templates', filename));
62
- if (fs.existsSync(srcPath)) {
63
- return srcPath;
64
- }
65
-
66
- // Try dist/templates/ (shouldn't exist but try anyway)
67
- const distPath = path.normalize(path.join(packageRoot, 'dist', 'templates', filename));
68
- if (fs.existsSync(distPath)) {
69
- return distPath;
70
- }
71
-
72
- // Try templates/ directly in package root
73
- const rootPath = path.normalize(path.join(packageRoot, 'templates', filename));
74
- if (fs.existsSync(rootPath)) {
75
- return rootPath;
76
- }
77
- }
78
-
79
- return null;
80
- }
81
-
82
- export interface AgentsMdOptions {
83
- projectName: string;
84
- projectPath: string;
85
- templatePath?: string;
86
- }
87
-
88
- /**
89
- * Generate universal AGENTS.md file
90
- */
91
- export class AgentsMdGenerator {
92
- private docGen: DocGenerator;
93
-
94
- constructor(
95
- skillsDir?: string,
96
- agentsDir?: string,
97
- commandsDir?: string
98
- ) {
99
- this.docGen = new DocGenerator(skillsDir, agentsDir, commandsDir);
100
- }
101
-
102
- /**
103
- * Generate complete AGENTS.md content
104
- */
105
- async generate(options: AgentsMdOptions): Promise<string> {
106
- // Read template - use provided path or find it via package root
107
- let templatePath = options.templatePath;
108
-
109
- if (!templatePath || !await fs.pathExists(templatePath)) {
110
- // Fallback: try to find template using package root detection
111
- const foundPath = findTemplateFile('AGENTS.md.template');
112
- if (foundPath) {
113
- templatePath = foundPath;
114
- } else {
115
- const errorMsg = options.templatePath
116
- ? `AGENTS.md template not found at: ${options.templatePath}\nAlso tried package root detection but failed.`
117
- : `AGENTS.md template not found. Tried:\n - Package root detection\n - __dirname: ${__dirname}\n - Default: ${path.join(__dirname, '../templates/AGENTS.md.template')}`;
118
- throw new Error(errorMsg);
119
- }
120
- }
121
-
122
- let content = await fs.readFile(templatePath, 'utf-8');
123
-
124
- // Extract agents and skills
125
- const skills = await this.docGen.extractSkills();
126
- const agents = await this.docGen.extractAgents();
127
-
128
- // Replace placeholders
129
- content = content.replace(/\{PROJECT_NAME\}/g, options.projectName);
130
- content = content.replace('{AGENTS_SECTION}', this.generateAgentsSection(agents));
131
- content = content.replace('{SKILLS_SECTION}', this.generateSkillsSection(skills));
132
- content = content.replace('{TIMESTAMP}', new Date().toISOString().split('T')[0]);
133
-
134
- return content;
135
- }
136
-
137
- /**
138
- * Generate agents section as simple Markdown
139
- */
140
- private generateAgentsSection(agents: any[]): string {
141
- let section = '';
142
-
143
- for (const agent of agents) {
144
- section += `### ${agent.role}\n`;
145
- section += `**Purpose**: ${agent.description}\n`;
146
- section += `**When to use**: ${this.getAgentActivation(agent.name)}\n`;
147
- section += `**Location**: \`.claude/agents/${agent.name}/AGENT.md\`\n\n`;
148
- }
149
-
150
- return section;
151
- }
152
-
153
- /**
154
- * Get agent activation guidance
155
- */
156
- private getAgentActivation(agentName: string): string {
157
- const activations: Record<string, string> = {
158
- 'pm': 'Creating requirements, user stories, product specs (WHAT/WHY)',
159
- 'architect': 'System design, architecture decisions, technical plans (HOW)',
160
- 'devops': 'Infrastructure, deployment, CI/CD pipelines',
161
- 'qa-lead': 'Test strategy, test cases, quality assurance',
162
- 'security': 'Threat modeling, security review, vulnerability assessment',
163
- 'tech-lead': 'Code review, best practices, refactoring',
164
- 'frontend': 'UI components, React/Vue/Angular implementation',
165
- 'nodejs-backend': 'Node.js/Express/NestJS backend APIs',
166
- 'python-backend': 'FastAPI/Django backend APIs',
167
- 'nextjs': 'Next.js App Router applications',
168
- 'dotnet-backend': 'ASP.NET Core backend APIs',
169
- 'sre': 'Incident response, troubleshooting, runbooks',
170
- 'docs-writer': 'Technical documentation, API docs, guides',
171
- 'performance': 'Performance optimization, profiling, benchmarking'
172
- };
173
-
174
- return activations[agentName] || 'Specialized tasks requiring this expertise';
175
- }
176
-
177
- /**
178
- * Generate skills section as simple Markdown
179
- */
180
- private generateSkillsSection(skills: any[]): string {
181
- let section = '';
182
-
183
- for (const skill of skills) {
184
- section += `### ${skill.name}\n`;
185
- section += `**Purpose**: ${skill.description}\n`;
186
- section += `**When to use**: ${this.getSkillActivation(skill.name)}\n`;
187
- section += `**Location**: \`.claude/skills/${skill.name}/SKILL.md\`\n\n`;
188
- }
189
-
190
- return section;
191
- }
192
-
193
- /**
194
- * Get skill activation guidance
195
- */
196
- private getSkillActivation(skillName: string): string {
197
- const activations: Record<string, string> = {
198
- 'specweave-detector': 'User asks about SpecWeave commands or workflows',
199
- 'increment-planner': 'Creating new feature increments (/inc command)',
200
- 'context-loader': 'Working on increments, need to load relevant context',
201
- 'skill-router': 'Ambiguous requests that need routing to specific skills',
202
- 'spec-driven-debugging': 'Bug investigation, test failures, unexpected behavior',
203
- 'spec-driven-brainstorming': 'Brainstorming ideas, refining concepts, design thinking',
204
- 'brownfield-analyzer': 'Analyzing existing projects for SpecWeave migration',
205
- 'brownfield-onboarder': 'Onboarding existing projects to SpecWeave',
206
- 'nodejs-backend': 'Node.js/Express/NestJS backend development',
207
- 'python-backend': 'Python/FastAPI/Django backend development',
208
- 'nextjs': 'Next.js App Router application development',
209
- 'frontend': 'React/Vue/Angular frontend development',
210
- 'dotnet-backend': 'ASP.NET Core backend development',
211
- 'e2e-playwright': 'End-to-end testing with Playwright',
212
- 'jira-sync': 'JIRA integration and synchronization',
213
- 'github-sync': 'GitHub issues/milestones synchronization',
214
- 'ado-sync': 'Azure DevOps synchronization',
215
- 'hetzner-provisioner': 'Hetzner Cloud infrastructure provisioning',
216
- 'cost-optimizer': 'Cloud cost optimization and platform comparison',
217
- 'figma-mcp-connector': 'Figma design integration via MCP',
218
- 'design-system-architect': 'Design system and Atomic Design methodology',
219
- 'figma-designer': 'Figma design creation and design tokens',
220
- 'figma-implementer': 'Converting Figma designs to code',
221
- 'figma-to-code': 'Figma to React/Angular code generation',
222
- 'role-orchestrator': 'Multi-agent orchestration for complex tasks',
223
- 'increment-quality-judge': 'AI-powered quality assessment of specs and plans'
224
- };
225
-
226
- return activations[skillName] || 'Specialized tasks';
227
- }
228
- }