specweave 0.4.0 ā 0.6.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.
- package/.claude-plugin/README.md +325 -0
- package/.claude-plugin/marketplace.json +210 -0
- package/CLAUDE.md +1000 -252
- package/README.md +273 -180
- package/bin/install-agents.sh +1 -1
- package/bin/install-commands.sh +66 -14
- package/bin/install-hooks.sh +1 -1
- package/bin/install-skills.sh +1 -1
- package/bin/specweave.js +18 -0
- package/dist/adapters/adapter-base.d.ts +21 -0
- package/dist/adapters/adapter-base.d.ts.map +1 -1
- package/dist/adapters/adapter-base.js +28 -0
- package/dist/adapters/adapter-base.js.map +1 -1
- package/dist/adapters/adapter-interface.d.ts +41 -0
- package/dist/adapters/adapter-interface.d.ts.map +1 -1
- package/dist/adapters/claude/adapter.d.ts +85 -11
- package/dist/adapters/claude/adapter.d.ts.map +1 -1
- package/dist/adapters/claude/adapter.js +305 -37
- package/dist/adapters/claude/adapter.js.map +1 -1
- package/dist/adapters/copilot/adapter.d.ts +45 -2
- package/dist/adapters/copilot/adapter.d.ts.map +1 -1
- package/dist/adapters/copilot/adapter.js +226 -4
- package/dist/adapters/copilot/adapter.js.map +1 -1
- package/dist/adapters/cursor/adapter.d.ts +54 -0
- package/dist/adapters/cursor/adapter.d.ts.map +1 -1
- package/dist/adapters/cursor/adapter.js +192 -0
- package/dist/adapters/cursor/adapter.js.map +1 -1
- package/dist/adapters/generic/adapter.d.ts +43 -0
- package/dist/adapters/generic/adapter.d.ts.map +1 -1
- package/dist/adapters/generic/adapter.js +163 -0
- package/dist/adapters/generic/adapter.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +392 -123
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +2 -0
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +28 -25
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/list.d.ts +2 -0
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/list.js +26 -24
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/plugin.d.ts +43 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +307 -0
- package/dist/cli/commands/plugin.js.map +1 -0
- package/dist/core/i18n/language-detector.d.ts +29 -0
- package/dist/core/i18n/language-detector.d.ts.map +1 -0
- package/dist/core/i18n/language-detector.js +143 -0
- package/dist/core/i18n/language-detector.js.map +1 -0
- package/dist/core/i18n/language-manager.d.ts +101 -0
- package/dist/core/i18n/language-manager.d.ts.map +1 -0
- package/dist/core/i18n/language-manager.js +232 -0
- package/dist/core/i18n/language-manager.js.map +1 -0
- package/dist/core/i18n/language-registry.d.ts +44 -0
- package/dist/core/i18n/language-registry.d.ts.map +1 -0
- package/dist/core/i18n/language-registry.js +234 -0
- package/dist/core/i18n/language-registry.js.map +1 -0
- package/dist/core/i18n/locale-manager.d.ts +62 -0
- package/dist/core/i18n/locale-manager.d.ts.map +1 -0
- package/dist/core/i18n/locale-manager.js +137 -0
- package/dist/core/i18n/locale-manager.js.map +1 -0
- package/dist/core/i18n/system-prompt-injector.d.ts +33 -0
- package/dist/core/i18n/system-prompt-injector.d.ts.map +1 -0
- package/dist/core/i18n/system-prompt-injector.js +131 -0
- package/dist/core/i18n/system-prompt-injector.js.map +1 -0
- package/dist/core/i18n/types.d.ts +151 -0
- package/dist/core/i18n/types.d.ts.map +1 -0
- package/dist/core/i18n/types.js +11 -0
- package/dist/core/i18n/types.js.map +1 -0
- package/dist/core/increment-status.d.ts +72 -0
- package/dist/core/increment-status.d.ts.map +1 -0
- package/dist/core/increment-status.js +227 -0
- package/dist/core/increment-status.js.map +1 -0
- package/dist/core/plugin-detector.d.ts +96 -0
- package/dist/core/plugin-detector.d.ts.map +1 -0
- package/dist/core/plugin-detector.js +349 -0
- package/dist/core/plugin-detector.js.map +1 -0
- package/dist/core/plugin-loader.d.ts +131 -0
- package/dist/core/plugin-loader.d.ts.map +1 -0
- package/dist/core/plugin-loader.js +421 -0
- package/dist/core/plugin-loader.js.map +1 -0
- package/dist/core/plugin-manager.d.ts +144 -0
- package/dist/core/plugin-manager.d.ts.map +1 -0
- package/dist/core/plugin-manager.js +393 -0
- package/dist/core/plugin-manager.js.map +1 -0
- package/dist/core/schemas/plugin-manifest.schema.json +253 -0
- package/dist/core/types/config.d.ts +51 -0
- package/dist/core/types/config.d.ts.map +1 -0
- package/dist/core/types/config.js +21 -0
- package/dist/core/types/config.js.map +1 -0
- package/dist/core/types/plugin.d.ts +283 -0
- package/dist/core/types/plugin.d.ts.map +1 -0
- package/dist/core/types/plugin.js +49 -0
- package/dist/core/types/plugin.js.map +1 -0
- package/dist/hooks/lib/sync-living-docs.d.ts +27 -0
- package/dist/hooks/lib/sync-living-docs.d.ts.map +1 -0
- package/dist/hooks/lib/sync-living-docs.js +116 -0
- package/dist/hooks/lib/sync-living-docs.js.map +1 -0
- package/dist/hooks/lib/translate-living-docs.d.ts +13 -0
- package/dist/hooks/lib/translate-living-docs.d.ts.map +1 -0
- package/dist/hooks/lib/translate-living-docs.js +166 -0
- package/dist/hooks/lib/translate-living-docs.js.map +1 -0
- package/dist/hooks/lib/update-tasks-md.d.ts +29 -0
- package/dist/hooks/lib/update-tasks-md.d.ts.map +1 -0
- package/dist/hooks/lib/update-tasks-md.js +203 -0
- package/dist/hooks/lib/update-tasks-md.js.map +1 -0
- package/dist/integrations/jira/jira-incremental-mapper.js.map +1 -1
- package/dist/integrations/jira/jira-mapper.d.ts +2 -2
- package/dist/integrations/jira/jira-mapper.js +2 -2
- package/dist/integrations/jira/jira-mapper.js.map +1 -1
- package/dist/locales/de/.gitkeep +0 -0
- package/dist/locales/de/cli.json +108 -0
- package/dist/locales/en/cli.json +269 -0
- package/dist/locales/en/errors.json +7 -0
- package/dist/locales/en/templates.json +6 -0
- package/dist/locales/es/.gitkeep +0 -0
- package/dist/locales/es/cli.json +41 -0
- package/dist/locales/fr/.gitkeep +0 -0
- package/dist/locales/fr/cli.json +108 -0
- package/dist/locales/ja/.gitkeep +0 -0
- package/dist/locales/ja/cli.json +108 -0
- package/dist/locales/ko/.gitkeep +0 -0
- package/dist/locales/ko/cli.json +108 -0
- package/dist/locales/pt/.gitkeep +0 -0
- package/dist/locales/pt/cli.json +108 -0
- package/dist/locales/ru/.gitkeep +0 -0
- package/dist/locales/ru/cli.json +269 -0
- package/dist/locales/zh/.gitkeep +0 -0
- package/dist/locales/zh/cli.json +108 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts +86 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client.js +275 -0
- package/dist/plugins/specweave-github/lib/github-client.js.map +1 -0
- package/dist/plugins/specweave-github/lib/index.d.ts +10 -0
- package/dist/plugins/specweave-github/lib/index.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/index.js +10 -0
- package/dist/plugins/specweave-github/lib/index.js.map +1 -0
- package/dist/plugins/specweave-github/lib/subtask-sync.d.ts +51 -0
- package/dist/plugins/specweave-github/lib/subtask-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/subtask-sync.js +147 -0
- package/dist/plugins/specweave-github/lib/subtask-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/task-parser.d.ts +37 -0
- package/dist/plugins/specweave-github/lib/task-parser.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/task-parser.js +211 -0
- package/dist/plugins/specweave-github/lib/task-parser.js.map +1 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts +51 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/task-sync.js +332 -0
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/types.d.ts +80 -0
- package/dist/plugins/specweave-github/lib/types.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/types.js +5 -0
- package/dist/plugins/specweave-github/lib/types.js.map +1 -0
- package/dist/utils/agents-md-compiler.d.ts +68 -0
- package/dist/utils/agents-md-compiler.d.ts.map +1 -0
- package/dist/utils/agents-md-compiler.js +420 -0
- package/dist/utils/agents-md-compiler.js.map +1 -0
- package/dist/utils/generate-skills-index.js +4 -4
- package/dist/utils/generate-skills-index.js.map +1 -1
- package/package.json +24 -21
- package/plugins/specweave-ado/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-alternatives/skills/bmad-method-expert/SKILL.md +626 -0
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/analyze-project.js +318 -0
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/check-setup.js +208 -0
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/generate-template.js +1149 -0
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/validate-documents.js +340 -0
- package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +1010 -0
- package/plugins/specweave-backend/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-core/.claude-plugin/plugin.json +25 -0
- package/{src ā plugins/specweave-core}/agents/pm/AGENT.md +80 -0
- package/plugins/specweave-core/agents/translator/AGENT.md +282 -0
- package/{src ā plugins/specweave-core}/commands/README.md +11 -11
- package/{src ā plugins/specweave-core}/commands/specweave.costs.md +7 -7
- package/{src ā plugins/specweave-core}/commands/specweave.do.md +34 -7
- package/{src ā plugins/specweave-core}/commands/specweave.increment.md +131 -22
- package/{src ā plugins/specweave-core}/commands/specweave.md +49 -17
- package/{src ā plugins/specweave-core}/commands/specweave.sync-docs.md +5 -5
- package/plugins/specweave-core/commands/specweave.translate.md +425 -0
- package/{src ā plugins/specweave-core}/commands/specweave.validate.md +1 -1
- package/plugins/specweave-core/hooks/hooks.json +13 -0
- package/plugins/specweave-core/hooks/post-increment-plugin-detect.sh +142 -0
- package/plugins/specweave-core/hooks/post-task-completion.sh +265 -0
- package/plugins/specweave-core/hooks/pre-task-plugin-detect.sh +96 -0
- package/plugins/specweave-core/skills/SKILLS-INDEX.md +229 -0
- package/{src ā plugins/specweave-core}/skills/brownfield-analyzer/SKILL.md +66 -24
- package/{src ā plugins/specweave-core}/skills/context-loader/SKILL.md +1 -1
- package/plugins/specweave-core/skills/context-optimizer/SKILL.md +588 -0
- package/plugins/specweave-core/skills/docs-updater/SKILL.md +0 -0
- package/{src ā plugins/specweave-core}/skills/increment-planner/SKILL.md +81 -4
- package/plugins/specweave-core/skills/plugin-detector/SKILL.md +211 -0
- package/{src ā plugins/specweave-core}/skills/project-kickstarter/SKILL.md +7 -7
- package/plugins/specweave-core/skills/rfc-generator/SKILL.md +369 -0
- package/{src ā plugins/specweave-core}/skills/specweave-detector/SKILL.md +2 -2
- package/plugins/specweave-core/skills/specweave-framework/SKILL.md +498 -0
- package/plugins/specweave-core/skills/specweave-framework/test-cases/test-1-increment-naming.yaml +11 -0
- package/plugins/specweave-core/skills/specweave-framework/test-cases/test-2-source-of-truth.yaml +11 -0
- package/plugins/specweave-core/skills/specweave-framework/test-cases/test-3-increment-discipline.yaml +12 -0
- package/plugins/specweave-core/skills/specweave-framework/test-cases/test-4-file-placement.yaml +11 -0
- package/{src ā plugins/specweave-core}/skills/tdd-workflow/SKILL.md +20 -20
- package/plugins/specweave-core/skills/translator/SKILL.md +172 -0
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-diagrams/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-docs/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +526 -0
- package/plugins/specweave-figma/.claude-plugin/.mcp.json +12 -0
- package/plugins/specweave-figma/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-figma/ARCHITECTURE.md +453 -0
- package/plugins/specweave-figma/README.md +728 -0
- package/plugins/specweave-figma/skills/figma-to-code/SKILL.md +632 -0
- package/plugins/specweave-figma/skills/figma-to-code/test-1-token-generation.yaml +29 -0
- package/plugins/specweave-figma/skills/figma-to-code/test-2-component-generation.yaml +27 -0
- package/plugins/specweave-figma/skills/figma-to-code/test-3-typescript-generation.yaml +28 -0
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-github/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-github/agents/github-manager/AGENT.md +651 -0
- package/plugins/specweave-github/commands/github-close-issue.md +418 -0
- package/plugins/specweave-github/commands/github-create-issue.md +307 -0
- package/plugins/specweave-github/commands/github-status.md +533 -0
- package/plugins/specweave-github/commands/github-sync-tasks.md +530 -0
- package/plugins/specweave-github/commands/github-sync.md +443 -0
- package/plugins/specweave-github/lib/github-client.ts +330 -0
- package/plugins/specweave-github/lib/index.ts +10 -0
- package/plugins/specweave-github/lib/subtask-sync.ts +225 -0
- package/plugins/specweave-github/lib/task-parser.ts +246 -0
- package/plugins/specweave-github/lib/task-sync.ts +402 -0
- package/plugins/specweave-github/lib/types.ts +86 -0
- package/plugins/specweave-github/skills/github-issue-tracker/SKILL.md +497 -0
- package/plugins/specweave-github/skills/github-sync/SKILL.md +461 -0
- package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-jira/.claude-plugin/plugin.json +8 -0
- package/{src ā plugins/specweave-jira}/commands/specweave.sync-jira.md +18 -18
- package/plugins/specweave-kubernetes/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-ml/.claude-plugin/plugin.json +39 -0
- package/plugins/specweave-ml/README.md +885 -0
- package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +402 -0
- package/plugins/specweave-ml/commands/ml-deploy.md +116 -0
- package/plugins/specweave-ml/commands/ml-evaluate.md +87 -0
- package/plugins/specweave-ml/commands/ml-explain.md +83 -0
- package/plugins/specweave-ml/skills/anomaly-detector/SKILL.md +559 -0
- package/plugins/specweave-ml/skills/automl-optimizer/SKILL.md +485 -0
- package/plugins/specweave-ml/skills/cv-pipeline-builder/SKILL.md +157 -0
- package/plugins/specweave-ml/skills/data-visualizer/SKILL.md +521 -0
- package/plugins/specweave-ml/skills/experiment-tracker/SKILL.md +535 -0
- package/plugins/specweave-ml/skills/feature-engineer/SKILL.md +566 -0
- package/plugins/specweave-ml/skills/ml-deployment-helper/SKILL.md +345 -0
- package/plugins/specweave-ml/skills/ml-pipeline-orchestrator/SKILL.md +518 -0
- package/plugins/specweave-ml/skills/model-evaluator/SKILL.md +155 -0
- package/plugins/specweave-ml/skills/model-explainer/SKILL.md +227 -0
- package/plugins/specweave-ml/skills/model-registry/SKILL.md +541 -0
- package/plugins/specweave-ml/skills/nlp-pipeline-builder/SKILL.md +180 -0
- package/plugins/specweave-ml/skills/time-series-forecaster/SKILL.md +569 -0
- package/plugins/specweave-payments/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-testing/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +8 -0
- package/plugins/specweave-ui/.claude-plugin/plugin.json +106 -0
- package/plugins/specweave-ui/.mcp.json +14 -0
- package/plugins/specweave-ui/README.md +386 -0
- package/src/adapters/adapter-base.ts +33 -0
- package/src/adapters/adapter-interface.ts +46 -0
- package/src/adapters/claude/adapter.ts +350 -39
- package/src/adapters/copilot/adapter.ts +267 -4
- package/src/adapters/cursor/adapter.ts +229 -0
- package/src/adapters/generic/adapter.ts +196 -0
- package/src/templates/AGENTS.md.template +170 -1
- package/src/templates/CLAUDE.md.template +122 -24
- package/src/templates/tasks.md.template +261 -0
- package/src/agents/ml-engineer/AGENT.md +0 -150
- package/src/commands/specweave.sync-github.md +0 -269
- package/src/hooks/post-task-completion.sh +0 -79
- package/src/skills/SKILLS-INDEX.md +0 -444
- package/src/skills/github-sync/SKILL.md +0 -234
- /package/{src ā plugins/specweave-ado}/skills/ado-sync/README.md +0 -0
- /package/{src ā plugins/specweave-ado}/skills/ado-sync/SKILL.md +0 -0
- /package/{src ā plugins/specweave-ado}/skills/specweave-ado-mapper/SKILL.md +0 -0
- /package/{src ā plugins/specweave-backend}/agents/database-optimizer/AGENT.md +0 -0
- /package/{src ā plugins/specweave-backend}/skills/dotnet-backend/SKILL.md +0 -0
- /package/{src ā plugins/specweave-backend}/skills/nodejs-backend/SKILL.md +0 -0
- /package/{src ā plugins/specweave-backend}/skills/python-backend/SKILL.md +0 -0
- /package/{src ā plugins/specweave-core}/agents/architect/AGENT.md +0 -0
- /package/{src ā plugins/specweave-core}/agents/code-reviewer.md +0 -0
- /package/{src ā plugins/specweave-core}/agents/docs-writer/AGENT.md +0 -0
- /package/{src ā plugins/specweave-core}/agents/performance/AGENT.md +0 -0
- /package/{src ā plugins/specweave-core}/agents/qa-lead/AGENT.md +0 -0
- /package/{src ā plugins/specweave-core}/agents/security/AGENT.md +0 -0
- /package/{src ā plugins/specweave-core}/agents/tdd-orchestrator/AGENT.md +0 -0
- /package/{src ā plugins/specweave-core}/agents/tech-lead/AGENT.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.done.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.inc.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.list-increments.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.next.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.progress.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.tdd-cycle.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.tdd-green.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.tdd-red.md +0 -0
- /package/{src ā plugins/specweave-core}/commands/specweave.tdd-refactor.md +0 -0
- /package/{src ā plugins/specweave-core}/hooks/README.md +0 -0
- /package/{src ā plugins/specweave-core}/hooks/docs-changed.sh +0 -0
- /package/{src ā plugins/specweave-core}/hooks/human-input-required.sh +0 -0
- /package/{src ā plugins/specweave-core}/hooks/pre-implementation.sh +0 -0
- /package/{src ā plugins/specweave-core}/skills/brownfield-onboarder/SKILL.md +0 -0
- /package/{src ā plugins/specweave-core}/skills/docs-updater/README.md +0 -0
- /package/{src ā plugins/specweave-core}/skills/increment-planner/scripts/feature-utils.js +0 -0
- /package/{src ā plugins/specweave-core}/skills/increment-quality-judge/SKILL.md +0 -0
- /package/{src ā plugins/specweave-core}/skills/project-kickstarter/test-cases/test-1-high-confidence-full-product.yaml +0 -0
- /package/{src ā plugins/specweave-core}/skills/project-kickstarter/test-cases/test-2-medium-confidence-partial.yaml +0 -0
- /package/{src ā plugins/specweave-core}/skills/project-kickstarter/test-cases/test-3-low-confidence-technical-question.yaml +0 -0
- /package/{src ā plugins/specweave-core}/skills/project-kickstarter/test-cases/test-4-opt-out-explicit.yaml +0 -0
- /package/{src ā plugins/specweave-core}/skills/role-orchestrator/README.md +0 -0
- /package/{src ā plugins/specweave-core}/skills/role-orchestrator/SKILL.md +0 -0
- /package/{src ā plugins/specweave-core}/skills/task-builder/README.md +0 -0
- /package/{src ā plugins/specweave-cost-optimizer}/skills/cost-optimizer/SKILL.md +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/AGENT.md +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/templates/c4-component-template.mmd +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/templates/c4-container-template.mmd +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/templates/c4-context-template.mmd +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/templates/deployment-template.mmd +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/templates/er-diagram-template.mmd +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/templates/sequence-template.mmd +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/test-cases/test-1-c4-context.yaml +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/test-cases/test-2-sequence.yaml +0 -0
- /package/{src ā plugins/specweave-diagrams}/agents/diagrams-architect/test-cases/test-3-er-diagram.yaml +0 -0
- /package/{src ā plugins/specweave-diagrams}/skills/diagrams-architect/SKILL.md +0 -0
- /package/{src ā plugins/specweave-diagrams}/skills/diagrams-generator/SKILL.md +0 -0
- /package/{src ā plugins/specweave-docs}/skills/spec-driven-brainstorming/README.md +0 -0
- /package/{src ā plugins/specweave-docs}/skills/spec-driven-brainstorming/SKILL.md +0 -0
- /package/{src ā plugins/specweave-docs}/skills/spec-driven-debugging/README.md +0 -0
- /package/{src ā plugins/specweave-docs}/skills/spec-driven-debugging/SKILL.md +0 -0
- /package/{src ā plugins/specweave-frontend}/skills/design-system-architect/SKILL.md +0 -0
- /package/{src ā plugins/specweave-frontend}/skills/frontend/SKILL.md +0 -0
- /package/{src ā plugins/specweave-frontend}/skills/nextjs/SKILL.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/devops/AGENT.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/network-engineer/AGENT.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/observability-engineer/AGENT.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/performance-engineer/AGENT.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/AGENT.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/modules/backend-diagnostics.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/modules/database-diagnostics.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/modules/infrastructure.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/modules/monitoring.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/modules/security-incidents.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/modules/ui-diagnostics.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/01-high-cpu-usage.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/02-database-deadlock.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/03-memory-leak.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/04-slow-api-response.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/05-ddos-attack.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/06-disk-full.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/07-service-down.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/08-data-corruption.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/09-cascade-failure.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/playbooks/10-rate-limit-exceeded.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/scripts/health-check.sh +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/scripts/log-analyzer.py +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/scripts/metrics-collector.sh +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/scripts/trace-analyzer.js +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/templates/incident-report.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/templates/mitigation-plan.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/templates/post-mortem.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/agents/sre/templates/runbook-template.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/commands/specweave.monitor-setup.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/commands/specweave.slo-implement.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/skills/distributed-tracing/SKILL.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/skills/grafana-dashboards/SKILL.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/skills/hetzner-provisioner/README.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/skills/hetzner-provisioner/SKILL.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/skills/prometheus-configuration/SKILL.md +0 -0
- /package/{src ā plugins/specweave-infrastructure}/skills/slo-implementation/SKILL.md +0 -0
- /package/{src ā plugins/specweave-jira}/skills/jira-sync/README.md +0 -0
- /package/{src ā plugins/specweave-jira}/skills/jira-sync/SKILL.md +0 -0
- /package/{src ā plugins/specweave-jira}/skills/specweave-jira-mapper/SKILL.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/agents/kubernetes-architect/AGENT.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/gitops-workflow/SKILL.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/gitops-workflow/references/argocd-setup.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/gitops-workflow/references/sync-policies.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/SKILL.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/assets/Chart.yaml.template +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/assets/values.yaml.template +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/references/chart-structure.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/scripts/validate-chart.sh +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-manifest-generator/SKILL.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-manifest-generator/assets/configmap-template.yaml +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-manifest-generator/assets/deployment-template.yaml +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-manifest-generator/assets/service-template.yaml +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-manifest-generator/references/deployment-spec.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-manifest-generator/references/service-spec.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-security-policies/SKILL.md +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-security-policies/assets/network-policy-template.yaml +0 -0
- /package/{src ā plugins/specweave-kubernetes}/skills/k8s-security-policies/references/rbac-patterns.md +0 -0
- /package/{src ā plugins/specweave-ml}/agents/data-scientist/AGENT.md +0 -0
- /package/{src ā plugins/specweave-ml}/agents/mlops-engineer/AGENT.md +0 -0
- /package/{src ā plugins/specweave-ml}/commands/specweave.ml-pipeline.md +0 -0
- /package/{src ā plugins/specweave-ml}/skills/ml-pipeline-workflow/SKILL.md +0 -0
- /package/{src ā plugins/specweave-payments}/agents/payment-integration/AGENT.md +0 -0
- /package/{src ā plugins/specweave-payments}/skills/billing-automation/SKILL.md +0 -0
- /package/{src ā plugins/specweave-payments}/skills/paypal-integration/SKILL.md +0 -0
- /package/{src ā plugins/specweave-payments}/skills/pci-compliance/SKILL.md +0 -0
- /package/{src ā plugins/specweave-payments}/skills/stripe-integration/SKILL.md +0 -0
- /package/{src ā plugins/specweave-testing}/skills/e2e-playwright/README.md +0 -0
- /package/{src ā plugins/specweave-testing}/skills/e2e-playwright/SKILL.md +0 -0
- /package/{src ā plugins/specweave-testing}/skills/e2e-playwright/execute.js +0 -0
- /package/{src ā plugins/specweave-testing}/skills/e2e-playwright/lib/utils.js +0 -0
- /package/{src ā plugins/specweave-testing}/skills/e2e-playwright/package.json +0 -0
- /package/{src ā plugins/specweave-tooling}/skills/skill-creator/LICENSE.txt +0 -0
- /package/{src ā plugins/specweave-tooling}/skills/skill-creator/SKILL.md +0 -0
- /package/{src ā plugins/specweave-tooling}/skills/skill-creator/scripts/init_skill.py +0 -0
- /package/{src ā plugins/specweave-tooling}/skills/skill-creator/scripts/package_skill.py +0 -0
- /package/{src ā plugins/specweave-tooling}/skills/skill-creator/scripts/quick_validate.py +0 -0
- /package/{src ā plugins/specweave-tooling}/skills/skill-router/SKILL.md +0 -0
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
* GitHub Copilot Adapter
|
|
3
3
|
*
|
|
4
4
|
* Basic automation adapter for GitHub Copilot.
|
|
5
|
-
*
|
|
5
|
+
* Compiles SpecWeave plugins to AGENTS.md (universal standard) for context and suggestions.
|
|
6
6
|
*
|
|
7
|
-
* This adapter
|
|
7
|
+
* This adapter compiles skills, agents, and commands into AGENTS.md format.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as path from 'path';
|
|
11
11
|
import fs from 'fs-extra';
|
|
12
12
|
import { AdapterBase } from '../adapter-base.js';
|
|
13
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';
|
|
14
18
|
|
|
15
19
|
export class CopilotAdapter extends AdapterBase {
|
|
16
20
|
name = 'copilot';
|
|
@@ -46,8 +50,73 @@ export class CopilotAdapter extends AdapterBase {
|
|
|
46
50
|
async install(options: AdapterOptions): Promise<void> {
|
|
47
51
|
console.log('\nš¦ Configuring GitHub Copilot (Basic Automation)\n');
|
|
48
52
|
|
|
49
|
-
//
|
|
50
|
-
|
|
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');
|
|
51
120
|
}
|
|
52
121
|
|
|
53
122
|
/**
|
|
@@ -178,4 +247,198 @@ Note: For better automation, consider Claude Code (full) or Cursor (semi).
|
|
|
178
247
|
Copilot is best for simple projects or when already using VS Code + Copilot.
|
|
179
248
|
`;
|
|
180
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
|
+
}
|
|
181
444
|
}
|
|
@@ -12,6 +12,9 @@ import * as path from 'path';
|
|
|
12
12
|
import fs from 'fs-extra';
|
|
13
13
|
import { AdapterBase } from '../adapter-base.js';
|
|
14
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';
|
|
15
18
|
|
|
16
19
|
export class CursorAdapter extends AdapterBase {
|
|
17
20
|
name = 'cursor';
|
|
@@ -219,4 +222,230 @@ Pro tip: Say "act as [role]" to follow AGENTS.md patterns:
|
|
|
219
222
|
- "act as DevOps and create infrastructure" (AGENTS.md defines DevOps role)
|
|
220
223
|
`;
|
|
221
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
|
+
}
|
|
222
451
|
}
|