specweave 0.4.1 ā 0.6.3
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 +312 -0
- package/.claude-plugin/marketplace.json +210 -0
- package/CLAUDE.md +952 -609
- package/README.md +179 -761
- 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 +2 -0
- package/dist/adapters/claude/adapter.d.ts +49 -11
- package/dist/adapters/claude/adapter.d.ts.map +1 -1
- package/dist/adapters/claude/adapter.js +175 -42
- package/dist/adapters/claude/adapter.js.map +1 -1
- package/dist/adapters/copilot/adapter.d.ts +20 -2
- package/dist/adapters/copilot/adapter.d.ts.map +1 -1
- package/dist/adapters/copilot/adapter.js +117 -7
- package/dist/adapters/copilot/adapter.js.map +1 -1
- package/dist/adapters/cursor/adapter.d.ts +18 -0
- package/dist/adapters/cursor/adapter.d.ts.map +1 -1
- package/dist/adapters/cursor/adapter.js +55 -3
- package/dist/adapters/cursor/adapter.js.map +1 -1
- package/dist/adapters/generic/adapter.d.ts +18 -0
- package/dist/adapters/generic/adapter.d.ts.map +1 -1
- package/dist/adapters/generic/adapter.js +55 -3
- 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 +521 -185
- 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 +23 -6
- package/dist/cli/commands/plugin.d.ts.map +1 -1
- package/dist/cli/commands/plugin.js +92 -66
- package/dist/cli/commands/plugin.js.map +1 -1
- 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-loader.d.ts +33 -13
- package/dist/core/plugin-loader.d.ts.map +1 -1
- package/dist/core/plugin-loader.js +145 -43
- package/dist/core/plugin-loader.js.map +1 -1
- 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 +73 -42
- package/dist/core/types/plugin.d.ts.map +1 -1
- package/dist/core/types/plugin.js +4 -3
- package/dist/core/types/plugin.js.map +1 -1
- 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.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 +285 -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/execFileNoThrow.d.ts +97 -0
- package/dist/utils/execFileNoThrow.d.ts.map +1 -0
- package/dist/utils/execFileNoThrow.js +130 -0
- package/dist/utils/execFileNoThrow.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 +13 -14
- package/plugins/.specweave/logs/hooks-debug.log +24 -0
- package/plugins/.specweave/logs/last-hook-fire +1 -0
- package/plugins/.specweave/logs/last-todowrite-time +1 -0
- package/plugins/.specweave/logs/tasks.log +6 -0
- package/plugins/specweave/.claude-plugin/plugin.json +22 -0
- package/{src ā plugins/specweave}/agents/pm/AGENT.md +80 -0
- package/plugins/specweave/agents/translator/AGENT.md +282 -0
- package/{src ā plugins/specweave}/commands/README.md +11 -11
- package/{src/commands/specweave.costs.md ā plugins/specweave/commands/costs.md} +8 -8
- package/{src/commands/specweave.do.md ā plugins/specweave/commands/do.md} +35 -8
- package/{src/commands/specweave.done.md ā plugins/specweave/commands/done.md} +1 -1
- package/{src/commands/specweave.inc.md ā plugins/specweave/commands/inc.md} +1 -1
- package/{src/commands/specweave.increment.md ā plugins/specweave/commands/increment.md} +84 -19
- package/{src/commands/specweave.next.md ā plugins/specweave/commands/next.md} +1 -1
- package/{src/commands/specweave.progress.md ā plugins/specweave/commands/progress.md} +1 -1
- package/{src ā plugins/specweave}/commands/specweave.md +57 -25
- package/{src/commands/specweave.sync-docs.md ā plugins/specweave/commands/sync-docs.md} +6 -6
- package/plugins/specweave/commands/translate.md +425 -0
- package/{src/commands/specweave.validate.md ā plugins/specweave/commands/validate.md} +2 -2
- package/plugins/specweave/hooks/hooks.json +15 -0
- package/plugins/specweave/hooks/post-task-completion.sh +265 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +229 -0
- package/{src ā plugins/specweave}/skills/brownfield-analyzer/SKILL.md +66 -24
- package/{src ā plugins/specweave}/skills/context-loader/SKILL.md +1 -1
- package/plugins/specweave/skills/context-optimizer/SKILL.md +588 -0
- package/plugins/specweave/skills/docs-updater/SKILL.md +0 -0
- package/{src ā plugins/specweave}/skills/increment-planner/SKILL.md +81 -4
- package/plugins/specweave/skills/plugin-detector/SKILL.md +211 -0
- package/{src ā plugins/specweave}/skills/project-kickstarter/SKILL.md +7 -7
- package/plugins/specweave/skills/rfc-generator/SKILL.md +369 -0
- package/{src ā plugins/specweave}/skills/specweave-detector/SKILL.md +2 -2
- package/plugins/specweave/skills/specweave-framework/SKILL.md +498 -0
- package/plugins/specweave/skills/specweave-framework/test-cases/test-1-increment-naming.yaml +11 -0
- package/plugins/specweave/skills/specweave-framework/test-cases/test-2-source-of-truth.yaml +11 -0
- package/plugins/specweave/skills/specweave-framework/test-cases/test-3-increment-discipline.yaml +12 -0
- package/plugins/specweave/skills/specweave-framework/test-cases/test-4-file-placement.yaml +11 -0
- package/{src ā plugins/specweave}/skills/tdd-workflow/SKILL.md +21 -21
- package/plugins/specweave/skills/translator/SKILL.md +172 -0
- 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-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 +19 -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 +38 -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 +26 -0
- package/plugins/specweave-ui/.mcp.json +14 -0
- package/plugins/specweave-ui/README.md +386 -0
- package/src/adapters/claude/adapter.ts +193 -46
- package/src/adapters/copilot/adapter.ts +132 -7
- package/src/adapters/cursor/adapter.ts +62 -3
- package/src/adapters/generic/adapter.ts +62 -3
- 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 -121
- package/src/skills/SKILLS-INDEX.md +0 -444
- package/src/skills/github-sync/SKILL.md +0 -234
- /package/{src ā plugins/specweave}/agents/architect/AGENT.md +0 -0
- /package/{src ā plugins/specweave}/agents/code-reviewer.md +0 -0
- /package/{src ā plugins/specweave}/agents/docs-writer/AGENT.md +0 -0
- /package/{src ā plugins/specweave}/agents/performance/AGENT.md +0 -0
- /package/{src ā plugins/specweave}/agents/qa-lead/AGENT.md +0 -0
- /package/{src ā plugins/specweave}/agents/security/AGENT.md +0 -0
- /package/{src ā plugins/specweave}/agents/tdd-orchestrator/AGENT.md +0 -0
- /package/{src ā plugins/specweave}/agents/tech-lead/AGENT.md +0 -0
- /package/{src/commands/specweave.list-increments.md ā plugins/specweave/commands/list-increments.md} +0 -0
- /package/{src/commands/specweave.tdd-cycle.md ā plugins/specweave/commands/tdd-cycle.md} +0 -0
- /package/{src/commands/specweave.tdd-green.md ā plugins/specweave/commands/tdd-green.md} +0 -0
- /package/{src/commands/specweave.tdd-red.md ā plugins/specweave/commands/tdd-red.md} +0 -0
- /package/{src/commands/specweave.tdd-refactor.md ā plugins/specweave/commands/tdd-refactor.md} +0 -0
- /package/{src ā plugins/specweave}/hooks/README.md +0 -0
- /package/{src ā plugins/specweave}/hooks/docs-changed.sh +0 -0
- /package/{src ā plugins/specweave}/hooks/human-input-required.sh +0 -0
- /package/{src ā plugins/specweave}/hooks/post-increment-plugin-detect.sh +0 -0
- /package/{src ā plugins/specweave}/hooks/pre-implementation.sh +0 -0
- /package/{src ā plugins/specweave}/hooks/pre-task-plugin-detect.sh +0 -0
- /package/{src ā plugins/specweave}/skills/brownfield-onboarder/SKILL.md +0 -0
- /package/{src ā plugins/specweave}/skills/docs-updater/README.md +0 -0
- /package/{src ā plugins/specweave}/skills/increment-planner/scripts/feature-utils.js +0 -0
- /package/{src ā plugins/specweave}/skills/increment-quality-judge/SKILL.md +0 -0
- /package/{src ā plugins/specweave}/skills/project-kickstarter/test-cases/test-1-high-confidence-full-product.yaml +0 -0
- /package/{src ā plugins/specweave}/skills/project-kickstarter/test-cases/test-2-medium-confidence-partial.yaml +0 -0
- /package/{src ā plugins/specweave}/skills/project-kickstarter/test-cases/test-3-low-confidence-technical-question.yaml +0 -0
- /package/{src ā plugins/specweave}/skills/project-kickstarter/test-cases/test-4-opt-out-explicit.yaml +0 -0
- /package/{src ā plugins/specweave}/skills/role-orchestrator/README.md +0 -0
- /package/{src ā plugins/specweave}/skills/role-orchestrator/SKILL.md +0 -0
- /package/{src ā plugins/specweave}/skills/task-builder/README.md +0 -0
- /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-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
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser for tasks.md files
|
|
3
|
+
* Extracts task information for GitHub sync
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import { Task, Subtask } from './types';
|
|
9
|
+
|
|
10
|
+
export class TaskParser {
|
|
11
|
+
/**
|
|
12
|
+
* Parse tasks.md file and extract all tasks
|
|
13
|
+
*/
|
|
14
|
+
static parseTasksFile(incrementPath: string): Task[] {
|
|
15
|
+
const tasksPath = path.join(incrementPath, 'tasks.md');
|
|
16
|
+
|
|
17
|
+
if (!fs.existsSync(tasksPath)) {
|
|
18
|
+
throw new Error(`tasks.md not found at ${tasksPath}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const content = fs.readFileSync(tasksPath, 'utf-8');
|
|
22
|
+
return this.parseTasks(content);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Parse task content into structured Task objects
|
|
27
|
+
*/
|
|
28
|
+
static parseTasks(content: string): Task[] {
|
|
29
|
+
const tasks: Task[] = [];
|
|
30
|
+
|
|
31
|
+
// Split by task headers (### T-XXX:)
|
|
32
|
+
const taskPattern = /###\s+(T-\d+(?:-[A-Z])?):\s+(.+?)$/gm;
|
|
33
|
+
const matches = [...content.matchAll(taskPattern)];
|
|
34
|
+
|
|
35
|
+
for (let i = 0; i < matches.length; i++) {
|
|
36
|
+
const match = matches[i];
|
|
37
|
+
const taskId = match[1];
|
|
38
|
+
const taskTitle = match[2].trim();
|
|
39
|
+
const startIndex = match.index!;
|
|
40
|
+
const endIndex = i < matches.length - 1 ? matches[i + 1].index! : content.length;
|
|
41
|
+
const taskContent = content.substring(startIndex, endIndex);
|
|
42
|
+
|
|
43
|
+
const task = this.parseTask(taskId, taskTitle, taskContent);
|
|
44
|
+
if (task) {
|
|
45
|
+
tasks.push(task);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return tasks;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Parse individual task section
|
|
54
|
+
*/
|
|
55
|
+
private static parseTask(taskId: string, taskTitle: string, content: string): Task | null {
|
|
56
|
+
try {
|
|
57
|
+
const task: Task = {
|
|
58
|
+
id: taskId,
|
|
59
|
+
title: taskTitle,
|
|
60
|
+
priority: this.extractPriority(content),
|
|
61
|
+
estimate: this.extractEstimate(content),
|
|
62
|
+
status: this.extractStatus(content),
|
|
63
|
+
description: this.extractDescription(content),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Optional fields
|
|
67
|
+
task.githubIssue = this.extractGitHubIssue(content);
|
|
68
|
+
task.assignee = this.extractAssignee(content);
|
|
69
|
+
task.subtasks = this.extractSubtasks(content);
|
|
70
|
+
task.filesToCreate = this.extractFiles(content, 'Files to Create');
|
|
71
|
+
task.filesToModify = this.extractFiles(content, 'Files to Modify');
|
|
72
|
+
task.implementation = this.extractImplementation(content);
|
|
73
|
+
task.acceptanceCriteria = this.extractAcceptanceCriteria(content);
|
|
74
|
+
task.dependencies = this.extractDependencies(content);
|
|
75
|
+
task.blocks = this.extractBlocks(content);
|
|
76
|
+
task.phase = this.extractPhase(content);
|
|
77
|
+
|
|
78
|
+
return task;
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error(`Error parsing task ${taskId}:`, error);
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private static extractPriority(content: string): 'P0' | 'P1' | 'P2' | 'P3' {
|
|
86
|
+
const match = content.match(/\*\*Priority\*\*:\s+(P[0-3])/);
|
|
87
|
+
return (match?.[1] as 'P0' | 'P1' | 'P2' | 'P3') || 'P1';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private static extractEstimate(content: string): string {
|
|
91
|
+
const match = content.match(/\*\*Estimate\*\*:\s+(.+?)$/m);
|
|
92
|
+
return match?.[1]?.trim() || 'Unknown';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private static extractStatus(content: string): 'pending' | 'in_progress' | 'completed' | 'blocked' {
|
|
96
|
+
const match = content.match(/\*\*Status\*\*:\s+(\w+)/);
|
|
97
|
+
const status = match?.[1];
|
|
98
|
+
if (status === 'pending' || status === 'in_progress' || status === 'completed' || status === 'blocked') {
|
|
99
|
+
return status;
|
|
100
|
+
}
|
|
101
|
+
return 'pending';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
private static extractDescription(content: string): string {
|
|
105
|
+
const match = content.match(/\*\*Description\*\*:\s*\n(.+?)(?=\n\*\*|$)/s);
|
|
106
|
+
return match?.[1]?.trim() || '';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private static extractGitHubIssue(content: string): number | undefined {
|
|
110
|
+
const match = content.match(/\*\*GitHub Issue\*\*:\s+#(\d+)/);
|
|
111
|
+
return match ? parseInt(match[1], 10) : undefined;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private static extractAssignee(content: string): string | undefined {
|
|
115
|
+
const match = content.match(/\*\*Assignee\*\*:\s+@?(\w+)/);
|
|
116
|
+
return match?.[1];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private static extractSubtasks(content: string): Subtask[] | undefined {
|
|
120
|
+
const subtaskSection = content.match(/\*\*Subtasks\*\*:?\s*\n((?:- \[.\] .+\n?)+)/);
|
|
121
|
+
if (!subtaskSection) return undefined;
|
|
122
|
+
|
|
123
|
+
const subtaskLines = subtaskSection[1].match(/- \[(x| )\] (.+?)(?:\((.+?)\))?$/gm);
|
|
124
|
+
if (!subtaskLines) return undefined;
|
|
125
|
+
|
|
126
|
+
return subtaskLines.map(line => {
|
|
127
|
+
const match = line.match(/- \[(x| )\] (.+?)(?:\((.+?)\))?$/);
|
|
128
|
+
if (!match) return null;
|
|
129
|
+
|
|
130
|
+
const completed = match[1] === 'x';
|
|
131
|
+
const description = match[2].trim();
|
|
132
|
+
const estimate = match[3]?.trim() || 'Unknown';
|
|
133
|
+
|
|
134
|
+
// Extract subtask ID if present (S-XXX-XX format)
|
|
135
|
+
const idMatch = description.match(/^(S-\d+-\d+):\s*(.+)/);
|
|
136
|
+
const id = idMatch ? idMatch[1] : `S-${Date.now()}`; // Fallback ID
|
|
137
|
+
const cleanDescription = idMatch ? idMatch[2] : description;
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
id,
|
|
141
|
+
description: cleanDescription,
|
|
142
|
+
estimate,
|
|
143
|
+
completed
|
|
144
|
+
};
|
|
145
|
+
}).filter((st): st is Subtask => st !== null);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
private static extractFiles(content: string, section: string): string[] | undefined {
|
|
149
|
+
const pattern = new RegExp(`\\*\\*${section}\\*\\*:?\\s*\\n((?:- \`.+?\`\\n?)+)`, 's');
|
|
150
|
+
const match = content.match(pattern);
|
|
151
|
+
if (!match) return undefined;
|
|
152
|
+
|
|
153
|
+
const files = match[1].match(/- `(.+?)`/g);
|
|
154
|
+
return files?.map(f => f.replace(/- `(.+?)`/, '$1'));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private static extractImplementation(content: string): string | undefined {
|
|
158
|
+
const match = content.match(/\*\*Implementation\*\*:?\s*\n```[\w]*\n([\s\S]+?)\n```/);
|
|
159
|
+
return match?.[1]?.trim();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
private static extractAcceptanceCriteria(content: string): string[] | undefined {
|
|
163
|
+
const match = content.match(/\*\*Acceptance Criteria\*\*:?\s*\n((?:- .+\n?)+)/);
|
|
164
|
+
if (!match) return undefined;
|
|
165
|
+
|
|
166
|
+
const criteria = match[1].match(/- (.+)/g);
|
|
167
|
+
return criteria?.map(c => c.replace(/^- /, '').replace(/^ā
\s*/, ''));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private static extractDependencies(content: string): string[] | undefined {
|
|
171
|
+
const match = content.match(/\*\*Dependencies\*\*:?\s*\n((?:- .+\n?)+)/);
|
|
172
|
+
if (!match) return undefined;
|
|
173
|
+
|
|
174
|
+
const deps = match[1].match(/- (T-\d+(?:-[A-Z])?)/g);
|
|
175
|
+
return deps?.map(d => d.replace(/^- /, '').match(/(T-\d+(?:-[A-Z])?)/)?.[1]).filter((d): d is string => !!d);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
private static extractBlocks(content: string): string[] | undefined {
|
|
179
|
+
const match = content.match(/\*\*Blocks\*\*:?\s*\n((?:- .+\n?)+)/);
|
|
180
|
+
if (!match) return undefined;
|
|
181
|
+
|
|
182
|
+
const blocks = match[1].match(/- (T-\d+(?:-[A-Z])?)/g);
|
|
183
|
+
return blocks?.map(b => b.replace(/^- /, '').match(/(T-\d+(?:-[A-Z])?)/)?.[1]).filter((b): b is string => !!b);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
private static extractPhase(content: string): string | undefined {
|
|
187
|
+
// Look backwards in content to find phase header
|
|
188
|
+
const lines = content.split('\n');
|
|
189
|
+
for (let i = 0; i < lines.length; i++) {
|
|
190
|
+
const line = lines[i];
|
|
191
|
+
if (line.startsWith('##') && !line.startsWith('###')) {
|
|
192
|
+
const phaseMatch = line.match(/##\s+(.+?)(?:\s+-\s+\d+\s+tasks)?$/);
|
|
193
|
+
if (phaseMatch) {
|
|
194
|
+
return phaseMatch[1].trim();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Update tasks.md file with GitHub issue numbers
|
|
203
|
+
*/
|
|
204
|
+
static updateTasksWithGitHubIssues(
|
|
205
|
+
incrementPath: string,
|
|
206
|
+
taskIssueMap: Record<string, number>
|
|
207
|
+
): void {
|
|
208
|
+
const tasksPath = path.join(incrementPath, 'tasks.md');
|
|
209
|
+
let content = fs.readFileSync(tasksPath, 'utf-8');
|
|
210
|
+
|
|
211
|
+
for (const [taskId, issueNumber] of Object.entries(taskIssueMap)) {
|
|
212
|
+
// Find task section
|
|
213
|
+
const taskHeaderPattern = new RegExp(`(###\\s+${taskId}:.+?$)`, 'm');
|
|
214
|
+
const match = content.match(taskHeaderPattern);
|
|
215
|
+
if (!match) continue;
|
|
216
|
+
|
|
217
|
+
const taskStart = match.index!;
|
|
218
|
+
const nextTaskPattern = /###\s+T-\d+(?:-[A-Z])?:/g;
|
|
219
|
+
nextTaskPattern.lastIndex = taskStart + match[0].length;
|
|
220
|
+
const nextMatch = nextTaskPattern.exec(content);
|
|
221
|
+
const taskEnd = nextMatch ? nextMatch.index : content.length;
|
|
222
|
+
const taskSection = content.substring(taskStart, taskEnd);
|
|
223
|
+
|
|
224
|
+
// Check if GitHub Issue field already exists
|
|
225
|
+
if (taskSection.includes('**GitHub Issue**:')) {
|
|
226
|
+
// Update existing
|
|
227
|
+
const updatedSection = taskSection.replace(
|
|
228
|
+
/\*\*GitHub Issue\*\*:.+$/m,
|
|
229
|
+
`**GitHub Issue**: #${issueNumber}`
|
|
230
|
+
);
|
|
231
|
+
content = content.substring(0, taskStart) + updatedSection + content.substring(taskEnd);
|
|
232
|
+
} else {
|
|
233
|
+
// Add after Status line
|
|
234
|
+
const statusLinePattern = /(\*\*Status\*\*:.+?$)/m;
|
|
235
|
+
const statusMatch = taskSection.match(statusLinePattern);
|
|
236
|
+
if (statusMatch) {
|
|
237
|
+
const insertPoint = taskStart + taskSection.indexOf(statusMatch[0]) + statusMatch[0].length;
|
|
238
|
+
const insertion = `\n**GitHub Issue**: #${issueNumber}`;
|
|
239
|
+
content = content.substring(0, insertPoint) + insertion + content.substring(insertPoint);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
fs.writeFileSync(tasksPath, content, 'utf-8');
|
|
245
|
+
}
|
|
246
|
+
}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task-level GitHub synchronization
|
|
3
|
+
* Orchestrates syncing tasks.md to GitHub issues
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import * as yaml from 'js-yaml';
|
|
9
|
+
import { GitHubClient } from './github-client';
|
|
10
|
+
import { TaskParser } from './task-parser';
|
|
11
|
+
import { Task, IncrementMetadata, SyncResult, GitHubSyncOptions } from './types';
|
|
12
|
+
|
|
13
|
+
export class TaskSync {
|
|
14
|
+
private client: GitHubClient;
|
|
15
|
+
private incrementPath: string;
|
|
16
|
+
|
|
17
|
+
constructor(incrementPath: string, repo?: string) {
|
|
18
|
+
this.incrementPath = incrementPath;
|
|
19
|
+
this.client = new GitHubClient(repo);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Sync all tasks to GitHub (main entry point)
|
|
24
|
+
*/
|
|
25
|
+
async syncTasks(options: GitHubSyncOptions = {}): Promise<SyncResult> {
|
|
26
|
+
const {
|
|
27
|
+
force = false,
|
|
28
|
+
dryRun = false,
|
|
29
|
+
batchDelay = 6000,
|
|
30
|
+
batchSize = 10,
|
|
31
|
+
milestoneDays = 2, // SpecWeave default: 2 days (AI velocity)
|
|
32
|
+
projectName,
|
|
33
|
+
fastMode = false
|
|
34
|
+
} = options;
|
|
35
|
+
|
|
36
|
+
console.log(`\nš Syncing increment to GitHub...`);
|
|
37
|
+
|
|
38
|
+
// 1. Check prerequisites
|
|
39
|
+
const ghCheck = GitHubClient.checkGitHubCLI();
|
|
40
|
+
if (!ghCheck.installed || !ghCheck.authenticated) {
|
|
41
|
+
throw new Error(ghCheck.error || 'GitHub CLI check failed');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 2. Load increment metadata
|
|
45
|
+
const metadata = this.loadIncrementMetadata();
|
|
46
|
+
console.log(`š¦ Increment: ${metadata.id} - ${metadata.title}`);
|
|
47
|
+
|
|
48
|
+
// 3. Parse tasks
|
|
49
|
+
const tasks = TaskParser.parseTasksFile(this.incrementPath);
|
|
50
|
+
console.log(`š Found ${tasks.length} tasks`);
|
|
51
|
+
|
|
52
|
+
if (dryRun) {
|
|
53
|
+
console.log(`\nš DRY RUN MODE - No changes will be made`);
|
|
54
|
+
this.printDryRunSummary(tasks, metadata);
|
|
55
|
+
return {
|
|
56
|
+
epic: {} as any,
|
|
57
|
+
tasks: [],
|
|
58
|
+
errors: []
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 4. Check if already synced (and force not set)
|
|
63
|
+
if (metadata.github?.epic_issue && !force) {
|
|
64
|
+
console.log(`\nā ļø Increment already synced to GitHub (epic #${metadata.github.epic_issue})`);
|
|
65
|
+
console.log(` Use --force to re-sync (WARNING: will create duplicate issues)`);
|
|
66
|
+
throw new Error('Already synced. Use --force to override.');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const errors: Array<{ taskId?: string; error: string }> = [];
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
// 5. Create or get milestone (with SpecWeave AI velocity: 1-2 days)
|
|
73
|
+
const milestoneTitle = this.getMilestoneTitle(metadata);
|
|
74
|
+
console.log(`\nš Creating milestone: ${milestoneTitle} (due in ${milestoneDays} days)`);
|
|
75
|
+
const milestone = await this.client.createOrGetMilestone(
|
|
76
|
+
milestoneTitle,
|
|
77
|
+
`Milestone for increment ${metadata.id}`,
|
|
78
|
+
milestoneDays
|
|
79
|
+
);
|
|
80
|
+
console.log(` ā
Milestone #${milestone.number}: ${milestone.title}`);
|
|
81
|
+
|
|
82
|
+
// 6. Create epic issue
|
|
83
|
+
console.log(`\nšÆ Creating epic issue for increment ${metadata.id}...`);
|
|
84
|
+
const epicBody = this.generateEpicBody(metadata, tasks);
|
|
85
|
+
const epic = await this.client.createEpicIssue(
|
|
86
|
+
`[INC-${metadata.id}] ${metadata.title}`,
|
|
87
|
+
epicBody,
|
|
88
|
+
milestone.title,
|
|
89
|
+
['increment', 'specweave', metadata.priority.toLowerCase()]
|
|
90
|
+
);
|
|
91
|
+
console.log(` ā
Epic issue #${epic.number}: ${epic.html_url}`);
|
|
92
|
+
|
|
93
|
+
// 7. Create task issues (with smart rate limiting)
|
|
94
|
+
// Fast mode: Skip delays for small increments (< 10 tasks) or when explicitly requested
|
|
95
|
+
const useFastMode = fastMode || tasks.length < 10;
|
|
96
|
+
const effectiveDelay = useFastMode ? 0 : batchDelay;
|
|
97
|
+
|
|
98
|
+
if (useFastMode) {
|
|
99
|
+
console.log(`\nš Creating ${tasks.length} task issues (fast mode - no rate limiting)...`);
|
|
100
|
+
} else {
|
|
101
|
+
console.log(`\nš Creating ${tasks.length} task issues (batch size: ${batchSize}, delay: ${effectiveDelay}ms)...`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const taskIssues: Array<{ taskId: string; issue: any }> = [];
|
|
105
|
+
const issueData = tasks.map(task => ({
|
|
106
|
+
title: `[${task.id}] ${task.title}`,
|
|
107
|
+
body: this.generateTaskBody(task),
|
|
108
|
+
labels: ['task', task.priority.toLowerCase(), ...(task.phase ? [this.slugify(task.phase)] : [])]
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const createdIssues = await this.client.batchCreateIssues(
|
|
112
|
+
issueData,
|
|
113
|
+
milestone.title,
|
|
114
|
+
epic.number,
|
|
115
|
+
{ batchSize, delayMs: effectiveDelay }
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// TODO: GitHub Projects integration (if projectName provided)
|
|
119
|
+
// if (projectName) {
|
|
120
|
+
// await this.addIssuesToProject(projectName, [epic, ...createdIssues]);
|
|
121
|
+
// }
|
|
122
|
+
|
|
123
|
+
// Map issues to tasks
|
|
124
|
+
for (let i = 0; i < tasks.length; i++) {
|
|
125
|
+
if (createdIssues[i]) {
|
|
126
|
+
taskIssues.push({
|
|
127
|
+
taskId: tasks[i].id,
|
|
128
|
+
issue: createdIssues[i]
|
|
129
|
+
});
|
|
130
|
+
console.log(` ā
#${createdIssues[i].number}: [${tasks[i].id}] ${tasks[i].title}`);
|
|
131
|
+
} else {
|
|
132
|
+
errors.push({
|
|
133
|
+
taskId: tasks[i].id,
|
|
134
|
+
error: 'Failed to create issue'
|
|
135
|
+
});
|
|
136
|
+
console.log(` ā [${tasks[i].id}] ${tasks[i].title} - Failed`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// 8. Update tasks.md with GitHub issue numbers
|
|
141
|
+
console.log(`\nš Updating tasks.md with GitHub issue numbers...`);
|
|
142
|
+
const taskIssueMap: Record<string, number> = {};
|
|
143
|
+
taskIssues.forEach(({ taskId, issue }) => {
|
|
144
|
+
taskIssueMap[taskId] = issue.number;
|
|
145
|
+
});
|
|
146
|
+
TaskParser.updateTasksWithGitHubIssues(this.incrementPath, taskIssueMap);
|
|
147
|
+
console.log(` ā
Updated tasks.md`);
|
|
148
|
+
|
|
149
|
+
// 9. Save sync mapping
|
|
150
|
+
console.log(`\nš¾ Saving sync mapping...`);
|
|
151
|
+
this.saveSyncMapping({
|
|
152
|
+
milestone: milestone.number,
|
|
153
|
+
epic_issue: epic.number,
|
|
154
|
+
task_issues: taskIssueMap,
|
|
155
|
+
last_sync: new Date().toISOString()
|
|
156
|
+
});
|
|
157
|
+
console.log(` ā
Saved to .github-sync.yaml`);
|
|
158
|
+
|
|
159
|
+
// 10. Update increment metadata
|
|
160
|
+
metadata.github = {
|
|
161
|
+
milestone: milestone.number,
|
|
162
|
+
epic_issue: epic.number,
|
|
163
|
+
task_issues: taskIssueMap,
|
|
164
|
+
last_sync: new Date().toISOString()
|
|
165
|
+
};
|
|
166
|
+
this.saveIncrementMetadata(metadata);
|
|
167
|
+
|
|
168
|
+
// Success summary
|
|
169
|
+
console.log(`\nš GitHub sync complete!`);
|
|
170
|
+
console.log(` š Milestone: #${milestone.number} ${milestone.title}`);
|
|
171
|
+
console.log(` šÆ Epic: #${epic.number} ${epic.html_url}`);
|
|
172
|
+
console.log(` š Tasks: #${createdIssues[0]?.number}-#${createdIssues[createdIssues.length - 1]?.number} (${createdIssues.length} issues)`);
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
milestone,
|
|
176
|
+
epic,
|
|
177
|
+
tasks: taskIssues,
|
|
178
|
+
errors
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
} catch (error: any) {
|
|
182
|
+
console.error(`\nā Sync failed:`, error.message);
|
|
183
|
+
throw error;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Generate epic issue body
|
|
189
|
+
*/
|
|
190
|
+
private generateEpicBody(metadata: IncrementMetadata, tasks: Task[]): string {
|
|
191
|
+
const specPath = path.join(this.incrementPath, 'spec.md');
|
|
192
|
+
let summary = 'No summary available';
|
|
193
|
+
|
|
194
|
+
if (fs.existsSync(specPath)) {
|
|
195
|
+
const specContent = fs.readFileSync(specPath, 'utf-8');
|
|
196
|
+
const summaryMatch = specContent.match(/## Executive Summary\s+(.+?)(?=\n##|$)/s);
|
|
197
|
+
summary = summaryMatch?.[1]?.trim() || summary;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Group tasks by phase
|
|
201
|
+
const phases = new Map<string, Task[]>();
|
|
202
|
+
tasks.forEach(task => {
|
|
203
|
+
const phase = task.phase || 'Other';
|
|
204
|
+
if (!phases.has(phase)) {
|
|
205
|
+
phases.set(phase, []);
|
|
206
|
+
}
|
|
207
|
+
phases.get(phase)!.push(task);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
let phaseChecklist = '';
|
|
211
|
+
for (const [phase, phaseTasks] of phases.entries()) {
|
|
212
|
+
phaseChecklist += `\n### ${phase}\n\n`;
|
|
213
|
+
phaseTasks.forEach(task => {
|
|
214
|
+
phaseChecklist += `- [ ] [${task.id}] ${task.title} (${task.estimate})\n`;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return `# [Increment ${metadata.id}] ${metadata.title}
|
|
219
|
+
|
|
220
|
+
**Status**: ${metadata.status}
|
|
221
|
+
**Priority**: ${metadata.priority}
|
|
222
|
+
**Created**: ${new Date().toISOString().split('T')[0]}
|
|
223
|
+
|
|
224
|
+
## Summary
|
|
225
|
+
|
|
226
|
+
${summary}
|
|
227
|
+
|
|
228
|
+
## Tasks (${tasks.length} total)
|
|
229
|
+
${phaseChecklist}
|
|
230
|
+
|
|
231
|
+
## SpecWeave Increment
|
|
232
|
+
|
|
233
|
+
This epic tracks SpecWeave increment \`${metadata.id}\`.
|
|
234
|
+
|
|
235
|
+
- **Spec**: [\`spec.md\`](${this.getGitHubFileURL('spec.md')})
|
|
236
|
+
- **Plan**: [\`plan.md\`](${this.getGitHubFileURL('plan.md')})
|
|
237
|
+
- **Tasks**: [\`tasks.md\`](${this.getGitHubFileURL('tasks.md')})
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
š¤ Auto-synced by [SpecWeave](https://spec-weave.com)`;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Generate task issue body
|
|
246
|
+
*/
|
|
247
|
+
private generateTaskBody(task: Task): string {
|
|
248
|
+
let body = `**Priority**: ${task.priority}
|
|
249
|
+
**Estimate**: ${task.estimate}
|
|
250
|
+
**Phase**: ${task.phase || 'N/A'}
|
|
251
|
+
|
|
252
|
+
## Description
|
|
253
|
+
|
|
254
|
+
${task.description}
|
|
255
|
+
`;
|
|
256
|
+
|
|
257
|
+
if (task.subtasks && task.subtasks.length > 0) {
|
|
258
|
+
body += `\n## Subtasks\n\n`;
|
|
259
|
+
task.subtasks.forEach(subtask => {
|
|
260
|
+
const checked = subtask.completed ? 'x' : ' ';
|
|
261
|
+
body += `- [${checked}] ${subtask.id}: ${subtask.description} (${subtask.estimate})\n`;
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (task.filesToCreate && task.filesToCreate.length > 0) {
|
|
266
|
+
body += `\n## Files to Create\n\n`;
|
|
267
|
+
task.filesToCreate.forEach(file => {
|
|
268
|
+
body += `- \`${file}\`\n`;
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (task.filesToModify && task.filesToModify.length > 0) {
|
|
273
|
+
body += `\n## Files to Modify\n\n`;
|
|
274
|
+
task.filesToModify.forEach(file => {
|
|
275
|
+
body += `- \`${file}\`\n`;
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (task.implementation) {
|
|
280
|
+
body += `\n## Implementation\n\n\`\`\`typescript\n${task.implementation}\n\`\`\`\n`;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (task.acceptanceCriteria && task.acceptanceCriteria.length > 0) {
|
|
284
|
+
body += `\n## Acceptance Criteria\n\n`;
|
|
285
|
+
task.acceptanceCriteria.forEach(criterion => {
|
|
286
|
+
body += `- ā
${criterion}\n`;
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (task.dependencies && task.dependencies.length > 0) {
|
|
291
|
+
body += `\n## Dependencies\n\nThis task depends on:\n`;
|
|
292
|
+
task.dependencies.forEach(dep => {
|
|
293
|
+
body += `- ${dep} (must complete first)\n`;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (task.blocks && task.blocks.length > 0) {
|
|
298
|
+
body += `\n## Blocks\n\nThis task blocks:\n`;
|
|
299
|
+
task.blocks.forEach(blocked => {
|
|
300
|
+
body += `- ${blocked} (waiting on this)\n`;
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
body += `\n---\n\nš¤ Synced from SpecWeave increment \`${path.basename(this.incrementPath)}\`\n`;
|
|
305
|
+
body += `- **Tasks**: [\`tasks.md\`](${this.getGitHubFileURL('tasks.md')})\n`;
|
|
306
|
+
|
|
307
|
+
return body;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Load increment metadata
|
|
312
|
+
*/
|
|
313
|
+
private loadIncrementMetadata(): IncrementMetadata {
|
|
314
|
+
const metadataPath = path.join(this.incrementPath, '.metadata.yaml');
|
|
315
|
+
|
|
316
|
+
if (fs.existsSync(metadataPath)) {
|
|
317
|
+
const content = fs.readFileSync(metadataPath, 'utf-8');
|
|
318
|
+
return yaml.load(content) as IncrementMetadata;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Fallback: extract from directory name and spec
|
|
322
|
+
const incrementId = path.basename(this.incrementPath);
|
|
323
|
+
const specPath = path.join(this.incrementPath, 'spec.md');
|
|
324
|
+
let title = 'Unknown';
|
|
325
|
+
let priority: 'P0' | 'P1' | 'P2' | 'P3' = 'P1';
|
|
326
|
+
|
|
327
|
+
if (fs.existsSync(specPath)) {
|
|
328
|
+
const specContent = fs.readFileSync(specPath, 'utf-8');
|
|
329
|
+
const titleMatch = specContent.match(/\*\*Title\*\*:\s*(.+)/);
|
|
330
|
+
const priorityMatch = specContent.match(/\*\*Priority\*\*:\s*(P[0-3])/);
|
|
331
|
+
title = titleMatch?.[1]?.trim() || title;
|
|
332
|
+
priority = (priorityMatch?.[1] as any) || priority;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return {
|
|
336
|
+
id: incrementId,
|
|
337
|
+
title,
|
|
338
|
+
priority,
|
|
339
|
+
status: 'planning'
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Save increment metadata
|
|
345
|
+
*/
|
|
346
|
+
private saveIncrementMetadata(metadata: IncrementMetadata): void {
|
|
347
|
+
const metadataPath = path.join(this.incrementPath, '.metadata.yaml');
|
|
348
|
+
fs.writeFileSync(metadataPath, yaml.dump(metadata), 'utf-8');
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Save sync mapping
|
|
353
|
+
*/
|
|
354
|
+
private saveSyncMapping(githubData: any): void {
|
|
355
|
+
const syncPath = path.join(this.incrementPath, '.github-sync.yaml');
|
|
356
|
+
fs.writeFileSync(syncPath, yaml.dump(githubData), 'utf-8');
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Get milestone title from metadata
|
|
361
|
+
*/
|
|
362
|
+
private getMilestoneTitle(metadata: IncrementMetadata): string {
|
|
363
|
+
return metadata.version ? `v${metadata.version}` : `Increment ${metadata.id}`;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Get GitHub file URL
|
|
368
|
+
*/
|
|
369
|
+
private getGitHubFileURL(filename: string): string {
|
|
370
|
+
try {
|
|
371
|
+
const remote = this.client['detectRepo']();
|
|
372
|
+
const incrementId = path.basename(this.incrementPath);
|
|
373
|
+
return `https://github.com/${remote}/blob/develop/.specweave/increments/${incrementId}/${filename}`;
|
|
374
|
+
} catch {
|
|
375
|
+
return `#`;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Convert string to slug
|
|
381
|
+
*/
|
|
382
|
+
private slugify(str: string): string {
|
|
383
|
+
return str
|
|
384
|
+
.toLowerCase()
|
|
385
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
386
|
+
.replace(/^-|-$/g, '');
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Print dry run summary
|
|
391
|
+
*/
|
|
392
|
+
private printDryRunSummary(tasks: Task[], metadata: IncrementMetadata): void {
|
|
393
|
+
console.log(`\nš Dry Run Summary:`);
|
|
394
|
+
console.log(` Milestone: ${this.getMilestoneTitle(metadata)}`);
|
|
395
|
+
console.log(` Epic: [INC-${metadata.id}] ${metadata.title}`);
|
|
396
|
+
console.log(` Task Issues: ${tasks.length}`);
|
|
397
|
+
console.log(`\nš Would create:`);
|
|
398
|
+
tasks.forEach((task, i) => {
|
|
399
|
+
console.log(` ${i + 1}. [${task.id}] ${task.title} (${task.estimate})`);
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|