create-hq 5.0.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/dist/deps.d.ts +4 -0
- package/dist/deps.d.ts.map +1 -0
- package/dist/deps.js +65 -0
- package/dist/deps.js.map +1 -0
- package/dist/git.d.ts +3 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +19 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/scaffold.d.ts +8 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +130 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/ui.d.ts +7 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +36 -0
- package/dist/ui.js.map +1 -0
- package/package.json +41 -0
- package/template/.claude/CLAUDE.md +202 -0
- package/template/.claude/commands/checkpoint.md +127 -0
- package/template/.claude/commands/cleanup.md +307 -0
- package/template/.claude/commands/execute-task.md +440 -0
- package/template/.claude/commands/exit-plan.md +41 -0
- package/template/.claude/commands/handoff.md +97 -0
- package/template/.claude/commands/learn.md +218 -0
- package/template/.claude/commands/metrics.md +118 -0
- package/template/.claude/commands/newworker.md +162 -0
- package/template/.claude/commands/nexttask.md +67 -0
- package/template/.claude/commands/prd.md +238 -0
- package/template/.claude/commands/reanchor.md +51 -0
- package/template/.claude/commands/remember.md +126 -0
- package/template/.claude/commands/run-project.md +348 -0
- package/template/.claude/commands/run.md +110 -0
- package/template/.claude/commands/search-reindex.md +62 -0
- package/template/.claude/commands/search.md +100 -0
- package/template/.claude/commands/setup.md +381 -0
- package/template/.claude/scripts/pure-ralph-loop.ps1 +312 -0
- package/template/.claude/scripts/pure-ralph-loop.sh +859 -0
- package/template/CHANGELOG.md +220 -0
- package/template/LICENSE +21 -0
- package/template/MIGRATION.md +259 -0
- package/template/README.md +368 -0
- package/template/data/journal/.gitkeep +0 -0
- package/template/docs/images/ascii-banner-options.md +122 -0
- package/template/docs/images/hq-banner.svg +105 -0
- package/template/knowledge/Ralph/01-overview.md +71 -0
- package/template/knowledge/Ralph/02-core-concepts.md +114 -0
- package/template/knowledge/Ralph/03-how-ralph-works.md +184 -0
- package/template/knowledge/Ralph/04-back-pressure.md +222 -0
- package/template/knowledge/Ralph/05-specifications.md +210 -0
- package/template/knowledge/Ralph/06-agents-md.md +222 -0
- package/template/knowledge/Ralph/07-implementation.md +316 -0
- package/template/knowledge/Ralph/08-economics.md +182 -0
- package/template/knowledge/Ralph/09-resources.md +145 -0
- package/template/knowledge/Ralph/10-claude-code-workflow.md +212 -0
- package/template/knowledge/Ralph/11-team-training-guide.md +383 -0
- package/template/knowledge/Ralph/README.md +40 -0
- package/template/knowledge/ai-security-framework/CONTRIBUTING.md +139 -0
- package/template/knowledge/ai-security-framework/GLOSSARY.md +176 -0
- package/template/knowledge/ai-security-framework/LICENSE +21 -0
- package/template/knowledge/ai-security-framework/QUICK-START.md +172 -0
- package/template/knowledge/ai-security-framework/README.md +232 -0
- package/template/knowledge/ai-security-framework/checklists/browser-security.md +301 -0
- package/template/knowledge/ai-security-framework/checklists/credential-isolation.md +322 -0
- package/template/knowledge/ai-security-framework/checklists/incident-response.md +288 -0
- package/template/knowledge/ai-security-framework/checklists/pre-flight.md +249 -0
- package/template/knowledge/ai-security-framework/checklists/weekly-audit.md +159 -0
- package/template/knowledge/ai-security-framework/configs/audit-logging.md +372 -0
- package/template/knowledge/ai-security-framework/configs/kill-switches.md +354 -0
- package/template/knowledge/ai-security-framework/docs/01-core-principles.md +256 -0
- package/template/knowledge/ai-security-framework/docs/02-threat-landscape.md +326 -0
- package/template/knowledge/ai-security-framework/docs/03-security-posture.md +250 -0
- package/template/knowledge/ai-security-framework/templates/agents-security.md +233 -0
- package/template/knowledge/design-styles/README.md +42 -0
- package/template/knowledge/design-styles/american-industrial.md +136 -0
- package/template/knowledge/design-styles/ethereal-abstract.md +133 -0
- package/template/knowledge/design-styles/liminal-portal.md +111 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G-3m4YPW0AADdu2.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G-JJlt5WwAABK3K.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G-JJmj5W0AEbJ-7.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ (1).jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G7fVkn3WEAAM-ST.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G8ECO5JWEAIksyn.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G9-3GQSWoAA8eqZ.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G9xEOqrXkAEZRcs.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G_MVeJrXQAA8sx4.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G_RSkmGXkAAgAVZ.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/README.md +31 -0
- package/template/knowledge/design-styles/swipes/american-industrial/qyqtg7Dq.png +0 -0
- package/template/knowledge/dev-team/README.md +35 -0
- package/template/knowledge/dev-team/patterns/README.md +34 -0
- package/template/knowledge/dev-team/patterns/frontend/react-best-practices.md +178 -0
- package/template/knowledge/dev-team/troubleshooting/README.md +31 -0
- package/template/knowledge/dev-team/workflows/README.md +49 -0
- package/template/knowledge/hq/checkpoint-schema.json +51 -0
- package/template/knowledge/hq/index-md-spec.md +74 -0
- package/template/knowledge/hq/thread-schema.md +153 -0
- package/template/knowledge/hq-core/checkpoint-schema.json +51 -0
- package/template/knowledge/hq-core/index-md-spec.md +74 -0
- package/template/knowledge/hq-core/thread-schema.md +153 -0
- package/template/knowledge/loom/README.md +51 -0
- package/template/knowledge/loom/architecture.md +125 -0
- package/template/knowledge/loom/code-style.md +169 -0
- package/template/knowledge/loom/llm-proxy.md +132 -0
- package/template/knowledge/loom/state-machine.md +131 -0
- package/template/knowledge/loom/thread-system.md +117 -0
- package/template/knowledge/loom/tools.md +94 -0
- package/template/knowledge/loom/weaver.md +96 -0
- package/template/knowledge/loom/web-frontend.md +131 -0
- package/template/knowledge/projects/README.md +72 -0
- package/template/knowledge/projects/templates/README.template.md +28 -0
- package/template/knowledge/workers/README.md +195 -0
- package/template/knowledge/workers/ralph-loop-pattern.md +157 -0
- package/template/knowledge/workers/skill-schema.md +182 -0
- package/template/knowledge/workers/state-machine.md +102 -0
- package/template/knowledge/workers/templates/base-worker.yaml +73 -0
- package/template/knowledge/workers/templates/code-worker.yaml +85 -0
- package/template/knowledge/workers/templates/skill.yaml +49 -0
- package/template/knowledge/workers/templates/social-worker.yaml +70 -0
- package/template/modules/examples/full-manifest.yaml +92 -0
- package/template/modules/examples/minimal.yaml +14 -0
- package/template/modules/modules.yaml +59 -0
- package/template/projects/.gitkeep +0 -0
- package/template/projects/incorporate-workers-into-pure-ralph/prd.json +88 -0
- package/template/projects/pure-ralph-branch-isolation/README.md +114 -0
- package/template/projects/pure-ralph-branch-isolation/prd.json +123 -0
- package/template/projects/purist-ralph-loop/README.md +148 -0
- package/template/projects/purist-ralph-loop/prd.json +135 -0
- package/template/projects/ralph-test/prd.json +50 -0
- package/template/prompts/pure-ralph-base.md +551 -0
- package/template/settings/.gitkeep +0 -0
- package/template/settings/pure-ralph.json +42 -0
- package/template/social-content/drafts/INDEX.md +21 -0
- package/template/social-content/drafts/linkedin/.gitkeep +1 -0
- package/template/social-content/drafts/x/.gitkeep +1 -0
- package/template/social-content/images/.gitkeep +1 -0
- package/template/starter-projects/code-worker/README.md +97 -0
- package/template/starter-projects/code-worker/prd.json +45 -0
- package/template/starter-projects/personal-assistant/README.md +42 -0
- package/template/starter-projects/personal-assistant/prd.json +43 -0
- package/template/starter-projects/social-media/README.md +60 -0
- package/template/starter-projects/social-media/prd.json +43 -0
- package/template/workers/content-brand/README.md +59 -0
- package/template/workers/content-brand/skills/messaging-alignment.md +91 -0
- package/template/workers/content-brand/skills/tone-check.md +76 -0
- package/template/workers/content-brand/skills/voice-analysis.md +68 -0
- package/template/workers/content-brand/worker.yaml +81 -0
- package/template/workers/content-legal/README.md +80 -0
- package/template/workers/content-legal/skills/claim-substantiation.md +150 -0
- package/template/workers/content-legal/skills/compliance-scan.md +123 -0
- package/template/workers/content-legal/skills/disclaimer-check.md +146 -0
- package/template/workers/content-legal/worker.yaml +118 -0
- package/template/workers/content-product/README.md +77 -0
- package/template/workers/content-product/skills/claim-verification.md +96 -0
- package/template/workers/content-product/skills/feature-accuracy.md +117 -0
- package/template/workers/content-product/skills/stats-check.md +128 -0
- package/template/workers/content-product/worker.yaml +97 -0
- package/template/workers/content-sales/README.md +70 -0
- package/template/workers/content-sales/skills/conversion-analysis.md +96 -0
- package/template/workers/content-sales/skills/cta-audit.md +107 -0
- package/template/workers/content-sales/skills/value-prop-check.md +114 -0
- package/template/workers/content-sales/worker.yaml +93 -0
- package/template/workers/content-shared/cli.ts +242 -0
- package/template/workers/content-shared/index.ts +234 -0
- package/template/workers/content-shared/lib/accuracy-analyzer.ts +661 -0
- package/template/workers/content-shared/lib/analyze.ts +370 -0
- package/template/workers/content-shared/lib/brand-analyzer.ts +526 -0
- package/template/workers/content-shared/lib/cms-integration.ts +446 -0
- package/template/workers/content-shared/lib/compliance-analyzer.ts +655 -0
- package/template/workers/content-shared/lib/conversion-analyzer.ts +555 -0
- package/template/workers/content-shared/lib/github-integration.ts +582 -0
- package/template/workers/content-shared/lib/output.ts +373 -0
- package/template/workers/content-shared/lib/parser.ts +771 -0
- package/template/workers/content-shared/lib/priority.ts +439 -0
- package/template/workers/content-shared/lib/recommendations.ts +512 -0
- package/template/workers/content-shared/lib/reporter.ts +749 -0
- package/template/workers/content-shared/lib/restructure.ts +664 -0
- package/template/workers/content-shared/lib/scorer.ts +140 -0
- package/template/workers/content-shared/lib/types.ts +227 -0
- package/template/workers/content-shared/lib/variants.ts +595 -0
- package/template/workers/content-shared/package.json +51 -0
- package/template/workers/content-shared/pnpm-lock.yaml +39 -0
- package/template/workers/content-shared/test/sample-page.json +115 -0
- package/template/workers/content-shared/tsconfig.json +20 -0
- package/template/workers/dev-team/README.md +166 -0
- package/template/workers/dev-team/_template.yaml +70 -0
- package/template/workers/dev-team/architect/package.json +27 -0
- package/template/workers/dev-team/architect/skills/api-design.md +89 -0
- package/template/workers/dev-team/architect/skills/refactor-plan.md +96 -0
- package/template/workers/dev-team/architect/skills/system-design.md +100 -0
- package/template/workers/dev-team/architect/src/index.ts +49 -0
- package/template/workers/dev-team/architect/src/mcp-server.ts +122 -0
- package/template/workers/dev-team/architect/src/skills/api-design.ts +316 -0
- package/template/workers/dev-team/architect/src/skills/refactor-plan.ts +264 -0
- package/template/workers/dev-team/architect/src/skills/system-design.ts +212 -0
- package/template/workers/dev-team/architect/tsconfig.json +19 -0
- package/template/workers/dev-team/architect/worker.yaml +128 -0
- package/template/workers/dev-team/backend-dev/package-lock.json +1252 -0
- package/template/workers/dev-team/backend-dev/package.json +27 -0
- package/template/workers/dev-team/backend-dev/skills/implement-endpoint.md +70 -0
- package/template/workers/dev-team/backend-dev/skills/implement-service.md +62 -0
- package/template/workers/dev-team/backend-dev/src/index.ts +51 -0
- package/template/workers/dev-team/backend-dev/src/mcp-server.ts +109 -0
- package/template/workers/dev-team/backend-dev/src/skills/implement-endpoint.ts +122 -0
- package/template/workers/dev-team/backend-dev/src/skills/implement-service.ts +126 -0
- package/template/workers/dev-team/backend-dev/tsconfig.json +19 -0
- package/template/workers/dev-team/backend-dev/worker.yaml +128 -0
- package/template/workers/dev-team/code-reviewer/package-lock.json +1080 -0
- package/template/workers/dev-team/code-reviewer/package.json +24 -0
- package/template/workers/dev-team/code-reviewer/skills/merge-to-production.md +61 -0
- package/template/workers/dev-team/code-reviewer/skills/merge-to-staging.md +54 -0
- package/template/workers/dev-team/code-reviewer/skills/request-changes.md +63 -0
- package/template/workers/dev-team/code-reviewer/skills/review-pr.md +77 -0
- package/template/workers/dev-team/code-reviewer/src/index.ts +56 -0
- package/template/workers/dev-team/code-reviewer/src/mcp-server.ts +101 -0
- package/template/workers/dev-team/code-reviewer/tsconfig.json +19 -0
- package/template/workers/dev-team/code-reviewer/worker.yaml +90 -0
- package/template/workers/dev-team/database-dev/package.json +22 -0
- package/template/workers/dev-team/database-dev/skills/create-schema.md +48 -0
- package/template/workers/dev-team/database-dev/src/index.ts +50 -0
- package/template/workers/dev-team/database-dev/src/mcp-server.ts +76 -0
- package/template/workers/dev-team/database-dev/tsconfig.json +18 -0
- package/template/workers/dev-team/database-dev/worker.yaml +90 -0
- package/template/workers/dev-team/frontend-dev/package.json +22 -0
- package/template/workers/dev-team/frontend-dev/skills/create-component.md +26 -0
- package/template/workers/dev-team/frontend-dev/src/index.ts +50 -0
- package/template/workers/dev-team/frontend-dev/src/mcp-server.ts +77 -0
- package/template/workers/dev-team/frontend-dev/tsconfig.json +18 -0
- package/template/workers/dev-team/frontend-dev/worker.yaml +132 -0
- package/template/workers/dev-team/infra-dev/package.json +24 -0
- package/template/workers/dev-team/infra-dev/skills/add-monitoring.md +73 -0
- package/template/workers/dev-team/infra-dev/skills/configure-deployment.md +80 -0
- package/template/workers/dev-team/infra-dev/skills/create-dockerfile.md +62 -0
- package/template/workers/dev-team/infra-dev/skills/setup-cicd.md +63 -0
- package/template/workers/dev-team/infra-dev/src/index.ts +55 -0
- package/template/workers/dev-team/infra-dev/src/mcp-server.ts +82 -0
- package/template/workers/dev-team/infra-dev/tsconfig.json +19 -0
- package/template/workers/dev-team/infra-dev/worker.yaml +92 -0
- package/template/workers/dev-team/knowledge-curator/package.json +24 -0
- package/template/workers/dev-team/knowledge-curator/skills/curate-troubleshooting.md +63 -0
- package/template/workers/dev-team/knowledge-curator/skills/process-learnings.md +61 -0
- package/template/workers/dev-team/knowledge-curator/skills/sync-documentation.md +76 -0
- package/template/workers/dev-team/knowledge-curator/skills/update-patterns.md +63 -0
- package/template/workers/dev-team/knowledge-curator/src/index.ts +53 -0
- package/template/workers/dev-team/knowledge-curator/src/mcp-server.ts +92 -0
- package/template/workers/dev-team/knowledge-curator/tsconfig.json +19 -0
- package/template/workers/dev-team/knowledge-curator/worker.yaml +80 -0
- package/template/workers/dev-team/motion-designer/package.json +22 -0
- package/template/workers/dev-team/motion-designer/skills/add-animation.md +25 -0
- package/template/workers/dev-team/motion-designer/skills/generate-image.md +36 -0
- package/template/workers/dev-team/motion-designer/src/index.ts +63 -0
- package/template/workers/dev-team/motion-designer/src/mcp-server.ts +79 -0
- package/template/workers/dev-team/motion-designer/tsconfig.json +18 -0
- package/template/workers/dev-team/motion-designer/worker.yaml +84 -0
- package/template/workers/dev-team/product-planner/queue.json +4 -0
- package/template/workers/dev-team/product-planner/worker.yaml +220 -0
- package/template/workers/dev-team/project-manager/package-lock.json +1252 -0
- package/template/workers/dev-team/project-manager/package.json +27 -0
- package/template/workers/dev-team/project-manager/skills/create-prd.md +66 -0
- package/template/workers/dev-team/project-manager/skills/next-issue.md +51 -0
- package/template/workers/dev-team/project-manager/skills/project-status.md +59 -0
- package/template/workers/dev-team/project-manager/skills/update-learnings.md +65 -0
- package/template/workers/dev-team/project-manager/src/index.ts +54 -0
- package/template/workers/dev-team/project-manager/src/mcp-server.ts +207 -0
- package/template/workers/dev-team/project-manager/src/skills/create-prd.ts +86 -0
- package/template/workers/dev-team/project-manager/src/skills/next-issue.ts +137 -0
- package/template/workers/dev-team/project-manager/src/skills/project-status.ts +131 -0
- package/template/workers/dev-team/project-manager/src/skills/update-learnings.ts +94 -0
- package/template/workers/dev-team/project-manager/tsconfig.json +19 -0
- package/template/workers/dev-team/project-manager/worker.yaml +96 -0
- package/template/workers/dev-team/qa-tester/package.json +24 -0
- package/template/workers/dev-team/qa-tester/skills/create-demo-account.md +36 -0
- package/template/workers/dev-team/qa-tester/skills/run-tests.md +36 -0
- package/template/workers/dev-team/qa-tester/skills/write-test.md +27 -0
- package/template/workers/dev-team/qa-tester/src/index.ts +61 -0
- package/template/workers/dev-team/qa-tester/src/mcp-server.ts +88 -0
- package/template/workers/dev-team/qa-tester/tsconfig.json +18 -0
- package/template/workers/dev-team/qa-tester/worker.yaml +116 -0
- package/template/workers/dev-team/task-executor/package-lock.json +1252 -0
- package/template/workers/dev-team/task-executor/package.json +27 -0
- package/template/workers/dev-team/task-executor/skills/analyze-issue.md +101 -0
- package/template/workers/dev-team/task-executor/skills/execute.md +133 -0
- package/template/workers/dev-team/task-executor/skills/report-learnings.md +106 -0
- package/template/workers/dev-team/task-executor/skills/validate-completion.md +121 -0
- package/template/workers/dev-team/task-executor/src/index.ts +54 -0
- package/template/workers/dev-team/task-executor/src/mcp-server.ts +139 -0
- package/template/workers/dev-team/task-executor/src/skills/analyze-issue.ts +219 -0
- package/template/workers/dev-team/task-executor/src/skills/execute.ts +132 -0
- package/template/workers/dev-team/task-executor/src/skills/report-learnings.ts +119 -0
- package/template/workers/dev-team/task-executor/src/skills/validate-completion.ts +142 -0
- package/template/workers/dev-team/task-executor/tsconfig.json +19 -0
- package/template/workers/dev-team/task-executor/worker.yaml +110 -0
- package/template/workers/registry.yaml +171 -0
- package/template/workers/security-scanner/README.md +73 -0
- package/template/workers/security-scanner/skills/pre-deploy-check.md +205 -0
- package/template/workers/security-scanner/worker.yaml +26 -0
- package/template/workspace/checkpoints/.gitkeep +0 -0
- package/template/workspace/content-ideas/inbox.jsonl +0 -0
- package/template/workspace/drafts/.gitkeep +0 -0
- package/template/workspace/learnings/.gitkeep +3 -0
- package/template/workspace/orchestrator/.gitkeep +0 -0
- package/template/workspace/ralph-test/COMPLETE.md +18 -0
- package/template/workspace/ralph-test/hello.txt +2 -0
- package/template/workspace/reports/.gitkeep +0 -0
- package/template/workspace/scratch/.gitkeep +0 -0
- package/template/workspace/threads/.gitkeep +3 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hq/task-executor",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Execute issues by routing to workers and managing execution loop",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"task-executor": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"typecheck": "tsc --noEmit",
|
|
12
|
+
"dev": "ts-node src/index.ts",
|
|
13
|
+
"mcp": "node dist/mcp-server.js"
|
|
14
|
+
},
|
|
15
|
+
"keywords": ["hq", "worker", "task-executor", "orchestration"],
|
|
16
|
+
"author": "",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
20
|
+
"commander": "^12.1.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^22.10.0",
|
|
24
|
+
"typescript": "^5.7.2",
|
|
25
|
+
"ts-node": "^10.9.2"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# analyze-issue
|
|
2
|
+
|
|
3
|
+
Analyze issue to determine required workers and execution sequence.
|
|
4
|
+
|
|
5
|
+
## Arguments
|
|
6
|
+
|
|
7
|
+
`$ARGUMENTS` = `--issue <id> --project <name>` (required)
|
|
8
|
+
|
|
9
|
+
Optional:
|
|
10
|
+
- `--repo <path>` - Target repository for file analysis
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
1. **Load Issue**
|
|
15
|
+
- Read from PRD or beads
|
|
16
|
+
- Parse title, description, acceptance criteria
|
|
17
|
+
|
|
18
|
+
2. **Check Worker Hints**
|
|
19
|
+
- If `worker_hints` field exists, use as base
|
|
20
|
+
- Validate hints are valid worker IDs
|
|
21
|
+
|
|
22
|
+
3. **Auto-Detect Workers**
|
|
23
|
+
If no hints, analyze based on:
|
|
24
|
+
- Keywords in title/description
|
|
25
|
+
- File patterns in acceptance criteria
|
|
26
|
+
- Project type (frontend/backend/fullstack)
|
|
27
|
+
|
|
28
|
+
4. **Determine Sequence**
|
|
29
|
+
Standard sequences:
|
|
30
|
+
- architect always first (if system design needed)
|
|
31
|
+
- database-dev before backend-dev (if schema changes)
|
|
32
|
+
- backend-dev before frontend-dev (if API needed)
|
|
33
|
+
- qa-tester always last
|
|
34
|
+
- code-reviewer after all dev workers
|
|
35
|
+
|
|
36
|
+
5. **Estimate Scope**
|
|
37
|
+
- Files likely to be modified
|
|
38
|
+
- Complexity score (simple/medium/complex)
|
|
39
|
+
- Estimated phases
|
|
40
|
+
|
|
41
|
+
6. **Present Analysis**
|
|
42
|
+
- Show worker sequence
|
|
43
|
+
- Show reasoning
|
|
44
|
+
- Ask for confirmation
|
|
45
|
+
|
|
46
|
+
## Worker Detection Rules
|
|
47
|
+
|
|
48
|
+
| Pattern | Workers |
|
|
49
|
+
|---------|---------|
|
|
50
|
+
| "API", "endpoint", "route" | backend-dev |
|
|
51
|
+
| "database", "schema", "migration" | database-dev |
|
|
52
|
+
| "component", "UI", "page" | frontend-dev |
|
|
53
|
+
| "animation", "transition", "polish" | motion-designer |
|
|
54
|
+
| "CI/CD", "deploy", "pipeline" | infra-dev |
|
|
55
|
+
| "test", "coverage", "accessibility" | qa-tester |
|
|
56
|
+
| "architecture", "design", "refactor" | architect |
|
|
57
|
+
|
|
58
|
+
## Output
|
|
59
|
+
|
|
60
|
+
Analysis report:
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"issue": "US-003",
|
|
64
|
+
"title": "Implement logout endpoint",
|
|
65
|
+
"workers": ["backend-dev", "qa-tester"],
|
|
66
|
+
"sequence": [
|
|
67
|
+
{"worker": "backend-dev", "phase": "Create logout API endpoint"},
|
|
68
|
+
{"worker": "qa-tester", "phase": "Verify logout functionality"}
|
|
69
|
+
],
|
|
70
|
+
"estimated_files": ["src/api/auth.ts", "src/middleware/session.ts"],
|
|
71
|
+
"complexity": "simple",
|
|
72
|
+
"reasoning": "Detected 'endpoint' keyword, no frontend changes mentioned"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Example
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
node dist/index.js analyze-issue --issue US-003 --project auth-feature
|
|
80
|
+
|
|
81
|
+
# Output:
|
|
82
|
+
# === Analysis: US-003 ===
|
|
83
|
+
#
|
|
84
|
+
# Title: Implement logout endpoint
|
|
85
|
+
#
|
|
86
|
+
# Detected patterns:
|
|
87
|
+
# - "endpoint" → backend-dev
|
|
88
|
+
# - No UI changes → skip frontend-dev
|
|
89
|
+
#
|
|
90
|
+
# Recommended sequence:
|
|
91
|
+
# 1. backend-dev: Create logout API endpoint
|
|
92
|
+
# 2. qa-tester: Verify logout functionality
|
|
93
|
+
#
|
|
94
|
+
# Estimated files:
|
|
95
|
+
# - src/api/auth.ts
|
|
96
|
+
# - src/middleware/session.ts
|
|
97
|
+
#
|
|
98
|
+
# Complexity: simple (2 phases, ~2 files)
|
|
99
|
+
#
|
|
100
|
+
# [Confirm sequence? y/n/modify]
|
|
101
|
+
```
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# execute
|
|
2
|
+
|
|
3
|
+
Execute issue end-to-end: analyze, spawn workers, validate, report learnings.
|
|
4
|
+
|
|
5
|
+
## Arguments
|
|
6
|
+
|
|
7
|
+
`$ARGUMENTS` = `--issue <id> --project <name>` (required)
|
|
8
|
+
|
|
9
|
+
Optional:
|
|
10
|
+
- `--repo <path>` - Target repository path
|
|
11
|
+
- `--skip-validation` - Skip back pressure checks (not recommended)
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
1. **Load Issue**
|
|
16
|
+
- Read issue from PRD or beads
|
|
17
|
+
- Validate issue exists and is not already passing
|
|
18
|
+
|
|
19
|
+
2. **Analyze & Plan**
|
|
20
|
+
- Determine required workers (from hints or auto-detect)
|
|
21
|
+
- Order workers by dependency
|
|
22
|
+
- Estimate scope and files affected
|
|
23
|
+
- Present plan to human for approval
|
|
24
|
+
|
|
25
|
+
3. **For Each Worker Phase**
|
|
26
|
+
```
|
|
27
|
+
a. BEFORE: Show "Spawning {worker} for {description}"
|
|
28
|
+
→ Wait for human: approve / inject context / skip
|
|
29
|
+
|
|
30
|
+
b. EXECUTE: Spawn worker via Claude Task tool
|
|
31
|
+
- Pass focused context (issue spec + relevant files)
|
|
32
|
+
- Worker executes with its own context isolation
|
|
33
|
+
|
|
34
|
+
c. AFTER: Show results
|
|
35
|
+
- Files changed
|
|
36
|
+
- Test results
|
|
37
|
+
- Any warnings or notes
|
|
38
|
+
→ Wait for human: approve / request changes / rollback
|
|
39
|
+
|
|
40
|
+
d. VALIDATE: Run back pressure checks
|
|
41
|
+
- npm run typecheck
|
|
42
|
+
- npm run lint
|
|
43
|
+
- npm run test (if applicable)
|
|
44
|
+
→ If fail: surface error, offer retry or fix
|
|
45
|
+
|
|
46
|
+
e. COMMIT: Create commit for this phase
|
|
47
|
+
→ Human approves commit message
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
4. **On Completion**
|
|
51
|
+
- Mark issue as passing in PRD/beads
|
|
52
|
+
- Extract learnings from execution
|
|
53
|
+
- Format learnings report
|
|
54
|
+
- Return to project-manager
|
|
55
|
+
|
|
56
|
+
5. **On Failure**
|
|
57
|
+
- Log failure point and error
|
|
58
|
+
- Offer options: retry / rollback / escalate
|
|
59
|
+
- Never auto-proceed on ambiguity
|
|
60
|
+
|
|
61
|
+
## Worker Spawn Pattern
|
|
62
|
+
|
|
63
|
+
Using Claude Code's Task tool:
|
|
64
|
+
```typescript
|
|
65
|
+
// Spawn a worker as subagent
|
|
66
|
+
Task({
|
|
67
|
+
description: "Backend dev: implement API endpoint",
|
|
68
|
+
prompt: `
|
|
69
|
+
Execute backend-dev worker for issue ${issueId}
|
|
70
|
+
|
|
71
|
+
Context:
|
|
72
|
+
- Issue: ${issue.title}
|
|
73
|
+
- Acceptance criteria: ${issue.acceptance_criteria}
|
|
74
|
+
- Files to modify: ${files.join(', ')}
|
|
75
|
+
|
|
76
|
+
Instructions:
|
|
77
|
+
1. Read the target files
|
|
78
|
+
2. Implement the required changes
|
|
79
|
+
3. Run typecheck and lint
|
|
80
|
+
4. Report completion with changes made
|
|
81
|
+
`,
|
|
82
|
+
subagent_type: "general-purpose"
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Output
|
|
87
|
+
|
|
88
|
+
Execution report with:
|
|
89
|
+
- Issue status (pass/fail)
|
|
90
|
+
- Phases completed
|
|
91
|
+
- Files changed
|
|
92
|
+
- Validation results
|
|
93
|
+
- Learnings extracted
|
|
94
|
+
- Commit hashes
|
|
95
|
+
|
|
96
|
+
## Example
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
node dist/index.js execute --issue US-003 --project auth-feature --repo repos/private/my-app
|
|
100
|
+
|
|
101
|
+
# Output:
|
|
102
|
+
# === Executing US-003: Implement logout endpoint ===
|
|
103
|
+
#
|
|
104
|
+
# Planned phases:
|
|
105
|
+
# 1. backend-dev: Create logout API endpoint
|
|
106
|
+
# 2. qa-tester: Verify logout functionality
|
|
107
|
+
#
|
|
108
|
+
# [Approve plan? y/n]
|
|
109
|
+
# > y
|
|
110
|
+
#
|
|
111
|
+
# Phase 1: Spawning backend-dev...
|
|
112
|
+
# [Approve? y/inject/skip]
|
|
113
|
+
# > y
|
|
114
|
+
#
|
|
115
|
+
# backend-dev completed:
|
|
116
|
+
# Changed: src/api/auth.ts (+25 lines)
|
|
117
|
+
# Tests: 3 passing
|
|
118
|
+
#
|
|
119
|
+
# [Approve changes? y/n/rollback]
|
|
120
|
+
# > y
|
|
121
|
+
#
|
|
122
|
+
# Validation:
|
|
123
|
+
# ✅ typecheck passed
|
|
124
|
+
# ✅ lint passed
|
|
125
|
+
# ✅ tests passed
|
|
126
|
+
#
|
|
127
|
+
# Phase 2: Spawning qa-tester...
|
|
128
|
+
# ...
|
|
129
|
+
#
|
|
130
|
+
# === Issue US-003 Complete ===
|
|
131
|
+
# Learnings:
|
|
132
|
+
# - [pattern] Session invalidation via Redis DEL command
|
|
133
|
+
```
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# report-learnings
|
|
2
|
+
|
|
3
|
+
Extract and format learnings from task execution.
|
|
4
|
+
|
|
5
|
+
## Arguments
|
|
6
|
+
|
|
7
|
+
`$ARGUMENTS` = execution context (from execute skill)
|
|
8
|
+
|
|
9
|
+
Optional:
|
|
10
|
+
- `--verbose` - Include detailed execution trace
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
1. **Review Execution**
|
|
15
|
+
- Phases completed
|
|
16
|
+
- Errors encountered
|
|
17
|
+
- Retries needed
|
|
18
|
+
- Time per phase
|
|
19
|
+
|
|
20
|
+
2. **Extract Learnings**
|
|
21
|
+
Categories:
|
|
22
|
+
- **Pattern**: Reusable code/design pattern discovered
|
|
23
|
+
- **Troubleshoot**: Error/fix that others may encounter
|
|
24
|
+
- **Workflow**: Worker sequence that worked well
|
|
25
|
+
- **Project**: Context specific to this project
|
|
26
|
+
|
|
27
|
+
3. **Analyze Effectiveness**
|
|
28
|
+
- Did worker sequence work well?
|
|
29
|
+
- Any phases that should be reordered?
|
|
30
|
+
- Context that helped or hurt?
|
|
31
|
+
|
|
32
|
+
4. **Format Report**
|
|
33
|
+
- Structured JSON for project-manager
|
|
34
|
+
- Human-readable summary
|
|
35
|
+
|
|
36
|
+
5. **Surface for Approval**
|
|
37
|
+
- Show extracted learnings
|
|
38
|
+
- Human confirms or edits
|
|
39
|
+
- Ready for update-learnings skill
|
|
40
|
+
|
|
41
|
+
## Learning Extraction Rules
|
|
42
|
+
|
|
43
|
+
| Signal | Learning Type |
|
|
44
|
+
|--------|---------------|
|
|
45
|
+
| New code pattern | pattern |
|
|
46
|
+
| Error + fix | troubleshoot |
|
|
47
|
+
| Sequence worked well | workflow |
|
|
48
|
+
| Project-specific context | project |
|
|
49
|
+
|
|
50
|
+
## Output
|
|
51
|
+
|
|
52
|
+
Learnings report:
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"task": "US-003",
|
|
56
|
+
"project": "auth-feature",
|
|
57
|
+
"execution": {
|
|
58
|
+
"phases": 2,
|
|
59
|
+
"retries": 0,
|
|
60
|
+
"duration": "5m"
|
|
61
|
+
},
|
|
62
|
+
"learnings": [
|
|
63
|
+
{
|
|
64
|
+
"type": "pattern",
|
|
65
|
+
"category": "backend",
|
|
66
|
+
"content": "Session invalidation via Redis DEL command with TTL fallback"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"type": "workflow",
|
|
70
|
+
"content": "For auth endpoints: backend-dev → qa-tester is sufficient, no architect needed"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"recommendations": [
|
|
74
|
+
"Consider adding session tests to smoke-test suite"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Example
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
node dist/index.js report-learnings
|
|
83
|
+
|
|
84
|
+
# Output:
|
|
85
|
+
# === Learnings from US-003 ===
|
|
86
|
+
#
|
|
87
|
+
# Execution summary:
|
|
88
|
+
# - 2 phases completed
|
|
89
|
+
# - 0 retries needed
|
|
90
|
+
# - Duration: 5 minutes
|
|
91
|
+
#
|
|
92
|
+
# Extracted learnings:
|
|
93
|
+
#
|
|
94
|
+
# 1. [pattern/backend]
|
|
95
|
+
# Session invalidation via Redis DEL command with TTL fallback
|
|
96
|
+
# Source: backend-dev phase, src/api/auth.ts:45-52
|
|
97
|
+
#
|
|
98
|
+
# 2. [workflow]
|
|
99
|
+
# For auth endpoints: backend-dev → qa-tester is sufficient
|
|
100
|
+
# Reasoning: No system design needed for simple endpoints
|
|
101
|
+
#
|
|
102
|
+
# Recommendations:
|
|
103
|
+
# - Consider adding session tests to smoke-test suite
|
|
104
|
+
#
|
|
105
|
+
# [Approve learnings? y/n/edit]
|
|
106
|
+
```
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# validate-completion
|
|
2
|
+
|
|
3
|
+
Run back pressure checks on completed work.
|
|
4
|
+
|
|
5
|
+
## Arguments
|
|
6
|
+
|
|
7
|
+
`$ARGUMENTS` = `--repo <path>` (required)
|
|
8
|
+
|
|
9
|
+
Optional:
|
|
10
|
+
- `--checks <list>` - Comma-separated checks to run (default: all)
|
|
11
|
+
- `--strict` - Fail on warnings
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
1. **Run Type Check**
|
|
16
|
+
```bash
|
|
17
|
+
npm run typecheck
|
|
18
|
+
```
|
|
19
|
+
- Must pass with zero errors
|
|
20
|
+
- Warnings logged but don't fail
|
|
21
|
+
|
|
22
|
+
2. **Run Linter**
|
|
23
|
+
```bash
|
|
24
|
+
npm run lint
|
|
25
|
+
```
|
|
26
|
+
- Must pass with zero errors
|
|
27
|
+
- Auto-fix if possible
|
|
28
|
+
|
|
29
|
+
3. **Run Tests**
|
|
30
|
+
```bash
|
|
31
|
+
npm test
|
|
32
|
+
```
|
|
33
|
+
- All tests must pass
|
|
34
|
+
- New code should have coverage
|
|
35
|
+
|
|
36
|
+
4. **Run Build** (if applicable)
|
|
37
|
+
```bash
|
|
38
|
+
npm run build
|
|
39
|
+
```
|
|
40
|
+
- Build must succeed
|
|
41
|
+
- No runtime errors
|
|
42
|
+
|
|
43
|
+
5. **E2E Manifest Check** (if project has E2E tests)
|
|
44
|
+
Skip if the repo does not have an E2E test infrastructure.
|
|
45
|
+
```bash
|
|
46
|
+
npm run check-coverage
|
|
47
|
+
```
|
|
48
|
+
- All app routes must have test coverage in manifest
|
|
49
|
+
- Exit code 1 = uncovered pages exist
|
|
50
|
+
```bash
|
|
51
|
+
npm run generate-manifest && git diff --quiet tests/e2e/manifest.json
|
|
52
|
+
```
|
|
53
|
+
- If diff is non-empty, manifest is stale
|
|
54
|
+
- Fail with: "Run `npm run generate-manifest` and commit the updated manifest"
|
|
55
|
+
|
|
56
|
+
6. **Report Results**
|
|
57
|
+
- Show pass/fail for each check
|
|
58
|
+
- Surface errors clearly
|
|
59
|
+
- Suggest fixes if possible
|
|
60
|
+
|
|
61
|
+
## Checks
|
|
62
|
+
|
|
63
|
+
| Check | Command | Required |
|
|
64
|
+
|-------|---------|----------|
|
|
65
|
+
| typecheck | npm run typecheck | Yes |
|
|
66
|
+
| lint | npm run lint | Yes |
|
|
67
|
+
| test | npm test | Yes (if tests exist) |
|
|
68
|
+
| build | npm run build | No (optional) |
|
|
69
|
+
| e2e-manifest | npm run check-coverage + generate-manifest drift | Yes (if E2E tests exist) |
|
|
70
|
+
|
|
71
|
+
## Output
|
|
72
|
+
|
|
73
|
+
Validation report:
|
|
74
|
+
```
|
|
75
|
+
Validation Results:
|
|
76
|
+
typecheck: passed (0 errors)
|
|
77
|
+
lint: passed (0 errors, 2 warnings)
|
|
78
|
+
test: passed (45 tests, 100% passing)
|
|
79
|
+
build: skipped
|
|
80
|
+
e2e-manifest: passed (all pages covered, manifest fresh)
|
|
81
|
+
|
|
82
|
+
Overall: PASS
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or on failure:
|
|
86
|
+
```
|
|
87
|
+
Validation Results:
|
|
88
|
+
typecheck: passed
|
|
89
|
+
lint: failed (3 errors)
|
|
90
|
+
- src/api/auth.ts:42 - Unexpected any
|
|
91
|
+
- src/api/auth.ts:58 - Missing return type
|
|
92
|
+
- src/api/auth.ts:72 - Unused variable 'temp'
|
|
93
|
+
test: skipped (lint failed)
|
|
94
|
+
|
|
95
|
+
Overall: FAIL
|
|
96
|
+
Suggestion: Fix lint errors, then re-run
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Example
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
node dist/index.js validate-completion --repo ~/repos/my-app
|
|
103
|
+
|
|
104
|
+
# Output:
|
|
105
|
+
# Running validation checks...
|
|
106
|
+
#
|
|
107
|
+
# [1/3] typecheck...
|
|
108
|
+
# passed (0 errors)
|
|
109
|
+
#
|
|
110
|
+
# [2/3] lint...
|
|
111
|
+
# passed (0 errors, 2 warnings)
|
|
112
|
+
# Warnings:
|
|
113
|
+
# - src/api/auth.ts:42 - Consider using explicit type
|
|
114
|
+
# - src/api/auth.ts:58 - Prefer const over let
|
|
115
|
+
#
|
|
116
|
+
# [3/3] test...
|
|
117
|
+
# passed (45 tests)
|
|
118
|
+
#
|
|
119
|
+
# Overall: PASS
|
|
120
|
+
# Ready to commit.
|
|
121
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { execute } from './skills/execute';
|
|
4
|
+
import { analyzeIssue } from './skills/analyze-issue';
|
|
5
|
+
import { validateCompletion } from './skills/validate-completion';
|
|
6
|
+
import { reportLearnings } from './skills/report-learnings';
|
|
7
|
+
|
|
8
|
+
const program = new Command();
|
|
9
|
+
|
|
10
|
+
program
|
|
11
|
+
.name('task-executor')
|
|
12
|
+
.description('Execute issues by routing to workers and managing execution loop')
|
|
13
|
+
.version('1.0.0');
|
|
14
|
+
|
|
15
|
+
program
|
|
16
|
+
.command('execute')
|
|
17
|
+
.description('Execute issue end-to-end: analyze, spawn workers, validate, report')
|
|
18
|
+
.requiredOption('--issue <id>', 'Issue ID')
|
|
19
|
+
.requiredOption('--project <name>', 'Project name')
|
|
20
|
+
.option('--repo <path>', 'Target repository path')
|
|
21
|
+
.option('--skip-validation', 'Skip back pressure checks')
|
|
22
|
+
.action(async (options) => {
|
|
23
|
+
await execute(options);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
program
|
|
27
|
+
.command('analyze-issue')
|
|
28
|
+
.description('Analyze issue to determine worker sequence')
|
|
29
|
+
.requiredOption('--issue <id>', 'Issue ID')
|
|
30
|
+
.requiredOption('--project <name>', 'Project name')
|
|
31
|
+
.option('--repo <path>', 'Target repository for file analysis')
|
|
32
|
+
.action(async (options) => {
|
|
33
|
+
await analyzeIssue(options);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
program
|
|
37
|
+
.command('validate-completion')
|
|
38
|
+
.description('Run back pressure checks on completed work')
|
|
39
|
+
.requiredOption('--repo <path>', 'Repository path')
|
|
40
|
+
.option('--checks <list>', 'Comma-separated checks to run')
|
|
41
|
+
.option('--strict', 'Fail on warnings')
|
|
42
|
+
.action(async (options) => {
|
|
43
|
+
await validateCompletion(options);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
program
|
|
47
|
+
.command('report-learnings')
|
|
48
|
+
.description('Extract and format learnings from execution')
|
|
49
|
+
.option('--verbose', 'Include detailed execution trace')
|
|
50
|
+
.action(async (options) => {
|
|
51
|
+
await reportLearnings(options);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
program.parse();
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import {
|
|
5
|
+
CallToolRequestSchema,
|
|
6
|
+
ListToolsRequestSchema,
|
|
7
|
+
} from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
+
|
|
9
|
+
const server = new Server(
|
|
10
|
+
{
|
|
11
|
+
name: 'task-executor',
|
|
12
|
+
version: '1.0.0',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
capabilities: {
|
|
16
|
+
tools: {},
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
22
|
+
return {
|
|
23
|
+
tools: [
|
|
24
|
+
{
|
|
25
|
+
name: 'execute',
|
|
26
|
+
description: 'Execute issue end-to-end: analyze, spawn workers, validate, report',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
issue: { type: 'string', description: 'Issue ID' },
|
|
31
|
+
project: { type: 'string', description: 'Project name' },
|
|
32
|
+
repo: { type: 'string', description: 'Target repository path' },
|
|
33
|
+
skipValidation: { type: 'boolean', description: 'Skip back pressure checks' },
|
|
34
|
+
},
|
|
35
|
+
required: ['issue', 'project'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'analyze_issue',
|
|
40
|
+
description: 'Analyze issue to determine worker sequence',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
issue: { type: 'string', description: 'Issue ID' },
|
|
45
|
+
project: { type: 'string', description: 'Project name' },
|
|
46
|
+
repo: { type: 'string', description: 'Target repository for file analysis' },
|
|
47
|
+
},
|
|
48
|
+
required: ['issue', 'project'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'validate_completion',
|
|
53
|
+
description: 'Run back pressure checks on completed work',
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
repo: { type: 'string', description: 'Repository path' },
|
|
58
|
+
checks: { type: 'string', description: 'Comma-separated checks to run' },
|
|
59
|
+
strict: { type: 'boolean', description: 'Fail on warnings' },
|
|
60
|
+
},
|
|
61
|
+
required: ['repo'],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'report_learnings',
|
|
66
|
+
description: 'Extract and format learnings from execution',
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
verbose: { type: 'boolean', description: 'Include detailed execution trace' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
79
|
+
const { name, arguments: args } = request.params;
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
switch (name) {
|
|
83
|
+
case 'execute': {
|
|
84
|
+
const { execute } = await import('./skills/execute');
|
|
85
|
+
const result = await captureOutput(() => execute(args as any));
|
|
86
|
+
return { content: [{ type: 'text', text: result }] };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
case 'analyze_issue': {
|
|
90
|
+
const { analyzeIssue } = await import('./skills/analyze-issue');
|
|
91
|
+
const result = await captureOutput(() => analyzeIssue(args as any));
|
|
92
|
+
return { content: [{ type: 'text', text: result }] };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
case 'validate_completion': {
|
|
96
|
+
const { validateCompletion } = await import('./skills/validate-completion');
|
|
97
|
+
const result = await captureOutput(() => validateCompletion(args as any));
|
|
98
|
+
return { content: [{ type: 'text', text: result }] };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
case 'report_learnings': {
|
|
102
|
+
const { reportLearnings } = await import('./skills/report-learnings');
|
|
103
|
+
const result = await captureOutput(() => reportLearnings(args as any));
|
|
104
|
+
return { content: [{ type: 'text', text: result }] };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
default:
|
|
108
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
109
|
+
}
|
|
110
|
+
} catch (error) {
|
|
111
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
112
|
+
return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
async function captureOutput(fn: () => Promise<any>): Promise<string> {
|
|
117
|
+
const logs: string[] = [];
|
|
118
|
+
const originalLog = console.log;
|
|
119
|
+
const originalError = console.error;
|
|
120
|
+
|
|
121
|
+
console.log = (...args) => logs.push(args.join(' '));
|
|
122
|
+
console.error = (...args) => logs.push(`ERROR: ${args.join(' ')}`);
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
await fn();
|
|
126
|
+
} finally {
|
|
127
|
+
console.log = originalLog;
|
|
128
|
+
console.error = originalError;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return logs.join('\n');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function main() {
|
|
135
|
+
const transport = new StdioServerTransport();
|
|
136
|
+
await server.connect(transport);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
main().catch(console.error);
|