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,451 +0,0 @@
1
- /**
2
- * Cursor Adapter
3
- *
4
- * Semi-automation adapter for Cursor editor.
5
- * Provides @ context shortcuts for quick context injection.
6
- *
7
- * Cursor automatically reads AGENTS.md (universal standard) for workflow instructions.
8
- * This adapter only installs Cursor-specific features (@ shortcuts).
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 } from '../../core/i18n/types.js';
18
-
19
- export class CursorAdapter extends AdapterBase {
20
- name = 'cursor';
21
- description = 'Cursor adapter - Semi-automation with AGENTS.md and @ context shortcuts';
22
- automationLevel = 'semi' as const;
23
-
24
- /**
25
- * Detect if Cursor is available
26
- *
27
- * Checks for:
28
- * - cursor command in PATH
29
- * - .cursor/ directory exists
30
- */
31
- async detect(): Promise<boolean> {
32
- const hasCursorCLI = await this.commandExists('cursor');
33
- const hasCursorDir = await this.fileExists('.cursor');
34
-
35
- return hasCursorCLI || hasCursorDir;
36
- }
37
-
38
- /**
39
- * Get files to install for Cursor adapter
40
- *
41
- * Note: Cursor automatically reads AGENTS.md (universal standard).
42
- * This adapter only installs Cursor-specific @ context shortcuts.
43
- */
44
- getFiles(): AdapterFile[] {
45
- return [
46
- {
47
- sourcePath: '.cursor/context/increments-context.md',
48
- targetPath: '.cursor/context/increments-context.md',
49
- description: '@increments context shortcut'
50
- },
51
- {
52
- sourcePath: '.cursor/context/docs-context.md',
53
- targetPath: '.cursor/context/docs-context.md',
54
- description: '@docs context shortcut'
55
- },
56
- {
57
- sourcePath: '.cursor/context/strategy-context.md',
58
- targetPath: '.cursor/context/strategy-context.md',
59
- description: '@strategy context shortcut'
60
- },
61
- {
62
- sourcePath: '.cursor/context/tests-context.md',
63
- targetPath: '.cursor/context/tests-context.md',
64
- description: '@tests context shortcut'
65
- },
66
- {
67
- sourcePath: 'README.md',
68
- targetPath: '.cursor/README.md',
69
- description: 'Cursor adapter documentation'
70
- }
71
- ];
72
- }
73
-
74
- /**
75
- * Install Cursor adapter
76
- */
77
- async install(options: AdapterOptions): Promise<void> {
78
- console.log('\nšŸ“¦ Installing Cursor Adapter (Semi-Automation)\n');
79
-
80
- // Ensure .cursor directory exists
81
- const cursorDir = path.join(options.projectPath, '.cursor');
82
- await fs.ensureDir(cursorDir);
83
- await fs.ensureDir(path.join(cursorDir, 'context'));
84
-
85
- // Copy files
86
- await super.install(options);
87
-
88
- console.log('\n✨ Cursor adapter installed!');
89
- console.log('\nšŸ“‹ Files created:');
90
- console.log(' - .cursor/context/ (@ shortcuts for quick context injection)');
91
- }
92
-
93
- /**
94
- * Post-installation instructions
95
- */
96
- async postInstall(options: AdapterOptions): Promise<void> {
97
- console.log(this.getInstructions());
98
- }
99
-
100
- /**
101
- * Get usage instructions for Cursor adapter
102
- */
103
- getInstructions(): string {
104
- return `
105
- ================================================================
106
- Cursor Adapter - Semi-Automation
107
- ================================================================
108
-
109
- Your project is now configured for Cursor with SEMI-automation!
110
-
111
- WHAT THIS PROVIDES:
112
-
113
- - AGENTS.md (Universal Standard)
114
- - Cursor automatically reads this file
115
- - Contains all workflow instructions
116
- - Defines agent roles (PM, Architect, etc.)
117
- - Defines skill capabilities (increment-planner, context-loader, etc.)
118
- - Project structure and templates
119
- - Following agents.md standard (https://agents.md/)
120
-
121
- - @ Context Shortcuts (Quick Access)
122
- - @increments - Load current increment files
123
- - @docs - Load architecture documentation
124
- - @strategy - Load business specifications
125
- - @tests - Load test strategy and cases
126
-
127
- - Composer Multi-File Editing
128
- - Create multiple files simultaneously
129
- - Edit across spec.md, plan.md, tasks.md
130
-
131
- UNDERSTANDING THE DIFFERENCE:
132
-
133
- Claude Code (Full Automation):
134
- - Native skills (auto-activate)
135
- - Native agents (separate context windows)
136
- - Native hooks (auto-update docs)
137
- - Slash commands (/inc, /do, /done)
138
-
139
- Cursor (Semi-Automation - This Adapter):
140
- - Reads AGENTS.md for workflow instructions
141
- - Manual role adoption (say "act as PM")
142
- - No hooks (manual doc updates)
143
- - Manual workflows (follow AGENTS.md steps)
144
-
145
- HOW CURSOR USES AGENTS.MD:
146
-
147
- Cursor automatically reads AGENTS.md to understand:
148
- 1. Project structure (.specweave/ folders)
149
- 2. How to create increments (spec.md, plan.md, tasks.md)
150
- 3. Agent roles (PM defines WHAT/WHY, Architect designs HOW)
151
- 4. Skill workflows (increment-planner, context-loader, etc.)
152
- 5. Context manifests (70%+ token savings)
153
- 6. Templates and examples
154
-
155
- When you say "create increment for auth":
156
- → Cursor reads AGENTS.md
157
- → Follows the workflow described there
158
- → Creates spec.md (adopting PM role)
159
- → Creates plan.md (adopting Architect role)
160
- → Creates tasks.md
161
-
162
- QUICK START:
163
-
164
- 1. Open project in Cursor
165
-
166
- 2. Create your first feature:
167
- "Create increment for user authentication"
168
-
169
- Cursor will:
170
- - Read AGENTS.md for workflow
171
- - Ask clarifying questions
172
- - Create spec.md (acting as PM from AGENTS.md)
173
- - Create plan.md (acting as Architect from AGENTS.md)
174
- - Create tasks.md
175
-
176
- 3. Use @ shortcuts for context:
177
- "@increments show me the current increment"
178
- "@docs show me the architecture"
179
- "@strategy show me the business requirements"
180
-
181
- 4. Use Composer for multi-file edits:
182
- Cmd+I → "Update spec.md and plan.md to add OAuth2"
183
-
184
- CONTEXT LOADING (70%+ Token Savings):
185
-
186
- CRITICAL: Always read context-manifest.yaml first!
187
-
188
- AGENTS.md teaches Cursor:
189
- 1. Look for .specweave/increments/####/context-manifest.yaml
190
- 2. ONLY load files listed in manifest
191
- 3. Don't load all specs (wastes tokens)
192
-
193
- Example manifest (YAML):
194
-
195
- spec_sections:
196
- - .specweave/docs/internal/strategy/auth/spec.md
197
- documentation:
198
- - .specweave/docs/internal/architecture/auth-design.md
199
-
200
- Cursor: "Only load these 2 files, not entire docs/ folder"
201
-
202
- LIMITATIONS (vs Claude Code):
203
-
204
- - No auto-activation (must explicitly request workflows)
205
- - No separate context windows (all context shared)
206
- - No hooks (can't auto-update docs on events)
207
- - Requires manual role adoption (say "act as PM")
208
-
209
- But still VERY good experience with Composer + @ shortcuts!
210
-
211
- DOCUMENTATION:
212
-
213
- - AGENTS.md: Universal workflow instructions (Cursor reads this!)
214
- - .cursor/README.md: Cursor-specific documentation
215
- - .specweave/docs/: Project documentation
216
-
217
- You're ready to build with SpecWeave on Cursor!
218
-
219
- Pro tip: Say "act as [role]" to follow AGENTS.md patterns:
220
- - "act as PM and create spec" (AGENTS.md defines PM role)
221
- - "act as Architect and design system" (AGENTS.md defines Architect role)
222
- - "act as DevOps and create infrastructure" (AGENTS.md defines DevOps role)
223
- `;
224
- }
225
-
226
- /**
227
- * Check if Cursor adapter supports plugins
228
- *
229
- * Cursor has plugin support via AGENTS.md compilation
230
- *
231
- * @returns boolean True for Cursor
232
- */
233
- supportsPlugins(): boolean {
234
- return true;
235
- }
236
-
237
- /**
238
- * Read language configuration from project config
239
- *
240
- * @returns Language setting from config, defaults to 'en'
241
- */
242
- private async getLanguageConfig(): Promise<SupportedLanguage> {
243
- const projectPath = process.cwd();
244
- const configPath = path.join(projectPath, '.specweave', 'config.json');
245
-
246
- if (!(await fs.pathExists(configPath))) {
247
- return 'en'; // Default to English if no config
248
- }
249
-
250
- try {
251
- const config = await fs.readJson(configPath);
252
- return (config.language as SupportedLanguage) || 'en';
253
- } catch (error) {
254
- console.warn('āš ļø Could not read language from config, defaulting to English');
255
- return 'en';
256
- }
257
- }
258
-
259
- /**
260
- * Inject system prompt for non-English languages
261
- *
262
- * Prepends language instruction to markdown content if language !== 'en'
263
- *
264
- * @param content Original markdown content
265
- * @param language Target language
266
- * @returns Modified content with system prompt (or unchanged if English)
267
- */
268
- private injectSystemPrompt(content: string, language: SupportedLanguage): string {
269
- if (language === 'en') {
270
- return content; // No changes for English - preserve default behavior
271
- }
272
-
273
- // Get system prompt for target language
274
- const systemPrompt = getSystemPromptForLanguage(language);
275
-
276
- // For AGENTS.md compilation, inject at the beginning of the content
277
- return `${systemPrompt}\n\n${content}`;
278
- }
279
-
280
- /**
281
- * Compile and install a plugin for Cursor
282
- *
283
- * Cursor uses AGENTS.md compilation:
284
- * - Append skills to AGENTS.md
285
- * - Append agents to AGENTS.md
286
- * - Append commands to team commands JSON
287
- *
288
- * NEW: Injects system prompts for non-English languages
289
- *
290
- * @param plugin Plugin to install
291
- */
292
- async compilePlugin(plugin: Plugin): Promise<void> {
293
- const projectPath = process.cwd();
294
- const agentsMdPath = path.join(projectPath, 'AGENTS.md');
295
-
296
- console.log(`\nšŸ“¦ Compiling plugin for Cursor: ${plugin.manifest.name}`);
297
-
298
- // Get language configuration for system prompt injection
299
- const language = await this.getLanguageConfig();
300
- if (language !== 'en') {
301
- console.log(` 🌐 Language: ${language} (system prompts will be injected)`);
302
- }
303
-
304
- // Ensure AGENTS.md exists
305
- if (!(await fs.pathExists(agentsMdPath))) {
306
- throw new Error('AGENTS.md not found. Run specweave init first.');
307
- }
308
-
309
- // Read current AGENTS.md
310
- let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
311
-
312
- // Check if plugin already compiled
313
- const pluginMarker = `<!-- Plugin: ${plugin.manifest.name} -->`;
314
- if (agentsMd.includes(pluginMarker)) {
315
- console.log(` ā„¹ļø Plugin ${plugin.manifest.name} already compiled to AGENTS.md`);
316
- return;
317
- }
318
-
319
- // Generate plugin section for AGENTS.md
320
- let pluginSection = `\n\n${pluginMarker}\n\n`;
321
- pluginSection += `# Plugin: ${plugin.manifest.name}\n\n`;
322
- pluginSection += `${plugin.manifest.description}\n\n`;
323
-
324
- // Add skills
325
- if (plugin.skills.length > 0) {
326
- pluginSection += `## Skills\n\n`;
327
- for (const skill of plugin.skills) {
328
- const skillContent = await fs.readFile(path.join(skill.path, 'SKILL.md'), 'utf-8');
329
- // Remove frontmatter for AGENTS.md
330
- const contentWithoutFrontmatter = skillContent.replace(/^---\n[\s\S]+?\n---\n/, '');
331
- // Inject system prompt if needed
332
- const modifiedContent = this.injectSystemPrompt(contentWithoutFrontmatter, language);
333
- pluginSection += `### ${skill.name}\n\n`;
334
- pluginSection += `${modifiedContent}\n\n`;
335
- }
336
- }
337
-
338
- // Add agents
339
- if (plugin.agents.length > 0) {
340
- pluginSection += `## Agents\n\n`;
341
- for (const agent of plugin.agents) {
342
- const agentContent = await fs.readFile(path.join(agent.path, 'AGENT.md'), 'utf-8');
343
- // Inject system prompt if needed
344
- const modifiedContent = this.injectSystemPrompt(agentContent, language);
345
- pluginSection += `### ${agent.name}\n\n`;
346
- pluginSection += `${modifiedContent}\n\n`;
347
- }
348
- }
349
-
350
- // Add commands
351
- if (plugin.commands.length > 0) {
352
- pluginSection += `## Commands\n\n`;
353
- for (const command of plugin.commands) {
354
- const commandContent = await fs.readFile(command.path, 'utf-8');
355
- // Remove frontmatter
356
- const contentWithoutFrontmatter = commandContent.replace(/^---\n[\s\S]+?\n---\n/, '');
357
- // Inject system prompt if needed
358
- const modifiedContent = this.injectSystemPrompt(contentWithoutFrontmatter, language);
359
- pluginSection += `### /${command.name}\n\n`;
360
- pluginSection += `${modifiedContent}\n\n`;
361
- }
362
- }
363
-
364
- pluginSection += `<!-- End Plugin: ${plugin.manifest.name} -->\n`;
365
-
366
- // Append to AGENTS.md
367
- agentsMd += pluginSection;
368
- await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
369
-
370
- console.log(` āœ“ Compiled to AGENTS.md`);
371
- console.log(` āœ“ ${plugin.skills.length} skills added`);
372
- console.log(` āœ“ ${plugin.agents.length} agents added`);
373
- console.log(` āœ“ ${plugin.commands.length} commands added`);
374
-
375
- console.log(`\nāœ… Plugin ${plugin.manifest.name} compiled for Cursor!`);
376
- }
377
-
378
- /**
379
- * Unload a plugin from Cursor
380
- *
381
- * Removes plugin section from AGENTS.md
382
- *
383
- * @param pluginName Name of plugin to unload
384
- */
385
- async unloadPlugin(pluginName: string): Promise<void> {
386
- const projectPath = process.cwd();
387
- const agentsMdPath = path.join(projectPath, 'AGENTS.md');
388
-
389
- console.log(`\nšŸ—‘ļø Unloading plugin from Cursor: ${pluginName}`);
390
-
391
- if (!(await fs.pathExists(agentsMdPath))) {
392
- console.warn(`āš ļø AGENTS.md not found`);
393
- return;
394
- }
395
-
396
- // Read AGENTS.md
397
- let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
398
-
399
- // Find plugin section
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 in AGENTS.md`);
412
- return;
413
- }
414
-
415
- // Remove plugin section
416
- agentsMd = agentsMd.slice(0, startIndex) + agentsMd.slice(endIndex + endMarker.length);
417
-
418
- // Write back
419
- await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
420
-
421
- console.log(` āœ“ Removed from AGENTS.md`);
422
- console.log(`\nāœ… Plugin ${pluginName} unloaded!`);
423
- }
424
-
425
- /**
426
- * Get list of installed plugins for Cursor
427
- *
428
- * Parses AGENTS.md for plugin markers
429
- *
430
- * @returns Array of installed plugin names
431
- */
432
- async getInstalledPlugins(): Promise<string[]> {
433
- const projectPath = process.cwd();
434
- const agentsMdPath = path.join(projectPath, 'AGENTS.md');
435
-
436
- if (!(await fs.pathExists(agentsMdPath))) {
437
- return [];
438
- }
439
-
440
- const agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
441
- const pluginMarkerRegex = /<!-- Plugin: (specweave-[a-z0-9-]+) -->/g;
442
- const matches = agentsMd.matchAll(pluginMarkerRegex);
443
-
444
- const plugins: string[] = [];
445
- for (const match of matches) {
446
- plugins.push(match[1]);
447
- }
448
-
449
- return plugins;
450
- }
451
- }