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,444 +0,0 @@
1
- /**
2
- * GitHub Copilot Adapter
3
- *
4
- * Basic automation adapter for GitHub Copilot.
5
- * Compiles SpecWeave plugins to AGENTS.md (universal standard) for context and suggestions.
6
- *
7
- * This adapter compiles skills, agents, and commands into AGENTS.md format.
8
- */
9
-
10
- import * as path from 'path';
11
- import fs from 'fs-extra';
12
- import { AdapterBase } from '../adapter-base.js';
13
- import { AdapterOptions, AdapterFile } from '../adapter-interface.js';
14
- import type { Plugin } from '../../core/types/plugin.js';
15
- import { compileToAgentsMd, getSpecweaveInstallPath } from '../../utils/agents-md-compiler.js';
16
- import { LanguageManager, getSystemPromptForLanguage } from '../../core/i18n/language-manager.js';
17
- import type { SupportedLanguage } from '../../core/i18n/types.js';
18
-
19
- export class CopilotAdapter extends AdapterBase {
20
- name = 'copilot';
21
- description = 'GitHub Copilot adapter - Basic automation with AGENTS.md';
22
- automationLevel = 'basic' as const;
23
-
24
- /**
25
- * Detect if GitHub Copilot is available
26
- *
27
- * Note: Detection is best-effort since Copilot might be installed
28
- * but we can't detect it reliably. This adapter is safe to use
29
- * as a fallback since Copilot reads AGENTS.md (universal standard).
30
- */
31
- async detect(): Promise<boolean> {
32
- // Always return false to make this a manual selection
33
- // Users can explicitly choose Copilot adapter if they want
34
- return false;
35
- }
36
-
37
- /**
38
- * Get files to install for Copilot adapter
39
- *
40
- * Note: Copilot automatically reads AGENTS.md (universal standard).
41
- * No additional files needed.
42
- */
43
- getFiles(): AdapterFile[] {
44
- return [];
45
- }
46
-
47
- /**
48
- * Install Copilot adapter
49
- */
50
- async install(options: AdapterOptions): Promise<void> {
51
- console.log('\n📦 Configuring GitHub Copilot (Basic Automation)\n');
52
-
53
- // 1. Create .specweave/ structure
54
- const specweaveDir = path.join(options.projectPath, '.specweave');
55
- await fs.ensureDir(specweaveDir);
56
- await fs.ensureDir(path.join(specweaveDir, 'increments'));
57
- await fs.ensureDir(path.join(specweaveDir, 'increments', '_backlog'));
58
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'strategy'));
59
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'architecture', 'adr'));
60
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'architecture', 'rfc'));
61
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'architecture', 'diagrams'));
62
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'internal', 'delivery'));
63
- await fs.ensureDir(path.join(specweaveDir, 'docs', 'public', 'guides'));
64
- await fs.ensureDir(path.join(specweaveDir, 'logs'));
65
-
66
- console.log('✅ Created .specweave/ structure');
67
-
68
- // 2. Find SpecWeave installation
69
- let specweavePath: string;
70
- try {
71
- specweavePath = getSpecweaveInstallPath();
72
- console.log(`✅ Found SpecWeave installation at: ${specweavePath}`);
73
- } catch (error) {
74
- console.error('❌ Could not find SpecWeave installation');
75
- console.error(' Make sure SpecWeave is installed: npm install -g specweave');
76
- return;
77
- }
78
-
79
- // 3. Compile plugins to AGENTS.md
80
- console.log('📝 Compiling plugins to AGENTS.md...');
81
- const result = await compileToAgentsMd(specweavePath);
82
-
83
- // 4. Write AGENTS.md
84
- const agentsMdPath = path.join(options.projectPath, 'AGENTS.md');
85
- await fs.writeFile(agentsMdPath, result.agentsMd, 'utf-8');
86
-
87
- console.log('✅ Created AGENTS.md with:');
88
- console.log(` - ${result.skills.length} skills`);
89
- console.log(` - ${result.agents.length} agents`);
90
- console.log(` - ${result.commands.length} commands`);
91
-
92
- // 5. Create .github/copilot/instructions.md (optional)
93
- const copilotDir = path.join(options.projectPath, '.github', 'copilot');
94
- await fs.ensureDir(copilotDir);
95
-
96
- const instructionsContent = `# GitHub Copilot Instructions
97
-
98
- This project uses SpecWeave for spec-driven development.
99
-
100
- ## Important Context
101
-
102
- - **AGENTS.md**: Complete workflow guide (read this first!)
103
- - **Structure**: All work happens in \`.specweave/increments/\`
104
- - **Workflow**: spec.md → plan.md → tasks.md → tests.md
105
-
106
- ## When Suggesting Code
107
-
108
- - Follow patterns in AGENTS.md
109
- - Create files in increment folders, not project root
110
- - Reference existing specs and plans
111
- - Follow naming conventions (kebab-case for increments)
112
-
113
- See AGENTS.md for complete details.
114
- `;
115
-
116
- await fs.writeFile(path.join(copilotDir, 'instructions.md'), instructionsContent, 'utf-8');
117
- console.log('✅ Created .github/copilot/instructions.md');
118
-
119
- console.log('\n✅ Copilot will automatically read AGENTS.md');
120
- }
121
-
122
- /**
123
- * Post-installation instructions
124
- */
125
- async postInstall(options: AdapterOptions): Promise<void> {
126
- console.log(this.getInstructions());
127
- }
128
-
129
- /**
130
- * Get usage instructions for Copilot adapter
131
- */
132
- getInstructions(): string {
133
- return `
134
- ================================================================
135
- GitHub Copilot Adapter - Basic Automation
136
- ================================================================
137
-
138
- Your project is now configured for GitHub Copilot!
139
-
140
- WHAT THIS PROVIDES:
141
-
142
- - AGENTS.md (Universal Standard)
143
- - Copilot automatically reads this file
144
- - Contains all workflow instructions
145
- - Project structure and templates
146
- - Following agents.md standard (https://agents.md/)
147
-
148
- - Better Code Suggestions
149
- - Copilot reads AGENTS.md for context
150
- - Suggests code following SpecWeave patterns
151
- - Understands project structure
152
-
153
- UNDERSTANDING THE DIFFERENCE:
154
-
155
- Claude Code (Full Automation):
156
- - Native skills (auto-activate)
157
- - Native agents (separate context windows)
158
- - Native hooks (auto-update docs)
159
- - Slash commands (/inc, /do, /done)
160
-
161
- Cursor (Semi-Automation):
162
- - Reads AGENTS.md for workflow
163
- - @ context shortcuts
164
- - Composer multi-file editing
165
-
166
- Copilot (Basic Automation - This Adapter):
167
- - Reads AGENTS.md automatically
168
- - Better code suggestions
169
- - No skills, agents, hooks, or commands
170
- - Manual workflow with AI assistance
171
-
172
- HOW COPILOT USES AGENTS.MD:
173
-
174
- GitHub Copilot automatically reads AGENTS.md to understand:
175
- - SpecWeave structure (.specweave/ folders)
176
- - File naming conventions (spec.md, plan.md, tasks.md)
177
- - Context manifests (what files to reference)
178
- - Best practices (technology-agnostic specs, etc.)
179
-
180
- Result: Copilot suggests code that fits SpecWeave patterns!
181
-
182
- HOW TO USE SPECWEAVE WITH COPILOT:
183
-
184
- 1. Copilot reads AGENTS.md automatically
185
- - No action needed - just open project in VS Code
186
- - Copilot will suggest code following SpecWeave patterns
187
-
188
- 2. Create increments manually:
189
- mkdir -p .specweave/increments/0001-user-auth
190
-
191
- 3. Reference context manifests:
192
- Open context-manifest.yaml
193
- → Copilot sees which files are relevant
194
- → Provides better suggestions
195
-
196
- 4. Ask Copilot Chat for guidance:
197
- "How do I create a spec.md following SpecWeave?"
198
- "Generate plan.md for user authentication"
199
- "What should go in context-manifest.yaml?"
200
-
201
- 5. Use Copilot inline suggestions:
202
- Start typing in spec.md → Copilot suggests content
203
- Following SpecWeave patterns from AGENTS.md
204
-
205
- WORKFLOW EXAMPLE:
206
-
207
- Creating a Feature:
208
-
209
- 1. Create increment folder:
210
- mkdir -p .specweave/increments/0002-payments
211
- cd .specweave/increments/0002-payments
212
-
213
- 2. Create spec.md:
214
- - Open file, start typing frontmatter
215
- - Copilot suggests SpecWeave structure (from AGENTS.md)
216
- - Fill in user stories, acceptance criteria
217
-
218
- 3. Create plan.md:
219
- - Reference spec.md (Copilot reads it)
220
- - Start typing "# Technical Plan"
221
- - Copilot suggests architecture sections
222
-
223
- 4. Create context-manifest.yaml:
224
- - Copilot suggests relevant files to include
225
- - Lists spec sections and architecture docs
226
-
227
- LIMITATIONS (vs Claude Code & Cursor):
228
-
229
- - No auto-activation or workflows
230
- - No skills, agents, hooks
231
- - No slash commands or @ shortcuts
232
- - No role-based assistance (PM, Architect, etc.)
233
- - Completely manual workflow
234
-
235
- But Copilot still provides helpful suggestions!
236
- - Understands SpecWeave structure from AGENTS.md
237
- - Suggests code following project patterns
238
-
239
- DOCUMENTATION:
240
-
241
- - AGENTS.md: Universal workflow instructions (Copilot reads this!)
242
- - .specweave/docs/: Project documentation
243
-
244
- You're ready to build with SpecWeave on GitHub Copilot!
245
-
246
- Note: For better automation, consider Claude Code (full) or Cursor (semi).
247
- Copilot is best for simple projects or when already using VS Code + Copilot.
248
- `;
249
- }
250
-
251
- /**
252
- * Check if Copilot adapter supports plugins
253
- *
254
- * Copilot has plugin support via AGENTS.md compilation (same as Cursor)
255
- *
256
- * @returns boolean True for Copilot
257
- */
258
- supportsPlugins(): boolean {
259
- return true;
260
- }
261
-
262
- /**
263
- * Read language configuration from project config
264
- *
265
- * @returns Language setting from config, defaults to 'en'
266
- */
267
- private async getLanguageConfig(): Promise<SupportedLanguage> {
268
- const projectPath = process.cwd();
269
- const configPath = path.join(projectPath, '.specweave', 'config.json');
270
-
271
- if (!(await fs.pathExists(configPath))) {
272
- return 'en'; // Default to English if no config
273
- }
274
-
275
- try {
276
- const config = await fs.readJson(configPath);
277
- return (config.language as SupportedLanguage) || 'en';
278
- } catch (error) {
279
- console.warn('⚠️ Could not read language from config, defaulting to English');
280
- return 'en';
281
- }
282
- }
283
-
284
- /**
285
- * Inject system prompt for non-English languages
286
- *
287
- * Prepends language instruction to markdown content if language !== 'en'
288
- *
289
- * @param content Original markdown content
290
- * @param language Target language
291
- * @returns Modified content with system prompt (or unchanged if English)
292
- */
293
- private injectSystemPrompt(content: string, language: SupportedLanguage): string {
294
- if (language === 'en') {
295
- return content; // No changes for English - preserve default behavior
296
- }
297
-
298
- // Get system prompt for target language
299
- const systemPrompt = getSystemPromptForLanguage(language);
300
-
301
- // For AGENTS.md compilation, inject at the beginning of the content
302
- return `${systemPrompt}\n\n${content}`;
303
- }
304
-
305
- /**
306
- * Compile and install a plugin for Copilot
307
- *
308
- * Copilot uses AGENTS.md compilation (same as Cursor)
309
- *
310
- * NEW: Injects system prompts for non-English languages
311
- *
312
- * @param plugin Plugin to install
313
- */
314
- async compilePlugin(plugin: Plugin): Promise<void> {
315
- const projectPath = process.cwd();
316
- const agentsMdPath = path.join(projectPath, 'AGENTS.md');
317
-
318
- console.log(`\n📦 Compiling plugin for Copilot: ${plugin.manifest.name}`);
319
-
320
- // Get language configuration for system prompt injection
321
- const language = await this.getLanguageConfig();
322
- if (language !== 'en') {
323
- console.log(` 🌐 Language: ${language} (system prompts will be injected)`);
324
- }
325
-
326
- if (!(await fs.pathExists(agentsMdPath))) {
327
- throw new Error('AGENTS.md not found. Run specweave init first.');
328
- }
329
-
330
- let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
331
-
332
- const pluginMarker = `<!-- Plugin: ${plugin.manifest.name} -->`;
333
- if (agentsMd.includes(pluginMarker)) {
334
- console.log(` ℹ️ Plugin ${plugin.manifest.name} already compiled to AGENTS.md`);
335
- return;
336
- }
337
-
338
- let pluginSection = `\n\n${pluginMarker}\n\n`;
339
- pluginSection += `# Plugin: ${plugin.manifest.name}\n\n`;
340
- pluginSection += `${plugin.manifest.description}\n\n`;
341
-
342
- if (plugin.skills.length > 0) {
343
- pluginSection += `## Skills\n\n`;
344
- for (const skill of plugin.skills) {
345
- const skillContent = await fs.readFile(path.join(skill.path, 'SKILL.md'), 'utf-8');
346
- const contentWithoutFrontmatter = skillContent.replace(/^---\n[\s\S]+?\n---\n/, '');
347
- // Inject system prompt if needed
348
- const modifiedContent = this.injectSystemPrompt(contentWithoutFrontmatter, language);
349
- pluginSection += `### ${skill.name}\n\n${modifiedContent}\n\n`;
350
- }
351
- }
352
-
353
- if (plugin.agents.length > 0) {
354
- pluginSection += `## Agents\n\n`;
355
- for (const agent of plugin.agents) {
356
- const agentContent = await fs.readFile(path.join(agent.path, 'AGENT.md'), 'utf-8');
357
- // Inject system prompt if needed
358
- const modifiedContent = this.injectSystemPrompt(agentContent, language);
359
- pluginSection += `### ${agent.name}\n\n${modifiedContent}\n\n`;
360
- }
361
- }
362
-
363
- if (plugin.commands.length > 0) {
364
- pluginSection += `## Commands\n\n`;
365
- for (const command of plugin.commands) {
366
- const commandContent = await fs.readFile(command.path, 'utf-8');
367
- const contentWithoutFrontmatter = commandContent.replace(/^---\n[\s\S]+?\n---\n/, '');
368
- // Inject system prompt if needed
369
- const modifiedContent = this.injectSystemPrompt(contentWithoutFrontmatter, language);
370
- pluginSection += `### /${command.name}\n\n${modifiedContent}\n\n`;
371
- }
372
- }
373
-
374
- pluginSection += `<!-- End Plugin: ${plugin.manifest.name} -->\n`;
375
-
376
- agentsMd += pluginSection;
377
- await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
378
-
379
- console.log(` ✓ Compiled to AGENTS.md`);
380
- console.log(` ✓ ${plugin.skills.length} skills, ${plugin.agents.length} agents, ${plugin.commands.length} commands`);
381
- console.log(`\n✅ Plugin ${plugin.manifest.name} compiled for Copilot!`);
382
- }
383
-
384
- /**
385
- * Unload a plugin from Copilot
386
- */
387
- async unloadPlugin(pluginName: string): Promise<void> {
388
- const projectPath = process.cwd();
389
- const agentsMdPath = path.join(projectPath, 'AGENTS.md');
390
-
391
- console.log(`\n🗑️ Unloading plugin from Copilot: ${pluginName}`);
392
-
393
- if (!(await fs.pathExists(agentsMdPath))) {
394
- console.warn(`⚠️ AGENTS.md not found`);
395
- return;
396
- }
397
-
398
- let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
399
-
400
- const startMarker = `<!-- Plugin: ${pluginName} -->`;
401
- const endMarker = `<!-- End Plugin: ${pluginName} -->`;
402
-
403
- const startIndex = agentsMd.indexOf(startMarker);
404
- if (startIndex === -1) {
405
- console.warn(`⚠️ Plugin ${pluginName} not found in AGENTS.md`);
406
- return;
407
- }
408
-
409
- const endIndex = agentsMd.indexOf(endMarker, startIndex);
410
- if (endIndex === -1) {
411
- console.warn(`⚠️ Plugin ${pluginName} section malformed`);
412
- return;
413
- }
414
-
415
- agentsMd = agentsMd.slice(0, startIndex) + agentsMd.slice(endIndex + endMarker.length);
416
- await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
417
-
418
- console.log(` ✓ Removed from AGENTS.md`);
419
- console.log(`\n✅ Plugin ${pluginName} unloaded!`);
420
- }
421
-
422
- /**
423
- * Get list of installed plugins for Copilot
424
- */
425
- async getInstalledPlugins(): Promise<string[]> {
426
- const projectPath = process.cwd();
427
- const agentsMdPath = path.join(projectPath, 'AGENTS.md');
428
-
429
- if (!(await fs.pathExists(agentsMdPath))) {
430
- return [];
431
- }
432
-
433
- const agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
434
- const pluginMarkerRegex = /<!-- Plugin: (specweave-[a-z0-9-]+) -->/g;
435
- const matches = agentsMd.matchAll(pluginMarkerRegex);
436
-
437
- const plugins: string[] = [];
438
- for (const match of matches) {
439
- plugins.push(match[1]);
440
- }
441
-
442
- return plugins;
443
- }
444
- }
@@ -1,62 +0,0 @@
1
- # @docs - Architecture Documentation Context
2
-
3
- This file is loaded when you type `@docs` in Cursor.
4
-
5
- ## What This Provides
6
-
7
- Quick access to architecture documentation:
8
- - System design (HLD)
9
- - ADRs (Architecture Decision Records)
10
- - Component diagrams (C4 Model)
11
- - Data models (ER diagrams)
12
-
13
- ## Usage
14
-
15
- ```
16
- @docs show me the system architecture
17
- @docs what ADRs exist for authentication?
18
- @docs explain the data model
19
- ```
20
-
21
- ## Files Loaded
22
-
23
- When `@docs` is used, Cursor should load:
24
-
25
- ```
26
- .specweave/docs/internal/architecture/
27
- ├── system-design.md # HLD
28
- ├── adr/ # Architecture Decision Records
29
- │ ├── 0001-tech-stack.md
30
- │ ├── 0002-database-choice.md
31
- │ └── ...
32
- ├── diagrams/ # C4 diagrams
33
- │ ├── system-context.mmd # C4 Level 1
34
- │ ├── system-container.mmd # C4 Level 2
35
- │ └── {module}/ # C4 Level 3 (component)
36
- └── data-models/ # ER diagrams
37
- └── schema.sql
38
- ```
39
-
40
- ## Context Precision
41
-
42
- **Don't load everything!**
43
-
44
- If working on specific module (e.g., authentication):
45
- 1. Check context-manifest.yaml
46
- 2. Load ONLY auth-related docs:
47
- ```
48
- .specweave/docs/internal/architecture/auth/
49
- ├── design.md
50
- ├── adr/0005-auth-method.md
51
- └── diagrams/auth-flow.mmd
52
- ```
53
-
54
- ## Example Workflow
55
-
56
- User: `@docs show authentication architecture`
57
-
58
- You:
59
- 1. Load .specweave/docs/internal/architecture/auth/
60
- 2. Load ADRs related to auth (ADR-0005, ADR-0012)
61
- 3. Load auth diagrams
62
- 4. Summarize: "Authentication uses OAuth2 (ADR-0005), JWT tokens stored in httpOnly cookies (ADR-0012). See auth-flow.mmd for sequence diagram."
@@ -1,71 +0,0 @@
1
- # @increments - Current Increment Context
2
-
3
- This file is loaded when you type `@increments` in Cursor.
4
-
5
- ## What This Provides
6
-
7
- Quick access to the current increment's:
8
- - spec.md (WHAT and WHY)
9
- - plan.md (HOW)
10
- - tasks.md (implementation steps)
11
- - context-manifest.yaml (what context to load)
12
-
13
- ## Usage
14
-
15
- ```
16
- @increments show me what we're working on
17
- @increments what's the current task?
18
- @increments load the spec for this feature
19
- ```
20
-
21
- ## Files Loaded
22
-
23
- When `@increments` is used, Cursor should load:
24
-
25
- 1. **Current increment folder** (most recent in-progress):
26
- ```
27
- .specweave/increments/####-feature-name/
28
- ├── spec.md
29
- ├── plan.md
30
- ├── tasks.md
31
- └── context-manifest.yaml
32
- ```
33
-
34
- 2. **How to find current increment**:
35
- ```bash
36
- # List all increments
37
- ls -la .specweave/increments/
38
-
39
- # Find in-progress increments
40
- grep -r "status: in-progress" .specweave/increments/*/spec.md
41
- ```
42
-
43
- 3. **Load order**:
44
- - context-manifest.yaml (to know what else to load)
45
- - spec.md (business requirements)
46
- - plan.md (technical design)
47
- - tasks.md (current task status)
48
-
49
- ## Context Manifest Critical
50
-
51
- **ALWAYS read context-manifest.yaml first!**
52
-
53
- It tells you which additional files to load:
54
- ```yaml
55
- spec_sections:
56
- - .specweave/docs/internal/strategy/auth/spec.md
57
- documentation:
58
- - .specweave/docs/internal/architecture/auth-design.md
59
- ```
60
-
61
- Then load ONLY those files (70%+ token savings).
62
-
63
- ## Example Workflow
64
-
65
- User: `@increments what's the current feature?`
66
-
67
- You:
68
- 1. Find most recent in-progress increment
69
- 2. Read spec.md → See it's user authentication
70
- 3. Read tasks.md → See we're on T003 (OAuth2 implementation)
71
- 4. Respond: "Working on user authentication (increment 0002). Currently on task T003: Implement OAuth2 flow."
@@ -1,73 +0,0 @@
1
- # @strategy - Business Strategy Context
2
-
3
- This file is loaded when you type `@strategy` in Cursor.
4
-
5
- ## What This Provides
6
-
7
- Quick access to business strategy documentation:
8
- - Product vision and goals
9
- - Business requirements (technology-agnostic)
10
- - User stories and acceptance criteria
11
- - PRDs (Product Requirements Documents)
12
-
13
- ## Usage
14
-
15
- ```
16
- @strategy what's the product vision?
17
- @strategy show me authentication requirements
18
- @strategy what are the success criteria?
19
- ```
20
-
21
- ## Files Loaded
22
-
23
- When `@strategy` is used, Cursor should load:
24
-
25
- ```
26
- .specweave/docs/internal/strategy/
27
- ├── {module}/ # Module-specific strategy
28
- │ ├── overview.md # Product vision
29
- │ ├── requirements.md # FR/NFR (tech-agnostic)
30
- │ ├── user-stories.md # All user stories
31
- │ └── success-criteria.md # KPIs, metrics
32
- ```
33
-
34
- ## Context Precision
35
-
36
- **Don't load everything!**
37
-
38
- If working on authentication module:
39
- 1. Load ONLY auth strategy:
40
- ```
41
- .specweave/docs/internal/strategy/auth/
42
- ├── overview.md
43
- ├── requirements.md
44
- ├── user-stories.md
45
- └── success-criteria.md
46
- ```
47
-
48
- ## Technology-Agnostic Requirements
49
-
50
- **Critical**: Strategy docs are technology-agnostic (WHAT/WHY, not HOW).
51
-
52
- **Good (technology-agnostic)**:
53
- ```markdown
54
- ## FR-001: User Authentication
55
- Users must be able to securely authenticate with their email and password.
56
- ```
57
-
58
- **Bad (too technical)**:
59
- ```markdown
60
- ## FR-001: User Authentication
61
- Users authenticate via JWT tokens stored in httpOnly cookies with bcrypt password hashing.
62
- ```
63
-
64
- The technical details go in architecture docs (@docs), not strategy.
65
-
66
- ## Example Workflow
67
-
68
- User: `@strategy what are the authentication requirements?`
69
-
70
- You:
71
- 1. Load .specweave/docs/internal/strategy/auth/requirements.md
72
- 2. Read functional and non-functional requirements
73
- 3. Summarize: "FR-001: Email/password auth. FR-002: Social login (Google, GitHub). NFR-001: < 2s login response time. NFR-002: 99.9% uptime."