swarm-engine 1.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/AGENTS.md +72 -0
- package/CLAUDE.md +89 -0
- package/LICENSE +21 -0
- package/README.md +235 -0
- package/agents/accessibility-reviewer.md +118 -0
- package/agents/api-contract-reviewer.md +99 -0
- package/agents/concurrency-reviewer.md +111 -0
- package/agents/data-integrity-reviewer.md +103 -0
- package/agents/debugger.md +99 -0
- package/agents/dependency-reviewer.md +115 -0
- package/agents/devils-advocate.md +94 -0
- package/agents/documentation-reviewer.md +114 -0
- package/agents/documenter.md +78 -0
- package/agents/error-handling-reviewer.md +113 -0
- package/agents/grounding.md +99 -0
- package/agents/guardian.md +87 -0
- package/agents/implementer.md +141 -0
- package/agents/integrator.md +95 -0
- package/agents/judge.md +79 -0
- package/agents/librarian.md +90 -0
- package/agents/orchestrator.md +331 -0
- package/agents/performance-reviewer.md +93 -0
- package/agents/planner.md +106 -0
- package/agents/refactorer.md +92 -0
- package/agents/researcher.md +97 -0
- package/agents/reviewer.md +117 -0
- package/agents/security-reviewer.md +107 -0
- package/agents/sentinel.md +92 -0
- package/agents/tester.md +93 -0
- package/agents/testing-reviewer.md +112 -0
- package/commands/diff-review.md +64 -0
- package/commands/fix-pr.md +78 -0
- package/commands/red-team.md +82 -0
- package/commands/research.md +59 -0
- package/commands/resume.md +80 -0
- package/commands/review-cycle.md +123 -0
- package/commands/swarm-setup.md +28 -0
- package/commands/swarm.md +126 -0
- package/commands/tdd.md +91 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +3 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/acp.d.ts +3 -0
- package/dist/cli/commands/acp.d.ts.map +1 -0
- package/dist/cli/commands/acp.js +29 -0
- package/dist/cli/commands/acp.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +3 -0
- package/dist/cli/commands/agents.d.ts.map +1 -0
- package/dist/cli/commands/agents.js +344 -0
- package/dist/cli/commands/agents.js.map +1 -0
- package/dist/cli/commands/backends.d.ts +3 -0
- package/dist/cli/commands/backends.d.ts.map +1 -0
- package/dist/cli/commands/backends.js +22 -0
- package/dist/cli/commands/backends.js.map +1 -0
- package/dist/cli/commands/completions.d.ts +3 -0
- package/dist/cli/commands/completions.d.ts.map +1 -0
- package/dist/cli/commands/completions.js +85 -0
- package/dist/cli/commands/completions.js.map +1 -0
- package/dist/cli/commands/compound.d.ts +3 -0
- package/dist/cli/commands/compound.d.ts.map +1 -0
- package/dist/cli/commands/compound.js +119 -0
- package/dist/cli/commands/compound.js.map +1 -0
- package/dist/cli/commands/configure.d.ts +3 -0
- package/dist/cli/commands/configure.d.ts.map +1 -0
- package/dist/cli/commands/configure.js +151 -0
- package/dist/cli/commands/configure.js.map +1 -0
- package/dist/cli/commands/convert.d.ts +15 -0
- package/dist/cli/commands/convert.d.ts.map +1 -0
- package/dist/cli/commands/convert.js +218 -0
- package/dist/cli/commands/convert.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +96 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +154 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/learn.d.ts +3 -0
- package/dist/cli/commands/learn.d.ts.map +1 -0
- package/dist/cli/commands/learn.js +163 -0
- package/dist/cli/commands/learn.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +3 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +89 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/memory.d.ts +3 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +134 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/orchestrate.d.ts +3 -0
- package/dist/cli/commands/orchestrate.d.ts.map +1 -0
- package/dist/cli/commands/orchestrate.js +237 -0
- package/dist/cli/commands/orchestrate.js.map +1 -0
- package/dist/cli/commands/patterns.d.ts +3 -0
- package/dist/cli/commands/patterns.d.ts.map +1 -0
- package/dist/cli/commands/patterns.js +25 -0
- package/dist/cli/commands/patterns.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +3 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +77 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/plugin.d.ts +3 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +124 -0
- package/dist/cli/commands/plugin.js.map +1 -0
- package/dist/cli/commands/resume.d.ts +3 -0
- package/dist/cli/commands/resume.d.ts.map +1 -0
- package/dist/cli/commands/resume.js +55 -0
- package/dist/cli/commands/resume.js.map +1 -0
- package/dist/cli/commands/run.d.ts +3 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +78 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/share.d.ts +3 -0
- package/dist/cli/commands/share.d.ts.map +1 -0
- package/dist/cli/commands/share.js +34 -0
- package/dist/cli/commands/share.js.map +1 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +148 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/template.d.ts +3 -0
- package/dist/cli/commands/template.d.ts.map +1 -0
- package/dist/cli/commands/template.js +213 -0
- package/dist/cli/commands/template.js.map +1 -0
- package/dist/cli/commands/vault.d.ts +3 -0
- package/dist/cli/commands/vault.d.ts.map +1 -0
- package/dist/cli/commands/vault.js +402 -0
- package/dist/cli/commands/vault.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +3 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +38 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/commands/version.d.ts +3 -0
- package/dist/cli/commands/version.d.ts.map +1 -0
- package/dist/cli/commands/version.js +19 -0
- package/dist/cli/commands/version.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +3 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +179 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +118 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/checkpoint.d.ts +35 -0
- package/dist/core/checkpoint.d.ts.map +1 -0
- package/dist/core/checkpoint.js +80 -0
- package/dist/core/checkpoint.js.map +1 -0
- package/dist/core/event-bus.d.ts +41 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +115 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/lifecycle.d.ts +30 -0
- package/dist/core/lifecycle.d.ts.map +1 -0
- package/dist/core/lifecycle.js +72 -0
- package/dist/core/lifecycle.js.map +1 -0
- package/dist/core/patterns.d.ts +43 -0
- package/dist/core/patterns.d.ts.map +1 -0
- package/dist/core/patterns.js +372 -0
- package/dist/core/patterns.js.map +1 -0
- package/dist/core/permissions.d.ts +40 -0
- package/dist/core/permissions.d.ts.map +1 -0
- package/dist/core/permissions.js +113 -0
- package/dist/core/permissions.js.map +1 -0
- package/dist/core/registry.d.ts +80 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +308 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/snapshots.d.ts +20 -0
- package/dist/core/snapshots.d.ts.map +1 -0
- package/dist/core/snapshots.js +73 -0
- package/dist/core/snapshots.js.map +1 -0
- package/dist/core/types.d.ts +168 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +33 -0
- package/dist/core/types.js.map +1 -0
- package/dist/hooks/cli.d.ts +11 -0
- package/dist/hooks/cli.d.ts.map +1 -0
- package/dist/hooks/cli.js +32 -0
- package/dist/hooks/cli.js.map +1 -0
- package/dist/hooks/index.d.ts +23 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +58 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/index.d.ts +105 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +298 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/schema.d.ts +6 -0
- package/dist/memory/schema.d.ts.map +1 -0
- package/dist/memory/schema.js +71 -0
- package/dist/memory/schema.js.map +1 -0
- package/dist/plugin/index.d.ts +6 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +182 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/runtime/acp.d.ts +41 -0
- package/dist/runtime/acp.d.ts.map +1 -0
- package/dist/runtime/acp.js +137 -0
- package/dist/runtime/acp.js.map +1 -0
- package/dist/runtime/adaptive.d.ts +34 -0
- package/dist/runtime/adaptive.d.ts.map +1 -0
- package/dist/runtime/adaptive.js +229 -0
- package/dist/runtime/adaptive.js.map +1 -0
- package/dist/runtime/autonomy.d.ts +21 -0
- package/dist/runtime/autonomy.d.ts.map +1 -0
- package/dist/runtime/autonomy.js +74 -0
- package/dist/runtime/autonomy.js.map +1 -0
- package/dist/runtime/backends/claude.d.ts +9 -0
- package/dist/runtime/backends/claude.d.ts.map +1 -0
- package/dist/runtime/backends/claude.js +134 -0
- package/dist/runtime/backends/claude.js.map +1 -0
- package/dist/runtime/backends/codex.d.ts +9 -0
- package/dist/runtime/backends/codex.d.ts.map +1 -0
- package/dist/runtime/backends/codex.js +132 -0
- package/dist/runtime/backends/codex.js.map +1 -0
- package/dist/runtime/backends/gemini.d.ts +9 -0
- package/dist/runtime/backends/gemini.d.ts.map +1 -0
- package/dist/runtime/backends/gemini.js +103 -0
- package/dist/runtime/backends/gemini.js.map +1 -0
- package/dist/runtime/backends/index.d.ts +17 -0
- package/dist/runtime/backends/index.d.ts.map +1 -0
- package/dist/runtime/backends/index.js +39 -0
- package/dist/runtime/backends/index.js.map +1 -0
- package/dist/runtime/backends/mock.d.ts +21 -0
- package/dist/runtime/backends/mock.d.ts.map +1 -0
- package/dist/runtime/backends/mock.js +46 -0
- package/dist/runtime/backends/mock.js.map +1 -0
- package/dist/runtime/backends/types.d.ts +34 -0
- package/dist/runtime/backends/types.d.ts.map +1 -0
- package/dist/runtime/backends/types.js +2 -0
- package/dist/runtime/backends/types.js.map +1 -0
- package/dist/runtime/backends/vercel-ai.d.ts +14 -0
- package/dist/runtime/backends/vercel-ai.d.ts.map +1 -0
- package/dist/runtime/backends/vercel-ai.js +137 -0
- package/dist/runtime/backends/vercel-ai.js.map +1 -0
- package/dist/runtime/cache-optimizer.d.ts +37 -0
- package/dist/runtime/cache-optimizer.d.ts.map +1 -0
- package/dist/runtime/cache-optimizer.js +54 -0
- package/dist/runtime/cache-optimizer.js.map +1 -0
- package/dist/runtime/cascade.d.ts +26 -0
- package/dist/runtime/cascade.d.ts.map +1 -0
- package/dist/runtime/cascade.js +54 -0
- package/dist/runtime/cascade.js.map +1 -0
- package/dist/runtime/chunker.d.ts +36 -0
- package/dist/runtime/chunker.d.ts.map +1 -0
- package/dist/runtime/chunker.js +210 -0
- package/dist/runtime/chunker.js.map +1 -0
- package/dist/runtime/compaction.d.ts +22 -0
- package/dist/runtime/compaction.d.ts.map +1 -0
- package/dist/runtime/compaction.js +36 -0
- package/dist/runtime/compaction.js.map +1 -0
- package/dist/runtime/compounder.d.ts +66 -0
- package/dist/runtime/compounder.d.ts.map +1 -0
- package/dist/runtime/compounder.js +276 -0
- package/dist/runtime/compounder.js.map +1 -0
- package/dist/runtime/cost-model.d.ts +24 -0
- package/dist/runtime/cost-model.d.ts.map +1 -0
- package/dist/runtime/cost-model.js +120 -0
- package/dist/runtime/cost-model.js.map +1 -0
- package/dist/runtime/distiller.d.ts +21 -0
- package/dist/runtime/distiller.d.ts.map +1 -0
- package/dist/runtime/distiller.js +70 -0
- package/dist/runtime/distiller.js.map +1 -0
- package/dist/runtime/engine.d.ts +123 -0
- package/dist/runtime/engine.d.ts.map +1 -0
- package/dist/runtime/engine.js +969 -0
- package/dist/runtime/engine.js.map +1 -0
- package/dist/runtime/executor.d.ts +71 -0
- package/dist/runtime/executor.d.ts.map +1 -0
- package/dist/runtime/executor.js +283 -0
- package/dist/runtime/executor.js.map +1 -0
- package/dist/runtime/heuristics.d.ts +33 -0
- package/dist/runtime/heuristics.d.ts.map +1 -0
- package/dist/runtime/heuristics.js +188 -0
- package/dist/runtime/heuristics.js.map +1 -0
- package/dist/runtime/living-spec.d.ts +34 -0
- package/dist/runtime/living-spec.d.ts.map +1 -0
- package/dist/runtime/living-spec.js +91 -0
- package/dist/runtime/living-spec.js.map +1 -0
- package/dist/runtime/lsp.d.ts +50 -0
- package/dist/runtime/lsp.d.ts.map +1 -0
- package/dist/runtime/lsp.js +110 -0
- package/dist/runtime/lsp.js.map +1 -0
- package/dist/runtime/mcp.d.ts +27 -0
- package/dist/runtime/mcp.d.ts.map +1 -0
- package/dist/runtime/mcp.js +154 -0
- package/dist/runtime/mcp.js.map +1 -0
- package/dist/runtime/model-router.d.ts +22 -0
- package/dist/runtime/model-router.d.ts.map +1 -0
- package/dist/runtime/model-router.js +94 -0
- package/dist/runtime/model-router.js.map +1 -0
- package/dist/runtime/panes.d.ts +76 -0
- package/dist/runtime/panes.d.ts.map +1 -0
- package/dist/runtime/panes.js +279 -0
- package/dist/runtime/panes.js.map +1 -0
- package/dist/runtime/plan-search.d.ts +41 -0
- package/dist/runtime/plan-search.d.ts.map +1 -0
- package/dist/runtime/plan-search.js +140 -0
- package/dist/runtime/plan-search.js.map +1 -0
- package/dist/runtime/plugins.d.ts +59 -0
- package/dist/runtime/plugins.d.ts.map +1 -0
- package/dist/runtime/plugins.js +121 -0
- package/dist/runtime/plugins.js.map +1 -0
- package/dist/runtime/reflexion.d.ts +22 -0
- package/dist/runtime/reflexion.d.ts.map +1 -0
- package/dist/runtime/reflexion.js +85 -0
- package/dist/runtime/reflexion.js.map +1 -0
- package/dist/runtime/review-schema.d.ts +75 -0
- package/dist/runtime/review-schema.d.ts.map +1 -0
- package/dist/runtime/review-schema.js +223 -0
- package/dist/runtime/review-schema.js.map +1 -0
- package/dist/runtime/rewriter.d.ts +8 -0
- package/dist/runtime/rewriter.d.ts.map +1 -0
- package/dist/runtime/rewriter.js +81 -0
- package/dist/runtime/rewriter.js.map +1 -0
- package/dist/runtime/sharing.d.ts +15 -0
- package/dist/runtime/sharing.d.ts.map +1 -0
- package/dist/runtime/sharing.js +48 -0
- package/dist/runtime/sharing.js.map +1 -0
- package/dist/runtime/stats.d.ts +53 -0
- package/dist/runtime/stats.d.ts.map +1 -0
- package/dist/runtime/stats.js +160 -0
- package/dist/runtime/stats.js.map +1 -0
- package/dist/runtime/templates.d.ts +77 -0
- package/dist/runtime/templates.d.ts.map +1 -0
- package/dist/runtime/templates.js +221 -0
- package/dist/runtime/templates.js.map +1 -0
- package/dist/runtime/traces.d.ts +60 -0
- package/dist/runtime/traces.d.ts.map +1 -0
- package/dist/runtime/traces.js +166 -0
- package/dist/runtime/traces.js.map +1 -0
- package/dist/runtime/verifier.d.ts +54 -0
- package/dist/runtime/verifier.d.ts.map +1 -0
- package/dist/runtime/verifier.js +172 -0
- package/dist/runtime/verifier.js.map +1 -0
- package/dist/runtime/worktree.d.ts +24 -0
- package/dist/runtime/worktree.d.ts.map +1 -0
- package/dist/runtime/worktree.js +82 -0
- package/dist/runtime/worktree.js.map +1 -0
- package/dist/tui/dashboard.d.ts +65 -0
- package/dist/tui/dashboard.d.ts.map +1 -0
- package/dist/tui/dashboard.js +496 -0
- package/dist/tui/dashboard.js.map +1 -0
- package/dist/tui/progress.d.ts +32 -0
- package/dist/tui/progress.d.ts.map +1 -0
- package/dist/tui/progress.js +257 -0
- package/dist/tui/progress.js.map +1 -0
- package/dist/tui/renderer.d.ts +72 -0
- package/dist/tui/renderer.d.ts.map +1 -0
- package/dist/tui/renderer.js +205 -0
- package/dist/tui/renderer.js.map +1 -0
- package/dist/utils/compact-format.d.ts +35 -0
- package/dist/utils/compact-format.d.ts.map +1 -0
- package/dist/utils/compact-format.js +106 -0
- package/dist/utils/compact-format.js.map +1 -0
- package/dist/utils/config.d.ts +73 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +70 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/env.d.ts +6 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +28 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/errors.d.ts +14 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +120 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +56 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/output.d.ts +10 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +26 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/paths.d.ts +7 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +16 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/project-config.d.ts +18 -0
- package/dist/utils/project-config.d.ts.map +1 -0
- package/dist/utils/project-config.js +46 -0
- package/dist/utils/project-config.js.map +1 -0
- package/dist/utils/redact.d.ts +5 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +25 -0
- package/dist/utils/redact.js.map +1 -0
- package/dist/utils/schemas.d.ts +109 -0
- package/dist/utils/schemas.d.ts.map +1 -0
- package/dist/utils/schemas.js +63 -0
- package/dist/utils/schemas.js.map +1 -0
- package/dist/utils/terminal.d.ts +33 -0
- package/dist/utils/terminal.d.ts.map +1 -0
- package/dist/utils/terminal.js +82 -0
- package/dist/utils/terminal.js.map +1 -0
- package/dist/utils/tokens.d.ts +9 -0
- package/dist/utils/tokens.d.ts.map +1 -0
- package/dist/utils/tokens.js +11 -0
- package/dist/utils/tokens.js.map +1 -0
- package/package.json +71 -0
- package/skills/design-system/SKILL.md +195 -0
- package/skills/orchestration-patterns/SKILL.md +81 -0
- package/skills/orchestration-patterns/examples/example-workflows.md +290 -0
- package/skills/orchestration-patterns/references/adversarial.md +51 -0
- package/skills/orchestration-patterns/references/batch.md +63 -0
- package/skills/orchestration-patterns/references/chaos.md +43 -0
- package/skills/orchestration-patterns/references/competitive.md +84 -0
- package/skills/orchestration-patterns/references/debate.md +44 -0
- package/skills/orchestration-patterns/references/emergence.md +50 -0
- package/skills/orchestration-patterns/references/fan-out-fan-in.md +74 -0
- package/skills/orchestration-patterns/references/iterative.md +99 -0
- package/skills/orchestration-patterns/references/pipeline.md +72 -0
- package/skills/swarm-output-style/SKILL.md +85 -0
- package/templates/add-endpoint.yml +44 -0
- package/templates/add-feature.yml +30 -0
- package/templates/agent-template.md +73 -0
- package/templates/bug-fix.yml +31 -0
- package/templates/explore.yml +21 -0
- package/templates/fix-pr.yml +30 -0
- package/templates/migration.yml +36 -0
- package/templates/refactor.yml +35 -0
- package/templates/security-audit.yml +27 -0
- package/templates/workflow-template.md +63 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Chaos / Brownian Ratchet Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Multiple agents tackle overlapping tasks with ZERO coordination. Each works in an isolated worktree. CI (tests) is the one-way ratchet — anything that passes gets merged. Duplicated effort is fine. Progress is permanent.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Test coverage improvement across a codebase
|
|
8
|
+
- Refactoring campaigns (rename, extract, simplify)
|
|
9
|
+
- Code cleanup and documentation
|
|
10
|
+
- Any "make things better broadly" task without specific requirements
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
┌─── Agent 1 (worktree) ─── tests pass? ─── merge ──┐
|
|
15
|
+
│ │
|
|
16
|
+
Broad Task ─→ Plan ─┼─── Agent 2 (worktree) ─── tests fail? ─── discard │─→ Net Result
|
|
17
|
+
│ │
|
|
18
|
+
└─── Agent 3 (worktree) ─── tests pass? ─── merge ──┘
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Implementation
|
|
22
|
+
```
|
|
23
|
+
TeamCreate(team_name="chaos")
|
|
24
|
+
|
|
25
|
+
# All agents get the same broad task, work independently
|
|
26
|
+
Agent(name="chaos-1", isolation="worktree", run_in_background=True,
|
|
27
|
+
prompt="Improve: ...", model="opus")
|
|
28
|
+
Agent(name="chaos-2", isolation="worktree", run_in_background=True,
|
|
29
|
+
prompt="Improve: ...", model="opus")
|
|
30
|
+
Agent(name="chaos-3", isolation="worktree", run_in_background=True,
|
|
31
|
+
prompt="Improve: ...", model="opus")
|
|
32
|
+
|
|
33
|
+
# Ratchet: merge only what passes tests
|
|
34
|
+
for each branch:
|
|
35
|
+
if tests_pass(branch): merge(branch)
|
|
36
|
+
else: discard(branch)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Pitfalls
|
|
40
|
+
- **Not for specific features**: Chaos works for broad improvements, not targeted requirements.
|
|
41
|
+
- **Merge conflicts**: Later merges may conflict with earlier ones. Auto-resolve or discard.
|
|
42
|
+
- **Test quality matters**: If tests are weak, bad code passes the ratchet. Ensure good baseline test coverage.
|
|
43
|
+
- **Cost**: N agents = N x token cost. Budget accordingly.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Competitive / Tournament Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Two or more agents solve the same problem independently using different approaches. A reviewer evaluates each solution. The user picks the winner. Useful when the optimal approach is uncertain.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Design-uncertain features where multiple viable approaches exist
|
|
8
|
+
- Performance-sensitive code where different algorithms should be compared
|
|
9
|
+
- Architectural spikes before committing to an approach
|
|
10
|
+
- Any "should we do X or Y?" question that's best answered by trying both
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
┌─── Implementer A (worktree) ───┐
|
|
15
|
+
│ │
|
|
16
|
+
User Task ─→ Plan ─┤ ├─→ Compare ─→ User Picks ─→ Apply
|
|
17
|
+
│ │
|
|
18
|
+
└─── Implementer B (worktree) ───┘
|
|
19
|
+
↓ ↓
|
|
20
|
+
Reviewer A Reviewer B
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Implementation
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
# Setup
|
|
27
|
+
TeamCreate(team_name="competitive-team")
|
|
28
|
+
TaskCreate(subject="Research approaches", description="...")
|
|
29
|
+
TaskCreate(subject="Implement approach 1", description="...")
|
|
30
|
+
TaskCreate(subject="Implement approach 2", description="...")
|
|
31
|
+
TaskCreate(subject="Review approach 1", description="...")
|
|
32
|
+
TaskCreate(subject="Review approach 2", description="...")
|
|
33
|
+
|
|
34
|
+
# Phase 1: Research — identify two viable approaches
|
|
35
|
+
research = Agent(name="researcher", team_name="competitive-team", run_in_background=True,
|
|
36
|
+
prompt="Research approaches for: ...", model="sonnet")
|
|
37
|
+
# Wait for research
|
|
38
|
+
SendMessage(to="researcher", message="shutdown_request")
|
|
39
|
+
|
|
40
|
+
# Phase 2: Implement — parallel, isolated worktrees
|
|
41
|
+
Agent(name="impl-1", team_name="competitive-team", run_in_background=True,
|
|
42
|
+
prompt="Implement approach 1: ...", model="opus", isolation="worktree")
|
|
43
|
+
Agent(name="impl-2", team_name="competitive-team", run_in_background=True,
|
|
44
|
+
prompt="Implement approach 2: ...", model="opus", isolation="worktree")
|
|
45
|
+
# Wait for both implementations
|
|
46
|
+
SendMessage(to="impl-1", message="shutdown_request")
|
|
47
|
+
SendMessage(to="impl-2", message="shutdown_request")
|
|
48
|
+
|
|
49
|
+
# Phase 3: Evaluate — parallel reviewers
|
|
50
|
+
Agent(name="reviewer-1", team_name="competitive-team", run_in_background=True,
|
|
51
|
+
prompt="Review approach 1: ...", model="opus")
|
|
52
|
+
Agent(name="reviewer-2", team_name="competitive-team", run_in_background=True,
|
|
53
|
+
prompt="Review approach 2: ...", model="opus")
|
|
54
|
+
# Wait for both reviews
|
|
55
|
+
SendMessage(to="reviewer-1", message="shutdown_request")
|
|
56
|
+
SendMessage(to="reviewer-2", message="shutdown_request")
|
|
57
|
+
|
|
58
|
+
# Phase 4: Select — present comparison, user decides
|
|
59
|
+
# Apply winning worktree branch
|
|
60
|
+
|
|
61
|
+
# Cleanup
|
|
62
|
+
TeamDelete(team_name="competitive-team")
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Evaluation Criteria
|
|
66
|
+
|
|
67
|
+
| Criteria | What to assess |
|
|
68
|
+
|----------|---------------|
|
|
69
|
+
| **Correctness** | Does it solve the full problem? Edge cases? |
|
|
70
|
+
| **Complexity** | Lines of code, cyclomatic complexity, readability |
|
|
71
|
+
| **Maintainability** | How easy to extend, modify, debug? |
|
|
72
|
+
| **Performance** | Time/space complexity, benchmarks if applicable |
|
|
73
|
+
| **Testability** | How easy to test? How much mocking needed? |
|
|
74
|
+
|
|
75
|
+
## When NOT to Use
|
|
76
|
+
- The approach is obvious — just implement it
|
|
77
|
+
- The task is simple enough that two approaches would be nearly identical
|
|
78
|
+
- Token budget is tight — this pattern costs 2x implementation tokens
|
|
79
|
+
|
|
80
|
+
## Pitfalls
|
|
81
|
+
- **Scope creep**: Agents may solve slightly different problems. Give them identical specs.
|
|
82
|
+
- **Worktree cleanup**: If the user doesn't pick either approach, both worktrees should be cleaned up.
|
|
83
|
+
- **Bias**: Present both approaches neutrally in the comparison. Don't lead the user.
|
|
84
|
+
- **Incomplete comparison**: Each reviewer must assess ALL criteria, not just their strengths.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Debate Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Multiple reviewers independently assess code, then debate their findings in a second round. Consensus = high confidence. Disagreement = flag for human.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Code quality is uncertain and you want multiple perspectives
|
|
8
|
+
- Complex logic where one reviewer might miss something
|
|
9
|
+
- When you need a confidence-weighted verdict, not just pass/fail
|
|
10
|
+
- Controversial design decisions that benefit from deliberation
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
┌─── Reviewer A ───┐ ┌─── Debater A ───┐
|
|
15
|
+
│ │ │ │
|
|
16
|
+
Code ───→ ├─── Reviewer B ───┼─→ Share → ├─── Debater B ───┼─→ Verdict
|
|
17
|
+
│ │ │ │
|
|
18
|
+
└─── Reviewer C ───┘ └─── Debater C ───┘
|
|
19
|
+
(independent) (respond to others)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Implementation
|
|
23
|
+
```
|
|
24
|
+
# Round 1: Independent review
|
|
25
|
+
TeamCreate(team_name="debate")
|
|
26
|
+
Agent(name="reviewer-alpha", ..., prompt="Review independently: ...")
|
|
27
|
+
Agent(name="reviewer-beta", ..., prompt="Review independently: ...")
|
|
28
|
+
Agent(name="reviewer-gamma", ..., prompt="Review independently: ...")
|
|
29
|
+
|
|
30
|
+
# Round 2: Debate (each sees others' reviews)
|
|
31
|
+
Agent(name="debater-alpha", ..., prompt="Read beta+gamma reviews, respond: ...")
|
|
32
|
+
Agent(name="debater-beta", ..., prompt="Read alpha+gamma reviews, respond: ...")
|
|
33
|
+
Agent(name="debater-gamma", ..., prompt="Read alpha+beta reviews, respond: ...")
|
|
34
|
+
|
|
35
|
+
# Verdict: consensus rules
|
|
36
|
+
# All APPROVE → APPROVE
|
|
37
|
+
# 2+ REQUEST_CHANGES → REQUEST_CHANGES
|
|
38
|
+
# Disagreement → ESCALATE to human
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Pitfalls
|
|
42
|
+
- **Groupthink**: Reviewers may converge on the first reviewer's opinion. Ensure independent Round 1.
|
|
43
|
+
- **Debate fatigue**: Two rounds is usually enough. More rounds rarely change the verdict.
|
|
44
|
+
- **Overweight consensus**: Unanimous agreement doesn't mean correctness. It means all agents have the same blind spots.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Emergence / Role-Free Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Identical agents with no pre-assigned roles self-organize to solve a task. Based on Dochkina 2026 (arXiv:2603.28990) which proved self-organizing agents outperform designed hierarchies by 14%.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Experimental — testing whether self-organization produces better results
|
|
8
|
+
- Tasks where the optimal role decomposition is unclear
|
|
9
|
+
- Complex tasks that might benefit from unexpected agent behaviors
|
|
10
|
+
- Research into multi-agent dynamics
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
┌─── Agent 1 (general) ──→ self-selects: researcher
|
|
15
|
+
│
|
|
16
|
+
├─── Agent 2 (general) ──→ self-selects: implementer
|
|
17
|
+
│
|
|
18
|
+
Broad Task ─→ All ──┼─── Agent 3 (general) ──→ self-selects: tester
|
|
19
|
+
│
|
|
20
|
+
├─── Agent 4 (general) ──→ self-selects: reviewer
|
|
21
|
+
│
|
|
22
|
+
└─── Agent 5 (general) ──→ self-selects: abstains
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Implementation
|
|
26
|
+
```
|
|
27
|
+
TeamCreate(team_name="emergence")
|
|
28
|
+
|
|
29
|
+
# All agents are identical — no role assignment
|
|
30
|
+
prompt = "You are Agent N in a team of 5. Decide what to do."
|
|
31
|
+
|
|
32
|
+
Agent(name="agent-1", subagent_type="general-purpose", model="opus", ...)
|
|
33
|
+
Agent(name="agent-2", subagent_type="general-purpose", model="opus", ...)
|
|
34
|
+
Agent(name="agent-3", subagent_type="general-purpose", model="opus", ...)
|
|
35
|
+
Agent(name="agent-4", subagent_type="general-purpose", model="opus", ...)
|
|
36
|
+
Agent(name="agent-5", subagent_type="general-purpose", model="opus", ...)
|
|
37
|
+
|
|
38
|
+
# Coordination via scratchpad only
|
|
39
|
+
# Observe: what roles emerged? What overlapped? Quality assessment.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Key Research
|
|
43
|
+
- Dochkina 2026: 25,000 tasks, 5,006 emergent roles, 14% better than designed hierarchies
|
|
44
|
+
- Only works with strong models (Opus-class). Weak models need pre-assigned roles.
|
|
45
|
+
|
|
46
|
+
## Pitfalls
|
|
47
|
+
- **Only for capable models**: Weak models won't self-organize effectively.
|
|
48
|
+
- **Unpredictable**: You can't guarantee what roles will emerge. Some tasks may get neglected.
|
|
49
|
+
- **Scratchpad critical**: Without the shared scratchpad, agents have no visibility into each other.
|
|
50
|
+
- **Experimental**: Not yet proven for production coding tasks. Use for research and comparison.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Fan-Out / Fan-In Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Dispatch N independent agents simultaneously, collect all results, aggregate into a single output.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Multiple independent research questions
|
|
8
|
+
- Same analysis from different perspectives (e.g., 3 reviewers with different focus areas)
|
|
9
|
+
- Batch operations on unrelated files
|
|
10
|
+
- Parallel data gathering from multiple sources
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
┌─── Agent A ───┐
|
|
15
|
+
│ │
|
|
16
|
+
User Task ─→ Plan ─┼─── Agent B ───┼─→ Aggregate ─→ Result
|
|
17
|
+
│ │
|
|
18
|
+
└─── Agent C ───┘
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Implementation
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
# Setup
|
|
25
|
+
TeamCreate(team_name="fan-out-team")
|
|
26
|
+
TaskCreate(subject="Research angle A", description="...")
|
|
27
|
+
TaskCreate(subject="Research angle B", description="...")
|
|
28
|
+
TaskCreate(subject="Research angle C", description="...")
|
|
29
|
+
|
|
30
|
+
# Dispatch all agents as teammates
|
|
31
|
+
Agent(name="researcher-a", team_name="fan-out-team", run_in_background=True,
|
|
32
|
+
prompt="Research angle A: ...", model="haiku")
|
|
33
|
+
Agent(name="researcher-b", team_name="fan-out-team", run_in_background=True,
|
|
34
|
+
prompt="Research angle B: ...", model="haiku")
|
|
35
|
+
Agent(name="researcher-c", team_name="fan-out-team", run_in_background=True,
|
|
36
|
+
prompt="Research angle C: ...", model="haiku")
|
|
37
|
+
|
|
38
|
+
# All three run concurrently and return results
|
|
39
|
+
# Then synthesize all results into one coherent output
|
|
40
|
+
|
|
41
|
+
# After completion, shutdown each teammate via SendMessage
|
|
42
|
+
SendMessage(to="researcher-a", message="shutdown_request")
|
|
43
|
+
SendMessage(to="researcher-b", message="shutdown_request")
|
|
44
|
+
SendMessage(to="researcher-c", message="shutdown_request")
|
|
45
|
+
TeamDelete(team_name="fan-out-team")
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Aggregation Strategies
|
|
49
|
+
|
|
50
|
+
| Strategy | When | How |
|
|
51
|
+
|----------|------|-----|
|
|
52
|
+
| **Merge** | Complementary findings | Combine non-overlapping results |
|
|
53
|
+
| **Vote** | Same question, multiple opinions | Majority rules, flag disagreements |
|
|
54
|
+
| **Prioritize** | Mixed severity findings | Critical > Important > Suggestions |
|
|
55
|
+
| **Synthesize** | Complex, overlapping findings | LLM summarizes all inputs |
|
|
56
|
+
|
|
57
|
+
## Example: Multi-Angle Code Review
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Phase: Review (parallel)
|
|
61
|
+
├── Agent 1: Correctness review (sonnet) → bugs, logic errors
|
|
62
|
+
├── Agent 2: Security review (sonnet) → vulnerabilities, data exposure
|
|
63
|
+
└── Agent 3: Convention review (sonnet) → style, patterns, CLAUDE.md
|
|
64
|
+
|
|
65
|
+
Aggregation: Prioritize
|
|
66
|
+
├── Critical (any reviewer) → must fix
|
|
67
|
+
├── Important (any reviewer) → should fix
|
|
68
|
+
└── Suggestions (any reviewer) → optional
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Pitfalls
|
|
72
|
+
- **Context explosion**: N agents returning detailed results can overwhelm the context window. Keep dispatch prompts focused and ask for concise outputs.
|
|
73
|
+
- **Redundant work**: Agents may investigate overlapping areas. Define clear boundaries.
|
|
74
|
+
- **All-or-nothing**: If one agent fails, you still need to handle partial results gracefully.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Iterative Refinement Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
A loop of implement → review → gate check → fix until quality threshold is met or max iterations reached. Encodes quality as a hard gate rather than a suggestion.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Security-sensitive changes that must pass review before shipping
|
|
8
|
+
- Complex logic where first-pass implementation often has subtle bugs
|
|
9
|
+
- Any task where "good enough on first try" is unlikely
|
|
10
|
+
- When the cost of shipping a bug exceeds the cost of an extra review cycle
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
┌──────────────────────────────┐
|
|
15
|
+
│ │
|
|
16
|
+
↓ │
|
|
17
|
+
Implement ──→ Review (parallel) ──→ Gate Check ───┘ (if FAIL, iteration < max)
|
|
18
|
+
│
|
|
19
|
+
↓ (if PASS or iteration == max)
|
|
20
|
+
Report
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Gate Criteria
|
|
24
|
+
- **PASS**: 0 Critical findings AND 0 Important findings
|
|
25
|
+
- **FAIL**: Any Critical or Important finding → fix and re-review
|
|
26
|
+
- **MAX_ITERATIONS**: 3 (default) — if still failing after 3 iterations, report remaining issues to user
|
|
27
|
+
|
|
28
|
+
## Implementation
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
# Setup
|
|
32
|
+
TeamCreate(team_name="iterative-team")
|
|
33
|
+
|
|
34
|
+
for iteration in 1..MAX_ITERATIONS:
|
|
35
|
+
# Create tasks for this iteration
|
|
36
|
+
TaskCreate(subject=f"Correctness review (iter {iteration})", description="...")
|
|
37
|
+
TaskCreate(subject=f"Security review (iter {iteration})", description="...")
|
|
38
|
+
TaskCreate(subject=f"Convention review (iter {iteration})", description="...")
|
|
39
|
+
|
|
40
|
+
# Review phase (parallel teammates)
|
|
41
|
+
Agent(name=f"correctness-{iteration}", team_name="iterative-team", run_in_background=True,
|
|
42
|
+
prompt="Review for correctness: ...", model="opus")
|
|
43
|
+
Agent(name=f"security-{iteration}", team_name="iterative-team", run_in_background=True,
|
|
44
|
+
prompt="Review for security: ...", model="opus")
|
|
45
|
+
Agent(name=f"convention-{iteration}", team_name="iterative-team", run_in_background=True,
|
|
46
|
+
prompt="Review conventions: ...", model="sonnet")
|
|
47
|
+
|
|
48
|
+
# Wait for all reviewers, then shutdown
|
|
49
|
+
SendMessage(to=f"correctness-{iteration}", message="shutdown_request")
|
|
50
|
+
SendMessage(to=f"security-{iteration}", message="shutdown_request")
|
|
51
|
+
SendMessage(to=f"convention-{iteration}", message="shutdown_request")
|
|
52
|
+
|
|
53
|
+
# Gate check
|
|
54
|
+
findings = parse_findings(correctness, security, convention)
|
|
55
|
+
critical = [f for f in findings if f.severity == "critical"]
|
|
56
|
+
important = [f for f in findings if f.severity == "important"]
|
|
57
|
+
|
|
58
|
+
if len(critical) == 0 and len(important) == 0:
|
|
59
|
+
TeamDelete(team_name="iterative-team")
|
|
60
|
+
return PASS # Quality gate met
|
|
61
|
+
|
|
62
|
+
# Fix phase (sequential)
|
|
63
|
+
TaskCreate(subject=f"Fix issues (iter {iteration})", description="...")
|
|
64
|
+
Agent(name=f"fixer-{iteration}", team_name="iterative-team", run_in_background=True,
|
|
65
|
+
prompt=f"Fix these issues: {critical + important}", model="opus")
|
|
66
|
+
# Wait for fixer, then shutdown
|
|
67
|
+
SendMessage(to=f"fixer-{iteration}", message="shutdown_request")
|
|
68
|
+
|
|
69
|
+
# Cleanup
|
|
70
|
+
TeamDelete(team_name="iterative-team")
|
|
71
|
+
return FAIL_WITH_REMAINING_ISSUES
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Context Accumulation
|
|
75
|
+
Each iteration's fix agent gets: original spec, ALL prior review findings (not just current iteration), and what was already fixed. This prevents regression — the fix agent knows what was changed before and doesn't accidentally revert a prior fix.
|
|
76
|
+
|
|
77
|
+
## Report Format
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
## Quality Gate: [PASS after N iterations | FAIL after 3 iterations]
|
|
81
|
+
|
|
82
|
+
### Iteration 1
|
|
83
|
+
- Findings: N critical, M important
|
|
84
|
+
- Fixed: [list]
|
|
85
|
+
|
|
86
|
+
### Iteration 2
|
|
87
|
+
- Findings: N critical, M important
|
|
88
|
+
- Fixed: [list]
|
|
89
|
+
|
|
90
|
+
### Final State
|
|
91
|
+
- Remaining issues: [list or "none"]
|
|
92
|
+
- Suggestions (not blocking): [list]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Pitfalls
|
|
96
|
+
- **Infinite loops**: ALWAYS enforce max iterations. Without it, a reviewer that always finds something creates an endless cycle.
|
|
97
|
+
- **Fix regression**: Fixing issue A can introduce issue B. Pass accumulated context so each fix is aware of prior changes.
|
|
98
|
+
- **Diminishing returns**: If iteration 2 finds as many issues as iteration 1, something is fundamentally wrong with the implementation — escalate to user rather than looping.
|
|
99
|
+
- **Over-fixing**: Only fix Critical and Important findings. Suggestions should NEVER trigger another iteration.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Pipeline Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Sequential chain of agents where each step's output feeds the next step's input.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Data transformation workflows (parse → transform → validate → write)
|
|
8
|
+
- Progressive refinement (draft → review → revise → finalize)
|
|
9
|
+
- Tasks with strict ordering requirements
|
|
10
|
+
- When each step fundamentally changes the context for the next
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
User Task ─→ Agent A ─→ Agent B ─→ Agent C ─→ Result
|
|
15
|
+
(research) (implement) (review)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Implementation
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
# Setup
|
|
22
|
+
TeamCreate(team_name="pipeline-team")
|
|
23
|
+
TaskCreate(subject="Research phase", description="...")
|
|
24
|
+
TaskCreate(subject="Implementation phase", description="...")
|
|
25
|
+
TaskCreate(subject="Review phase", description="...")
|
|
26
|
+
|
|
27
|
+
# Sequential dispatch — each agent gets the prior agent's output
|
|
28
|
+
result_a = Agent(name="researcher", team_name="pipeline-team", run_in_background=True,
|
|
29
|
+
prompt="Research: ...", model="haiku")
|
|
30
|
+
# Wait for result_a
|
|
31
|
+
SendMessage(to="researcher", message="shutdown_request")
|
|
32
|
+
|
|
33
|
+
result_b = Agent(name="implementer", team_name="pipeline-team", run_in_background=True,
|
|
34
|
+
prompt="Implement based on research: {result_a}", model="sonnet")
|
|
35
|
+
# Wait for result_b
|
|
36
|
+
SendMessage(to="implementer", message="shutdown_request")
|
|
37
|
+
|
|
38
|
+
result_c = Agent(name="reviewer", team_name="pipeline-team", run_in_background=True,
|
|
39
|
+
prompt="Review implementation: {result_b}", model="sonnet")
|
|
40
|
+
# Wait for result_c
|
|
41
|
+
SendMessage(to="reviewer", message="shutdown_request")
|
|
42
|
+
|
|
43
|
+
# Cleanup
|
|
44
|
+
TeamDelete(team_name="pipeline-team")
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Hybrid Pipeline (with parallel phases)
|
|
48
|
+
|
|
49
|
+
Most real workflows are hybrids — some phases are parallel within a sequential flow:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
Phase 1 (parallel): Research A + Research B + Research C
|
|
53
|
+
↓
|
|
54
|
+
Phase 2 (sequential): Synthesize research → Implementation plan
|
|
55
|
+
↓
|
|
56
|
+
Phase 3 (parallel): Implement Module X + Implement Module Y
|
|
57
|
+
↓
|
|
58
|
+
Phase 4 (parallel): Review X + Review Y + Integration test
|
|
59
|
+
↓
|
|
60
|
+
Phase 5 (sequential): Final aggregation → Report
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Context Passing
|
|
64
|
+
The critical challenge in pipelines is passing sufficient context between stages:
|
|
65
|
+
- **Summarize, don't dump**: Pass the conclusions from phase N, not the raw output
|
|
66
|
+
- **Include original task**: Each agent should see the user's original request
|
|
67
|
+
- **Accumulate decisions**: Keep a running list of decisions made in prior phases
|
|
68
|
+
|
|
69
|
+
## Pitfalls
|
|
70
|
+
- **Context loss**: Each agent starts fresh. Important details from early phases can get lost.
|
|
71
|
+
- **Error propagation**: A mistake in phase 1 cascades through all subsequent phases.
|
|
72
|
+
- **Unnecessary serialization**: Don't pipeline things that could be parallel.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: swarm-output-style
|
|
3
|
+
description: |
|
|
4
|
+
Professional output formatting for swarm agent orchestrations.
|
|
5
|
+
TRIGGER when: orchestrating tasks, presenting plans, reporting results,
|
|
6
|
+
showing agent status, displaying review findings, or any multi-agent output.
|
|
7
|
+
DO NOT TRIGGER for simple single-file edits or conversational responses.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Swarm Output Style Guide
|
|
11
|
+
|
|
12
|
+
## Plan Presentation
|
|
13
|
+
|
|
14
|
+
When presenting an orchestration plan, use this format:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
## Orchestration Plan
|
|
18
|
+
|
|
19
|
+
**Task**: [1-line description]
|
|
20
|
+
**Pattern**: [pattern name]
|
|
21
|
+
**Agents**: [count] | **Phases**: [count] | **Est. cost**: ~$[amount]
|
|
22
|
+
|
|
23
|
+
### Phase 1: [Name] — parallel
|
|
24
|
+
| Agent | Role | Model | Focus |
|
|
25
|
+
|-------|------|-------|-------|
|
|
26
|
+
| `name` | type | model | what they do |
|
|
27
|
+
|
|
28
|
+
### Phase 2: [Name] — sequential (depends on Phase 1)
|
|
29
|
+
| Agent | Role | Model | Focus |
|
|
30
|
+
|-------|------|-------|-------|
|
|
31
|
+
| `name` | type | model | what they do |
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Progress Updates
|
|
35
|
+
|
|
36
|
+
Keep compact. One line per agent with status:
|
|
37
|
+
```
|
|
38
|
+
agent-name [working] current action
|
|
39
|
+
agent-name [done] completed in 12s
|
|
40
|
+
agent-name [idle] waiting for Phase 2
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Do NOT dump raw agent output into progress updates. Summarize.
|
|
44
|
+
|
|
45
|
+
## Agent Reports
|
|
46
|
+
|
|
47
|
+
Each agent includes a Meta block. When aggregating:
|
|
48
|
+
- Lead with the overall result (pass/fail/concerns)
|
|
49
|
+
- Group findings by severity (critical > important > suggestion)
|
|
50
|
+
- Include file:line references
|
|
51
|
+
- Keep it scannable — bullet points, not paragraphs
|
|
52
|
+
|
|
53
|
+
## Final Summary
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
## Summary
|
|
57
|
+
|
|
58
|
+
**Status**: [COMPLETE / NEEDS CHANGES / FAILED]
|
|
59
|
+
|
|
60
|
+
### What was done
|
|
61
|
+
- [bullet points]
|
|
62
|
+
|
|
63
|
+
### Key decisions
|
|
64
|
+
- [bullet points]
|
|
65
|
+
|
|
66
|
+
### Metrics
|
|
67
|
+
Agents: [N] | Phases: [N] | Duration: [time] | Est. cost: ~$[amount]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Anti-Patterns (DO NOT)
|
|
71
|
+
|
|
72
|
+
- Do NOT dump raw agent transcripts into the summary
|
|
73
|
+
- Do NOT use emoji in structured output (alignment issues in terminals)
|
|
74
|
+
- Do NOT repeat the original task description in every status update
|
|
75
|
+
- Do NOT show agent Meta blocks to the user — synthesize them
|
|
76
|
+
- Do NOT use vague language ("various improvements") — be specific
|
|
77
|
+
- Do NOT include timestamps in every line — only in the activity feed
|
|
78
|
+
|
|
79
|
+
## Color Conventions (for terminal output)
|
|
80
|
+
|
|
81
|
+
When outputting to terminal:
|
|
82
|
+
- **Bold** for section headers
|
|
83
|
+
- Agent names in their role color (blue=researcher, green=implementer, yellow=reviewer)
|
|
84
|
+
- Status badges: `[working]` `[done]` `[idle]` `[error]`
|
|
85
|
+
- Keep lines under 80 characters for terminal compatibility
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: add-endpoint
|
|
2
|
+
description: "Add a REST API endpoint with validation, tests, and documentation"
|
|
3
|
+
parameters:
|
|
4
|
+
route:
|
|
5
|
+
type: string
|
|
6
|
+
description: "API route path"
|
|
7
|
+
required: true
|
|
8
|
+
example: "/api/users/:id"
|
|
9
|
+
method:
|
|
10
|
+
type: string
|
|
11
|
+
description: "HTTP method"
|
|
12
|
+
enum: [GET, POST, PUT, PATCH, DELETE]
|
|
13
|
+
required: true
|
|
14
|
+
auth:
|
|
15
|
+
type: boolean
|
|
16
|
+
description: "Requires authentication?"
|
|
17
|
+
default: true
|
|
18
|
+
description:
|
|
19
|
+
type: string
|
|
20
|
+
description: "What the endpoint does"
|
|
21
|
+
required: true
|
|
22
|
+
pattern: review-cycle
|
|
23
|
+
context_files:
|
|
24
|
+
- "src/routes/**/*.ts"
|
|
25
|
+
- "src/middleware/*.ts"
|
|
26
|
+
agents:
|
|
27
|
+
researcher:
|
|
28
|
+
extra_rules:
|
|
29
|
+
- "Find existing endpoint patterns and conventions"
|
|
30
|
+
- "Identify the validation and auth middleware used"
|
|
31
|
+
implementer:
|
|
32
|
+
extra_rules:
|
|
33
|
+
- "Follow the existing route file naming convention"
|
|
34
|
+
- "Include request/response type definitions"
|
|
35
|
+
tester:
|
|
36
|
+
extra_rules:
|
|
37
|
+
- "Test authenticated and unauthenticated requests"
|
|
38
|
+
- "Test validation errors with 400 responses"
|
|
39
|
+
success_criteria:
|
|
40
|
+
- "Endpoint responds to ${method} ${route}"
|
|
41
|
+
- "Auth middleware applied if auth=true"
|
|
42
|
+
- "Input validation with error responses"
|
|
43
|
+
- "At least 3 test cases"
|
|
44
|
+
tags: [api, backend]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: add-feature
|
|
2
|
+
description: "Add a new feature with tests and documentation"
|
|
3
|
+
parameters:
|
|
4
|
+
feature:
|
|
5
|
+
type: string
|
|
6
|
+
description: "Feature description"
|
|
7
|
+
required: true
|
|
8
|
+
test_framework:
|
|
9
|
+
type: string
|
|
10
|
+
description: "Test framework to use"
|
|
11
|
+
default: "jest"
|
|
12
|
+
pattern: hybrid
|
|
13
|
+
agents:
|
|
14
|
+
researcher:
|
|
15
|
+
extra_rules:
|
|
16
|
+
- "Understand how similar features are implemented in the codebase"
|
|
17
|
+
- "Identify affected modules and potential side effects"
|
|
18
|
+
implementer:
|
|
19
|
+
extra_rules:
|
|
20
|
+
- "Follow existing code patterns and conventions"
|
|
21
|
+
- "Write tests using ${test_framework}"
|
|
22
|
+
reviewer:
|
|
23
|
+
extra_rules:
|
|
24
|
+
- "Check for edge cases and error handling"
|
|
25
|
+
- "Verify test coverage"
|
|
26
|
+
success_criteria:
|
|
27
|
+
- "Feature works as described"
|
|
28
|
+
- "Tests pass with good coverage"
|
|
29
|
+
- "No regressions"
|
|
30
|
+
tags: [feature, implementation]
|