swarm-orchestrator 7.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +199 -0
  3. package/agents/reviewer.agent.md +50 -0
  4. package/agents/worker.agent.md +41 -0
  5. package/config/default-agents.yaml +56 -0
  6. package/config/pm-agent.yaml +36 -0
  7. package/config/quality-gates.yaml +88 -0
  8. package/config/repair-agent.yaml +34 -0
  9. package/config/semgrep-rules/complexity-mismatch.yaml +6 -0
  10. package/config/semgrep-rules/exception-swallowing.yaml +13 -0
  11. package/config/semgrep-rules/hardcoded-answer.yaml +6 -0
  12. package/config/semgrep-rules/mock-mutation.yaml +6 -0
  13. package/config/semgrep-rules/test-modification.yaml +6 -0
  14. package/config/user-agents.yaml +23 -0
  15. package/dist/src/adapters/adapter-factory.js +29 -0
  16. package/dist/src/adapters/agent-adapter.js +32 -0
  17. package/dist/src/adapters/claude-code-adapter.js +126 -0
  18. package/dist/src/adapters/claude-code-teams.js +119 -0
  19. package/dist/src/adapters/codex-adapter.js +118 -0
  20. package/dist/src/adapters/copilot-adapter.js +224 -0
  21. package/dist/src/adapters/fatal-error-classifier.js +88 -0
  22. package/dist/src/adapters/index.js +44 -0
  23. package/dist/src/adapters/persistent-session.js +204 -0
  24. package/dist/src/adapters/process-supervisor.js +199 -0
  25. package/dist/src/agents-exporter.js +398 -0
  26. package/dist/src/analytics-log.js +161 -0
  27. package/dist/src/baseline-scanner.js +65 -0
  28. package/dist/src/bootstrap-evidence.js +88 -0
  29. package/dist/src/bootstrap-orchestrator.js +205 -0
  30. package/dist/src/bootstrap-types.js +5 -0
  31. package/dist/src/branch-merger.js +427 -0
  32. package/dist/src/cli/attest-handlers.js +44 -0
  33. package/dist/src/cli/cost-prompt.js +51 -0
  34. package/dist/src/cli/demo-handlers.js +274 -0
  35. package/dist/src/cli/flags.js +152 -0
  36. package/dist/src/cli/index.js +57 -0
  37. package/dist/src/cli/live-status.js +186 -0
  38. package/dist/src/cli/misc-handlers.js +242 -0
  39. package/dist/src/cli/plan-handlers.js +350 -0
  40. package/dist/src/cli/share-handlers.js +163 -0
  41. package/dist/src/cli/status-handlers.js +457 -0
  42. package/dist/src/cli/swarm-handlers.js +638 -0
  43. package/dist/src/cli/usage.js +72 -0
  44. package/dist/src/cli.js +217 -0
  45. package/dist/src/commit-pattern-detector.js +143 -0
  46. package/dist/src/commit-quality-analyzer.js +38 -0
  47. package/dist/src/config-loader.js +339 -0
  48. package/dist/src/context-broker.js +358 -0
  49. package/dist/src/copilot-cli-wrapper.js +258 -0
  50. package/dist/src/cost-estimator.js +241 -0
  51. package/dist/src/defaults.js +18 -0
  52. package/dist/src/demo-mode.js +180 -0
  53. package/dist/src/deployment-handler.js +78 -0
  54. package/dist/src/deployment-manager.js +228 -0
  55. package/dist/src/execution-queue.js +196 -0
  56. package/dist/src/external-tool-manager.js +184 -0
  57. package/dist/src/gate-prompt-builder.js +117 -0
  58. package/dist/src/gate-remediation.js +173 -0
  59. package/dist/src/github-issues-ingester.js +152 -0
  60. package/dist/src/github-mcp-integrator.js +164 -0
  61. package/dist/src/hook-generator.js +229 -0
  62. package/dist/src/index.js +48 -0
  63. package/dist/src/knowledge-base.js +300 -0
  64. package/dist/src/logger.js +111 -0
  65. package/dist/src/meta-analyzer.js +208 -0
  66. package/dist/src/metrics-collector.js +209 -0
  67. package/dist/src/metrics-types.js +5 -0
  68. package/dist/src/multi-repo-coordinator.js +179 -0
  69. package/dist/src/orchestrator/async-meta-analysis.js +84 -0
  70. package/dist/src/orchestrator/fatal-run-error.js +43 -0
  71. package/dist/src/orchestrator/final-gates-remediation.js +258 -0
  72. package/dist/src/orchestrator/git-state-utils.js +119 -0
  73. package/dist/src/orchestrator/pause-controller.js +55 -0
  74. package/dist/src/orchestrator/replan-runner.js +258 -0
  75. package/dist/src/orchestrator/step-executor.js +391 -0
  76. package/dist/src/orchestrator/wave-scheduler-loop.js +204 -0
  77. package/dist/src/owasp-mapper.js +153 -0
  78. package/dist/src/owasp-report-renderer.js +39 -0
  79. package/dist/src/plan-files.js +142 -0
  80. package/dist/src/plan-generator.js +1207 -0
  81. package/dist/src/pm-agent.js +296 -0
  82. package/dist/src/post-run-reporter.js +203 -0
  83. package/dist/src/pr-automation.js +103 -0
  84. package/dist/src/pr-manager.js +318 -0
  85. package/dist/src/presenter/index.js +209 -0
  86. package/dist/src/prompt-builder.js +173 -0
  87. package/dist/src/quality-gates/config-loader.js +196 -0
  88. package/dist/src/quality-gates/default-config.js +243 -0
  89. package/dist/src/quality-gates/file-utils.js +152 -0
  90. package/dist/src/quality-gates/gate-runner.js +171 -0
  91. package/dist/src/quality-gates/gates/accessibility.js +355 -0
  92. package/dist/src/quality-gates/gates/duplicate-blocks.js +144 -0
  93. package/dist/src/quality-gates/gates/hardcoded-config.js +52 -0
  94. package/dist/src/quality-gates/gates/readme-claims.js +62 -0
  95. package/dist/src/quality-gates/gates/runtime-checks.js +265 -0
  96. package/dist/src/quality-gates/gates/scaffold-defaults.js +108 -0
  97. package/dist/src/quality-gates/gates/test-coverage.js +240 -0
  98. package/dist/src/quality-gates/gates/test-file-protection.js +85 -0
  99. package/dist/src/quality-gates/gates/test-isolation.js +74 -0
  100. package/dist/src/quality-gates/index.js +17 -0
  101. package/dist/src/quality-gates/registry.js +205 -0
  102. package/dist/src/quality-gates/types.js +2 -0
  103. package/dist/src/quick-fix-mode.js +302 -0
  104. package/dist/src/recipe-loader.js +122 -0
  105. package/dist/src/repair-agent.js +396 -0
  106. package/dist/src/repo-analyzer.js +342 -0
  107. package/dist/src/report-generator.js +146 -0
  108. package/dist/src/report-renderer.js +90 -0
  109. package/dist/src/requirement-filter.js +52 -0
  110. package/dist/src/sarif-formatter.js +140 -0
  111. package/dist/src/scheduling/dependency-analyzer.js +178 -0
  112. package/dist/src/scheduling/work-stealing-queue.js +123 -0
  113. package/dist/src/secret-redactor.js +90 -0
  114. package/dist/src/session-executor.js +587 -0
  115. package/dist/src/session-manager.js +221 -0
  116. package/dist/src/share/transcript-verification.js +128 -0
  117. package/dist/src/share-parser.js +477 -0
  118. package/dist/src/spinner.js +146 -0
  119. package/dist/src/step-runner.js +365 -0
  120. package/dist/src/swarm-orchestrator.js +686 -0
  121. package/dist/src/task-classifier.js +134 -0
  122. package/dist/src/test-command-discovery.js +123 -0
  123. package/dist/src/text-similarity.js +24 -0
  124. package/dist/src/tier-maps.js +158 -0
  125. package/dist/src/types.js +5 -0
  126. package/dist/src/url-shortener.js +135 -0
  127. package/dist/src/verification/attestation.js +166 -0
  128. package/dist/src/verification/cheat-detector.js +240 -0
  129. package/dist/src/verification/command-runner.js +70 -0
  130. package/dist/src/verification/composite-score.js +157 -0
  131. package/dist/src/verification/cosign-attestation.js +137 -0
  132. package/dist/src/verification/diff-analysis.js +89 -0
  133. package/dist/src/verification/differential-gate.js +173 -0
  134. package/dist/src/verification/index.js +41 -0
  135. package/dist/src/verification/mutation-gate.js +242 -0
  136. package/dist/src/verification/property-gate.js +201 -0
  137. package/dist/src/verification/test-synthesizer.js +243 -0
  138. package/dist/src/verifier/outcome-checks.js +396 -0
  139. package/dist/src/verifier/transcript-checks.js +207 -0
  140. package/dist/src/verifier/verification-reporters.js +148 -0
  141. package/dist/src/verifier-engine.js +491 -0
  142. package/dist/src/wave-resizer.js +131 -0
  143. package/dist/src/wave-scheduler.js +44 -0
  144. package/dist/src/worktree-manager.js +368 -0
  145. package/dist/src/worktree-reserved-paths.js +97 -0
  146. package/package.json +80 -0
  147. package/plugin/agents/.gitkeep +0 -0
  148. package/plugin/agents/backend_master.agent.md +72 -0
  149. package/plugin/agents/devops_pro.agent.md +45 -0
  150. package/plugin/agents/frontend_expert.agent.md +59 -0
  151. package/plugin/agents/integrator_finalizer.agent.md +44 -0
  152. package/plugin/agents/meta_reviewer.agent.md +44 -0
  153. package/plugin/agents/security_auditor.agent.md +43 -0
  154. package/plugin/agents/tester_elite.agent.md +43 -0
  155. package/plugin/hooks/hooks.json +19 -0
  156. package/plugin/hooks/post-tool-use.json +9 -0
  157. package/plugin/hooks/pre-tool-use.json +9 -0
  158. package/plugin/plugin.json +47 -0
  159. package/plugin/skills/swarm-gates/SKILL.md +53 -0
  160. package/plugin/skills/swarm-orchestrate/SKILL.md +34 -0
  161. package/plugin/skills/swarm-verify/SKILL.md +44 -0
  162. package/templates/README.md +35 -0
  163. package/templates/cli-tool.json +31 -0
  164. package/templates/fullstack.json +52 -0
  165. package/templates/library.json +38 -0
  166. package/templates/react-app.json +45 -0
  167. package/templates/recipes/add-api-docs.json +35 -0
  168. package/templates/recipes/add-auth.json +47 -0
  169. package/templates/recipes/add-ci.json +39 -0
  170. package/templates/recipes/add-tests.json +39 -0
  171. package/templates/recipes/migrate-to-ts.json +42 -0
  172. package/templates/recipes/refactor-modularize.json +44 -0
  173. package/templates/recipes/security-audit.json +35 -0
  174. package/templates/rest-api.json +38 -0
@@ -0,0 +1,35 @@
1
+ # Plan Templates
2
+
3
+ Ready-made plan files for common project types. Copy a template and customize it
4
+ for your project, or use them as-is with `swarm swarm <template>.json`.
5
+
6
+ | Template | Steps | Agents Used | Estimated Time |
7
+ |----------|-------|-------------|----------------|
8
+ | [rest-api](rest-api.json) | 4 | worker, reviewer | 8-12 min |
9
+ | [react-app](react-app.json) | 5 | worker, reviewer | 10-15 min |
10
+ | [cli-tool](cli-tool.json) | 3 | worker, reviewer | 6-10 min |
11
+ | [fullstack](fullstack.json) | 6 | worker, reviewer | 15-20 min |
12
+ | [library](library.json) | 4 | worker, reviewer | 8-12 min |
13
+
14
+ ## Usage
15
+
16
+ ```bash
17
+ # Copy a template to your plans directory
18
+ cp templates/rest-api.json plans/my-api.json
19
+
20
+ # Edit the goal and tasks to fit your project
21
+ # Then execute:
22
+ swarm swarm plans/my-api.json
23
+
24
+ # Or run directly (uses the template as-is):
25
+ swarm swarm templates/rest-api.json
26
+ ```
27
+
28
+ ## Customization
29
+
30
+ Each template is a standard plan JSON file. You can:
31
+ - Change the `goal` field to describe your specific project
32
+ - Edit step `task` descriptions to match your requirements
33
+ - Add or remove steps
34
+ - Change agent assignments
35
+ - Adjust dependencies between steps
@@ -0,0 +1,31 @@
1
+ {
2
+ "goal": "Build a CLI tool with argument parsing, commands, and tests",
3
+ "createdAt": "2025-01-01T00:00:00.000Z",
4
+ "steps": [
5
+ {
6
+ "stepNumber": 1,
7
+ "agentName": "worker",
8
+ "task": "Create a Node.js CLI tool: (1) Use commander or yargs for argument parsing, (2) At least 2 subcommands with options, (3) Colored output using chalk, (4) Error handling with helpful messages, (5) Add bin entry in package.json, (6) TypeScript with strict mode.",
9
+ "dependencies": [],
10
+ "expectedOutputs": ["CLI entry point", "command handlers", "package.json with bin entry"]
11
+ },
12
+ {
13
+ "stepNumber": 2,
14
+ "agentName": "worker",
15
+ "task": "Write tests for the CLI tool: (1) Unit tests for each command handler, (2) Integration tests that spawn the CLI process and check stdout, (3) Test error cases (missing args, invalid input), (4) Ensure all tests pass.",
16
+ "dependencies": [1],
17
+ "expectedOutputs": ["test files", "test results"]
18
+ },
19
+ {
20
+ "stepNumber": 3,
21
+ "agentName": "reviewer",
22
+ "task": "Finalize the CLI tool: (1) Verify --help output is clear and complete, (2) Write README with installation and usage examples, (3) Add CHANGELOG.md, (4) Ensure npm link works for local testing, (5) All tests pass.",
23
+ "dependencies": [2],
24
+ "expectedOutputs": ["README.md", "CHANGELOG.md", "Working CLI"]
25
+ }
26
+ ],
27
+ "metadata": {
28
+ "totalSteps": 3,
29
+ "estimatedDuration": "6-10 minutes"
30
+ }
31
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "goal": "Build a full-stack web application with frontend, backend, auth, security review, CI/CD, and integration",
3
+ "createdAt": "2025-01-01T00:00:00.000Z",
4
+ "steps": [
5
+ {
6
+ "stepNumber": 1,
7
+ "agentName": "worker",
8
+ "task": "Create backend API: (1) Express + TypeScript server, (2) JWT authentication with register/login/logout, (3) CRUD endpoints for the main resource, (4) Input validation and sanitization, (5) CORS configured for frontend origin, (6) Clear API documentation in code comments.",
9
+ "dependencies": [],
10
+ "expectedOutputs": ["server.ts", "routes", "auth middleware", "package.json"]
11
+ },
12
+ {
13
+ "stepNumber": 2,
14
+ "agentName": "worker",
15
+ "task": "Build frontend: (1) React + TypeScript with Vite, (2) Auth pages (login/register), (3) Main CRUD interface, (4) API integration via fetch (not local-only state), (5) Loading and error states, (6) Vite proxy for /api routes.",
16
+ "dependencies": [1],
17
+ "expectedOutputs": ["React components", "vite.config.ts", "API hooks"]
18
+ },
19
+ {
20
+ "stepNumber": 3,
21
+ "agentName": "worker",
22
+ "task": "Write comprehensive tests: (1) Backend unit + integration tests, (2) Frontend component tests, (3) Auth flow integration test, (4) All tests pass.",
23
+ "dependencies": [1, 2],
24
+ "expectedOutputs": ["test files", "test results"]
25
+ },
26
+ {
27
+ "stepNumber": 4,
28
+ "agentName": "reviewer",
29
+ "task": "Security review: (1) Check for injection vulnerabilities, (2) Review JWT implementation, (3) Check dependency vulnerabilities with npm audit, (4) Review CORS configuration, (5) Document findings and fixes.",
30
+ "dependencies": [1, 2],
31
+ "expectedOutputs": ["security report", "security fixes committed"]
32
+ },
33
+ {
34
+ "stepNumber": 5,
35
+ "agentName": "worker",
36
+ "task": "CI/CD and deployment: (1) GitHub Actions workflow for lint + test + build, (2) Dockerfile for production, (3) docker-compose.yml for local development, (4) Environment variable documentation.",
37
+ "dependencies": [1],
38
+ "expectedOutputs": ["CI workflow", "Dockerfile", "docker-compose.yml", ".env.example"]
39
+ },
40
+ {
41
+ "stepNumber": 6,
42
+ "agentName": "reviewer",
43
+ "task": "Final integration: (1) Verify full end-to-end flow (register, login, CRUD), (2) Fix any field name mismatches, (3) Ensure all tests pass after security fixes, (4) Write comprehensive README, (5) Add Troubleshooting section.",
44
+ "dependencies": [3, 4, 5],
45
+ "expectedOutputs": ["README.md", "Working full-stack app", "Clean git history"]
46
+ }
47
+ ],
48
+ "metadata": {
49
+ "totalSteps": 6,
50
+ "estimatedDuration": "15-20 minutes"
51
+ }
52
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "goal": "Build a reusable library with TypeScript, comprehensive tests, and npm publishing configuration",
3
+ "createdAt": "2025-01-01T00:00:00.000Z",
4
+ "steps": [
5
+ {
6
+ "stepNumber": 1,
7
+ "agentName": "worker",
8
+ "task": "Create library core: (1) TypeScript with strict mode, (2) Dual CJS/ESM output configuration, (3) At least 3 exported functions/classes implementing the core functionality, (4) JSDoc comments on all exports, (5) types.d.ts generation, (6) package.json with proper main/module/types fields.",
9
+ "dependencies": [],
10
+ "expectedOutputs": ["src/ with library code", "tsconfig.json", "package.json"]
11
+ },
12
+ {
13
+ "stepNumber": 2,
14
+ "agentName": "worker",
15
+ "task": "Write comprehensive tests: (1) Unit tests for every exported function/class, (2) Edge case tests (null input, empty arrays, boundary values), (3) Type safety tests if applicable, (4) Code coverage setup and reporting, (5) All tests pass with good coverage.",
16
+ "dependencies": [1],
17
+ "expectedOutputs": ["test files", "coverage report", "test results"]
18
+ },
19
+ {
20
+ "stepNumber": 3,
21
+ "agentName": "worker",
22
+ "task": "Publishing and CI setup: (1) GitHub Actions for CI (lint, test, build on PR), (2) GitHub Actions for npm publish on release tag, (3) .npmignore or files field in package.json, (4) Semantic versioning setup, (5) Do not modify library code.",
23
+ "dependencies": [1],
24
+ "expectedOutputs": ["CI workflows", ".npmignore or files config"]
25
+ },
26
+ {
27
+ "stepNumber": 4,
28
+ "agentName": "reviewer",
29
+ "task": "Finalize: (1) README with installation, API reference, and usage examples, (2) CHANGELOG.md, (3) Verify CJS and ESM imports both work, (4) All tests pass, (5) npm pack succeeds and includes only intended files.",
30
+ "dependencies": [2, 3],
31
+ "expectedOutputs": ["README.md", "CHANGELOG.md", "Working library package"]
32
+ }
33
+ ],
34
+ "metadata": {
35
+ "totalSteps": 4,
36
+ "estimatedDuration": "8-12 minutes"
37
+ }
38
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "goal": "Build a React application with component library, state management, and tests",
3
+ "createdAt": "2025-01-01T00:00:00.000Z",
4
+ "steps": [
5
+ {
6
+ "stepNumber": 1,
7
+ "agentName": "worker",
8
+ "task": "Create a backend API server for the React app: (1) Express server with REST endpoints for the main data model, (2) In-memory or file-based storage, (3) CORS enabled for localhost:5173, (4) Input validation. Document API field names clearly for frontend consistency.",
9
+ "dependencies": [],
10
+ "expectedOutputs": ["server.ts or server.js", "API endpoints", "package.json"]
11
+ },
12
+ {
13
+ "stepNumber": 2,
14
+ "agentName": "worker",
15
+ "task": "Build the React frontend: (1) Create Vite + React + TypeScript project if not exists, (2) Component hierarchy with at least 3 components, (3) State management (useState/useReducer or Zustand), (4) API integration using fetch to call backend endpoints, (5) Loading states and error handling, (6) Configure Vite proxy for /api routes.",
16
+ "dependencies": [1],
17
+ "expectedOutputs": ["React components", "vite.config.ts", "API integration code"]
18
+ },
19
+ {
20
+ "stepNumber": 3,
21
+ "agentName": "worker",
22
+ "task": "Write tests: (1) Unit tests for React components using Vitest + React Testing Library, (2) At least one integration test that verifies frontend calls backend API, (3) Test error states and loading states. Use the same field names as the backend API.",
23
+ "dependencies": [1, 2],
24
+ "expectedOutputs": ["test files", "test results"]
25
+ },
26
+ {
27
+ "stepNumber": 4,
28
+ "agentName": "worker",
29
+ "task": "Set up build and deployment: (1) GitHub Actions CI workflow, (2) Production build configuration, (3) Add scripts to package.json for dev, build, test, and start. Do not modify application logic.",
30
+ "dependencies": [1, 2],
31
+ "expectedOutputs": [".github/workflows/ci.yml", "build scripts"]
32
+ },
33
+ {
34
+ "stepNumber": 5,
35
+ "agentName": "reviewer",
36
+ "task": "Final integration: (1) Verify frontend actually calls backend API (not just local state), (2) Fix any field name mismatches between frontend and backend, (3) Ensure all tests pass, (4) Write README with setup instructions, (5) Add Troubleshooting section to README.",
37
+ "dependencies": [3, 4],
38
+ "expectedOutputs": ["README.md", "All tests passing", "Working full-stack app"]
39
+ }
40
+ ],
41
+ "metadata": {
42
+ "totalSteps": 5,
43
+ "estimatedDuration": "10-15 minutes"
44
+ }
45
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "add-api-docs",
3
+ "description": "Generate OpenAPI spec and API documentation",
4
+ "category": "documentation",
5
+ "parameters": {
6
+ "format": {
7
+ "description": "Documentation output format",
8
+ "default": "openapi",
9
+ "options": ["openapi", "markdown"]
10
+ }
11
+ },
12
+ "steps": [
13
+ {
14
+ "stepNumber": 1,
15
+ "agentName": "worker",
16
+ "task": "Analyze all API routes and generate an OpenAPI 3.0 specification (openapi.yaml). Include: all endpoints with methods, request/response schemas, authentication requirements, and example values. If format is 'markdown', also produce a Markdown version.",
17
+ "dependencies": [],
18
+ "expectedOutputs": ["openapi.yaml"]
19
+ },
20
+ {
21
+ "stepNumber": 2,
22
+ "agentName": "worker",
23
+ "task": "Add JSDoc or inline documentation comments to all route handlers and middleware. Each handler should document its purpose, parameters, request body shape, and response codes.",
24
+ "dependencies": [],
25
+ "expectedOutputs": ["documented route handlers"]
26
+ },
27
+ {
28
+ "stepNumber": 3,
29
+ "agentName": "reviewer",
30
+ "task": "Validate the OpenAPI spec is syntactically correct. Cross-check that every route in the codebase has a corresponding spec entry. Update README with a link to the API docs and instructions for viewing them.",
31
+ "dependencies": [1, 2],
32
+ "expectedOutputs": ["validated openapi.yaml", "updated README"]
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "add-auth",
3
+ "description": "Add authentication (JWT or session-based) to an existing app",
4
+ "category": "feature",
5
+ "parameters": {
6
+ "auth-type": {
7
+ "description": "Authentication strategy",
8
+ "default": "jwt",
9
+ "options": ["jwt", "session"]
10
+ },
11
+ "provider": {
12
+ "description": "OAuth provider to integrate (or none for local-only auth)",
13
+ "default": "none",
14
+ "options": ["none", "github", "google"]
15
+ }
16
+ },
17
+ "steps": [
18
+ {
19
+ "stepNumber": 1,
20
+ "agentName": "worker",
21
+ "task": "Add user registration and login endpoints using {{auth-type}} authentication. Create user model/schema, password hashing with bcrypt, and token generation. If provider is not 'none', add OAuth flow for {{provider}}.",
22
+ "dependencies": [],
23
+ "expectedOutputs": ["auth routes", "user model", "auth middleware"]
24
+ },
25
+ {
26
+ "stepNumber": 2,
27
+ "agentName": "worker",
28
+ "task": "Add auth middleware that protects existing routes. Add role-based access control if the app has admin functionality. Ensure unauthenticated requests return 401.",
29
+ "dependencies": [1],
30
+ "expectedOutputs": ["auth middleware applied to routes", "401 responses for unauthenticated requests"]
31
+ },
32
+ {
33
+ "stepNumber": 3,
34
+ "agentName": "worker",
35
+ "task": "Write tests for authentication: registration, login, token validation, protected route access (valid token, expired token, no token), and logout if applicable. All tests must pass.",
36
+ "dependencies": [2],
37
+ "expectedOutputs": ["auth test files", "all tests passing"]
38
+ },
39
+ {
40
+ "stepNumber": 4,
41
+ "agentName": "reviewer",
42
+ "task": "Verify end-to-end auth flow works. Create .env.example with required auth environment variables. Update README with authentication setup instructions and API endpoint documentation.",
43
+ "dependencies": [3],
44
+ "expectedOutputs": [".env.example", "updated README"]
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "add-ci",
3
+ "description": "Add GitHub Actions CI pipeline with lint, test, and build",
4
+ "category": "devops",
5
+ "parameters": {
6
+ "node-version": {
7
+ "description": "Node.js version for the CI runner",
8
+ "default": "20"
9
+ },
10
+ "package-manager": {
11
+ "description": "Package manager used by the project",
12
+ "default": "npm",
13
+ "options": ["npm", "yarn", "pnpm"]
14
+ }
15
+ },
16
+ "steps": [
17
+ {
18
+ "stepNumber": 1,
19
+ "agentName": "worker",
20
+ "task": "Create a GitHub Actions CI workflow at .github/workflows/ci.yml. It should: (1) trigger on push to main and pull requests, (2) use Node.js {{node-version}}, (3) install dependencies with {{package-manager}}, (4) run lint if a lint script exists, (5) run tests, (6) run build if a build script exists. Include caching for node_modules.",
21
+ "dependencies": [],
22
+ "expectedOutputs": [".github/workflows/ci.yml"]
23
+ },
24
+ {
25
+ "stepNumber": 2,
26
+ "agentName": "worker",
27
+ "task": "Add a Dockerfile for containerized deployment. Include a .dockerignore file. Ensure the container runs the built application. Add health check if the project is a server.",
28
+ "dependencies": [],
29
+ "expectedOutputs": ["Dockerfile", ".dockerignore"]
30
+ },
31
+ {
32
+ "stepNumber": 3,
33
+ "agentName": "reviewer",
34
+ "task": "Validate the CI workflow YAML is syntactically correct. Verify the Dockerfile builds successfully (dry run). Update README with CI badge and deployment instructions.",
35
+ "dependencies": [1, 2],
36
+ "expectedOutputs": ["updated README with CI badge"]
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "add-tests",
3
+ "description": "Add unit tests for untested modules",
4
+ "category": "testing",
5
+ "parameters": {
6
+ "framework": {
7
+ "description": "Test framework to use",
8
+ "default": "mocha",
9
+ "options": ["mocha", "jest", "vitest"]
10
+ },
11
+ "coverage-target": {
12
+ "description": "Minimum coverage percentage to target",
13
+ "default": "80"
14
+ }
15
+ },
16
+ "steps": [
17
+ {
18
+ "stepNumber": 1,
19
+ "agentName": "worker",
20
+ "task": "Analyze the project to identify all modules without test coverage. List each untested file and its exported functions. Determine the test framework ({{framework}}) and write a test plan. Do not write tests yet.",
21
+ "dependencies": [],
22
+ "expectedOutputs": ["test plan or analysis output"]
23
+ },
24
+ {
25
+ "stepNumber": 2,
26
+ "agentName": "worker",
27
+ "task": "Write unit tests for the untested modules identified in step 1 using {{framework}}. Target {{coverage-target}}% coverage. Each test file should cover: happy path, edge cases, and error conditions. Ensure all tests pass.",
28
+ "dependencies": [1],
29
+ "expectedOutputs": ["test files", "passing test results"]
30
+ },
31
+ {
32
+ "stepNumber": 3,
33
+ "agentName": "reviewer",
34
+ "task": "Run the full test suite and verify all new and existing tests pass. Fix any integration issues. Update README if test running instructions are missing or outdated.",
35
+ "dependencies": [2],
36
+ "expectedOutputs": ["all tests passing", "updated README if needed"]
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "migrate-to-ts",
3
+ "description": "Migrate a JavaScript project to TypeScript",
4
+ "category": "migration",
5
+ "parameters": {
6
+ "strictness": {
7
+ "description": "TypeScript strictness level",
8
+ "default": "strict",
9
+ "options": ["strict", "moderate", "loose"]
10
+ }
11
+ },
12
+ "steps": [
13
+ {
14
+ "stepNumber": 1,
15
+ "agentName": "worker",
16
+ "task": "Initialize TypeScript: install typescript and @types packages, create tsconfig.json with {{strictness}} settings (strict: all strict flags on, moderate: strict but no exactOptionalPropertyTypes, loose: noImplicitAny only). Configure paths, outDir, and include/exclude patterns.",
17
+ "dependencies": [],
18
+ "expectedOutputs": ["tsconfig.json", "package.json updated with typescript dependency"]
19
+ },
20
+ {
21
+ "stepNumber": 2,
22
+ "agentName": "worker",
23
+ "task": "Rename .js files to .ts (or .jsx to .tsx). Add type annotations to function parameters and return types. Fix any 'any' types with proper interfaces. Do not change runtime behavior.",
24
+ "dependencies": [1],
25
+ "expectedOutputs": ["renamed .ts files", "type annotations added"]
26
+ },
27
+ {
28
+ "stepNumber": 3,
29
+ "agentName": "worker",
30
+ "task": "Update test configuration for TypeScript (ts-node, ts-jest, or vitest). Rename test files to .test.ts. Fix type errors in tests. Verify all tests still pass after migration.",
31
+ "dependencies": [2],
32
+ "expectedOutputs": ["renamed test files", "all tests passing"]
33
+ },
34
+ {
35
+ "stepNumber": 4,
36
+ "agentName": "reviewer",
37
+ "task": "Run tsc with zero errors. Update build scripts in package.json. Update CI configuration if present. Remove any leftover .js source files that have .ts equivalents. Update README with TypeScript build instructions.",
38
+ "dependencies": [3],
39
+ "expectedOutputs": ["clean tsc compilation", "updated package.json scripts", "updated README"]
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "refactor-modularize",
3
+ "description": "Break monolithic code into smaller, focused modules",
4
+ "category": "refactoring",
5
+ "parameters": {
6
+ "target": {
7
+ "description": "File or directory to refactor (default: largest file)"
8
+ },
9
+ "max-lines": {
10
+ "description": "Maximum lines per module after refactoring",
11
+ "default": "300"
12
+ }
13
+ },
14
+ "steps": [
15
+ {
16
+ "stepNumber": 1,
17
+ "agentName": "worker",
18
+ "task": "Analyze {{target}} and identify logical boundaries for extraction. Group related functions, classes, and types. Produce a refactoring plan listing each new module, what it will contain, and which imports change. Target {{max-lines}} lines per module.",
19
+ "dependencies": [],
20
+ "expectedOutputs": ["refactoring plan"]
21
+ },
22
+ {
23
+ "stepNumber": 2,
24
+ "agentName": "worker",
25
+ "task": "Execute the refactoring plan from step 1: extract modules, move code, update imports and exports. Each new module should have a single clear responsibility. Preserve all existing public API surface (re-export from the original file if needed).",
26
+ "dependencies": [1],
27
+ "expectedOutputs": ["new module files", "updated imports"]
28
+ },
29
+ {
30
+ "stepNumber": 3,
31
+ "agentName": "worker",
32
+ "task": "Run the full test suite and verify no regressions. If tests reference internal functions that moved, update the imports. Add tests for any newly exposed module boundaries.",
33
+ "dependencies": [2],
34
+ "expectedOutputs": ["all tests passing"]
35
+ },
36
+ {
37
+ "stepNumber": 4,
38
+ "agentName": "reviewer",
39
+ "task": "Verify the build compiles cleanly with no errors or warnings. Check that no circular dependencies were introduced. Update documentation to reflect the new module structure.",
40
+ "dependencies": [3],
41
+ "expectedOutputs": ["clean build", "updated documentation"]
42
+ }
43
+ ]
44
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "security-audit",
3
+ "description": "Run security audit and fix findings",
4
+ "category": "security",
5
+ "parameters": {
6
+ "severity": {
7
+ "description": "Minimum severity level to fix",
8
+ "default": "high",
9
+ "options": ["critical", "high", "moderate"]
10
+ }
11
+ },
12
+ "steps": [
13
+ {
14
+ "stepNumber": 1,
15
+ "agentName": "worker",
16
+ "task": "Run npm audit (or equivalent) and review all dependencies for known vulnerabilities. Identify all findings at {{severity}} level or above. List each vulnerability, affected package, and recommended fix.",
17
+ "dependencies": [],
18
+ "expectedOutputs": ["security audit report"]
19
+ },
20
+ {
21
+ "stepNumber": 2,
22
+ "agentName": "worker",
23
+ "task": "Fix the vulnerabilities found in step 1: update affected packages, apply patches, or replace insecure dependencies. For code-level issues (SQL injection, XSS, path traversal), fix the vulnerable code patterns. Do not introduce breaking changes.",
24
+ "dependencies": [1],
25
+ "expectedOutputs": ["updated package.json", "fixed source files"]
26
+ },
27
+ {
28
+ "stepNumber": 3,
29
+ "agentName": "reviewer",
30
+ "task": "Re-run the security audit and verify all findings at {{severity}} level or above are resolved. Run the test suite to confirm no regressions. Document the fixes in a SECURITY-FIXES.md file.",
31
+ "dependencies": [2],
32
+ "expectedOutputs": ["clean audit result", "all tests passing", "SECURITY-FIXES.md"]
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "goal": "Build a REST API with authentication, CRUD endpoints, and tests",
3
+ "createdAt": "2025-01-01T00:00:00.000Z",
4
+ "steps": [
5
+ {
6
+ "stepNumber": 1,
7
+ "agentName": "worker",
8
+ "task": "Create a Node.js/Express REST API with: (1) User authentication endpoints (register, login, logout) using JWT, (2) CRUD endpoints for the main resource, (3) Input validation and error handling, (4) CORS configuration. Use TypeScript if the project supports it.",
9
+ "dependencies": [],
10
+ "expectedOutputs": ["server.ts or server.js", "route files", "auth middleware", "package.json with dependencies"]
11
+ },
12
+ {
13
+ "stepNumber": 2,
14
+ "agentName": "worker",
15
+ "task": "Write comprehensive tests for the REST API: (1) Unit tests for auth middleware, (2) Integration tests for all endpoints using supertest, (3) Edge case tests (invalid input, unauthorized access, missing fields). Ensure all tests pass.",
16
+ "dependencies": [1],
17
+ "expectedOutputs": ["test files", "test results showing all passing"]
18
+ },
19
+ {
20
+ "stepNumber": 3,
21
+ "agentName": "worker",
22
+ "task": "Set up CI/CD and deployment config: (1) GitHub Actions workflow for lint + test on PR, (2) Dockerfile for containerized deployment, (3) Environment variable configuration (.env.example). Do not modify application code.",
23
+ "dependencies": [1],
24
+ "expectedOutputs": [".github/workflows/ci.yml", "Dockerfile", ".env.example"]
25
+ },
26
+ {
27
+ "stepNumber": 4,
28
+ "agentName": "reviewer",
29
+ "task": "Final integration: (1) Verify all endpoints work end-to-end, (2) Ensure README documents all API endpoints with example requests, (3) Verify CI workflow syntax is valid, (4) Fix any integration issues between components.",
30
+ "dependencies": [2, 3],
31
+ "expectedOutputs": ["Updated README.md", "All tests passing", "Clean git history"]
32
+ }
33
+ ],
34
+ "metadata": {
35
+ "totalSteps": 4,
36
+ "estimatedDuration": "8-12 minutes"
37
+ }
38
+ }