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,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-system
|
|
3
|
+
description: |
|
|
4
|
+
Project design system for consistent, high-quality UI across all implementations.
|
|
5
|
+
TRIGGER when: building any frontend, UI, web page, component, dashboard, form, or
|
|
6
|
+
user-facing interface. Also triggers on: "style", "design", "layout", "theme",
|
|
7
|
+
"CSS", "component", "page", "responsive".
|
|
8
|
+
DO NOT TRIGGER for: backend code, scripts, CLI tools, documentation.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Design System
|
|
12
|
+
|
|
13
|
+
This is the project's visual identity. Follow it exactly. Do not deviate.
|
|
14
|
+
|
|
15
|
+
## Aesthetic: Clean, Light, Spacious
|
|
16
|
+
|
|
17
|
+
Inspired by Vercel and Stripe — precision engineering expressed visually. Every pixel is intentional. Nothing decorative. Nothing gratuitous.
|
|
18
|
+
|
|
19
|
+
**The feel:** Calm authority. Like a well-designed instrument — everything exactly where it should be, nothing extra.
|
|
20
|
+
|
|
21
|
+
## Typography
|
|
22
|
+
|
|
23
|
+
**Font stack (in order of preference):**
|
|
24
|
+
- Headings: `'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif`
|
|
25
|
+
- Body: `'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif`
|
|
26
|
+
- Code/monospace: `'Geist Mono', 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace`
|
|
27
|
+
|
|
28
|
+
**Scale:**
|
|
29
|
+
```
|
|
30
|
+
--text-xs: 0.75rem / 12px
|
|
31
|
+
--text-sm: 0.875rem / 14px
|
|
32
|
+
--text-base: 1rem / 16px
|
|
33
|
+
--text-lg: 1.125rem / 18px
|
|
34
|
+
--text-xl: 1.25rem / 20px
|
|
35
|
+
--text-2xl: 1.5rem / 24px
|
|
36
|
+
--text-3xl: 1.875rem / 30px
|
|
37
|
+
--text-4xl: 2.25rem / 36px
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Rules:**
|
|
41
|
+
- Body text: 16px, line-height 1.6, `--color-text-secondary` for most text
|
|
42
|
+
- Headings: semibold (600), tight letter-spacing (-0.02em), `--color-text-primary`
|
|
43
|
+
- Labels/captions: 12-14px, uppercase tracking (0.05em), `--color-text-tertiary`
|
|
44
|
+
- Never bold body text. Use weight only for headings and emphasis.
|
|
45
|
+
- Maximum line width: 65ch for prose, 80ch for code
|
|
46
|
+
|
|
47
|
+
## Color
|
|
48
|
+
|
|
49
|
+
**Light mode (default):**
|
|
50
|
+
```
|
|
51
|
+
--color-bg: #ffffff
|
|
52
|
+
--color-bg-subtle: #fafafa
|
|
53
|
+
--color-bg-muted: #f4f4f5
|
|
54
|
+
--color-bg-elevated: #ffffff (with shadow)
|
|
55
|
+
|
|
56
|
+
--color-border: #e4e4e7
|
|
57
|
+
--color-border-subtle: #f4f4f5
|
|
58
|
+
|
|
59
|
+
--color-text-primary: #09090b
|
|
60
|
+
--color-text-secondary: #3f3f46
|
|
61
|
+
--color-text-tertiary: #a1a1aa
|
|
62
|
+
|
|
63
|
+
--color-accent: #18181b (near-black — the Vercel approach)
|
|
64
|
+
--color-accent-hover: #27272a
|
|
65
|
+
|
|
66
|
+
--color-success: #22c55e
|
|
67
|
+
--color-warning: #f59e0b
|
|
68
|
+
--color-error: #ef4444
|
|
69
|
+
--color-info: #3b82f6
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Dark mode:**
|
|
73
|
+
```
|
|
74
|
+
--color-bg: #09090b
|
|
75
|
+
--color-bg-subtle: #18181b
|
|
76
|
+
--color-bg-muted: #27272a
|
|
77
|
+
--color-bg-elevated: #18181b (with subtle border)
|
|
78
|
+
|
|
79
|
+
--color-border: #27272a
|
|
80
|
+
--color-border-subtle: #1c1c1e
|
|
81
|
+
|
|
82
|
+
--color-text-primary: #fafafa
|
|
83
|
+
--color-text-secondary: #a1a1aa
|
|
84
|
+
--color-text-tertiary: #71717a
|
|
85
|
+
|
|
86
|
+
--color-accent: #fafafa (near-white)
|
|
87
|
+
--color-accent-hover: #e4e4e7
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Rules:**
|
|
91
|
+
- No gradients unless they serve a specific purpose
|
|
92
|
+
- No colored backgrounds for sections — use whitespace to separate
|
|
93
|
+
- Accent color is near-black (light) or near-white (dark) — let the content be the color
|
|
94
|
+
- Status colors (success/warning/error) used sparingly, only for actual status
|
|
95
|
+
- Never use blue for links — use `--color-text-primary` with underline on hover
|
|
96
|
+
|
|
97
|
+
## Spacing
|
|
98
|
+
|
|
99
|
+
**Scale (8px base):**
|
|
100
|
+
```
|
|
101
|
+
--space-1: 0.25rem / 4px
|
|
102
|
+
--space-2: 0.5rem / 8px
|
|
103
|
+
--space-3: 0.75rem / 12px
|
|
104
|
+
--space-4: 1rem / 16px
|
|
105
|
+
--space-5: 1.25rem / 20px
|
|
106
|
+
--space-6: 1.5rem / 24px
|
|
107
|
+
--space-8: 2rem / 32px
|
|
108
|
+
--space-10: 2.5rem / 40px
|
|
109
|
+
--space-12: 3rem / 48px
|
|
110
|
+
--space-16: 4rem / 64px
|
|
111
|
+
--space-20: 5rem / 80px
|
|
112
|
+
--space-24: 6rem / 96px
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Rules:**
|
|
116
|
+
- Page padding: `--space-6` minimum on mobile, `--space-16` on desktop
|
|
117
|
+
- Section spacing: `--space-16` to `--space-24` between major sections
|
|
118
|
+
- Card padding: `--space-6` to `--space-8`
|
|
119
|
+
- Generous whitespace always. When in doubt, add more space.
|
|
120
|
+
- Consistent rhythm — pick a spacing value and repeat it. Don't use 7 different margins.
|
|
121
|
+
|
|
122
|
+
## Layout
|
|
123
|
+
|
|
124
|
+
**Grid:** 12-column on desktop, single column on mobile. Max content width: 1200px.
|
|
125
|
+
|
|
126
|
+
**Rules:**
|
|
127
|
+
- Left-aligned content, not centered (unless it's a hero/landing)
|
|
128
|
+
- No card grids where a simple list would do
|
|
129
|
+
- Navigation: top bar or left sidebar, never both
|
|
130
|
+
- Content hierarchy through typography and spacing, not boxes and borders
|
|
131
|
+
- Forms: single column, full-width inputs, clear labels above (not inline)
|
|
132
|
+
- Tables: clean, minimal borders (top/bottom only or none), generous row padding
|
|
133
|
+
|
|
134
|
+
## Components
|
|
135
|
+
|
|
136
|
+
**Buttons:**
|
|
137
|
+
- Primary: `--color-accent` bg, white text, no border, subtle hover darkening
|
|
138
|
+
- Secondary: transparent bg, `--color-border` border, text color matches border
|
|
139
|
+
- Size: 36px height default, 14px font, `--space-4` horizontal padding
|
|
140
|
+
- Border-radius: 6px (not fully rounded — that's a fad)
|
|
141
|
+
- No shadows on buttons. No gradients.
|
|
142
|
+
|
|
143
|
+
**Inputs:**
|
|
144
|
+
- Height: 40px
|
|
145
|
+
- Border: 1px `--color-border`
|
|
146
|
+
- Border-radius: 6px
|
|
147
|
+
- Focus: 2px ring in `--color-accent` with 2px offset
|
|
148
|
+
- Background: `--color-bg` (not gray)
|
|
149
|
+
- Placeholder text: `--color-text-tertiary`
|
|
150
|
+
|
|
151
|
+
**Cards:**
|
|
152
|
+
- Background: `--color-bg-elevated`
|
|
153
|
+
- Border: 1px `--color-border-subtle` OR shadow, never both
|
|
154
|
+
- Shadow (if used): `0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06)`
|
|
155
|
+
- Border-radius: 8px
|
|
156
|
+
- No colored headers. No icons in corners.
|
|
157
|
+
|
|
158
|
+
**Tables:**
|
|
159
|
+
- No zebra striping
|
|
160
|
+
- Header: semibold, `--color-text-tertiary`, uppercase 12px with tracking
|
|
161
|
+
- Rows: `--color-border-subtle` bottom border only
|
|
162
|
+
- Cell padding: `--space-3` vertical, `--space-4` horizontal
|
|
163
|
+
- Align numbers right, text left
|
|
164
|
+
|
|
165
|
+
## Animations
|
|
166
|
+
|
|
167
|
+
- Duration: 150ms for micro-interactions, 300ms for layout changes
|
|
168
|
+
- Easing: `cubic-bezier(0.4, 0, 0.2, 1)` (Material standard)
|
|
169
|
+
- What to animate: opacity, transform (translate/scale), color, border-color
|
|
170
|
+
- What NOT to animate: width, height, margin, padding (causes layout thrash)
|
|
171
|
+
- Page transitions: fade (opacity 0→1, 150ms)
|
|
172
|
+
- No bouncing, no elastic, no spring physics unless it's a playful context
|
|
173
|
+
|
|
174
|
+
## Anti-Patterns (NEVER do these)
|
|
175
|
+
|
|
176
|
+
- Colored section backgrounds (the "alternating gray/white sections" pattern)
|
|
177
|
+
- Hero sections with stock imagery or abstract gradients
|
|
178
|
+
- Card grids with icons and 3 bullet points (the "SaaS features" pattern)
|
|
179
|
+
- Rounded pill buttons on everything
|
|
180
|
+
- Drop shadows on everything
|
|
181
|
+
- "Glass morphism" / frosted glass on cards
|
|
182
|
+
- Centering everything — left-align by default
|
|
183
|
+
- Using 5+ font weights — stick to regular (400) and semibold (600)
|
|
184
|
+
- Purple-to-blue gradients (the universal AI slop gradient)
|
|
185
|
+
- Emoji as design elements in professional interfaces
|
|
186
|
+
|
|
187
|
+
## Implementation
|
|
188
|
+
|
|
189
|
+
When building a new page or component:
|
|
190
|
+
1. Check if the project has an existing CSS/design system — use it
|
|
191
|
+
2. If starting fresh, implement these tokens as CSS custom properties
|
|
192
|
+
3. Use Tailwind if the project uses it — but follow THIS system's values, not Tailwind defaults
|
|
193
|
+
4. Semantic HTML first, styling second
|
|
194
|
+
5. Mobile-first responsive design
|
|
195
|
+
6. Support both light and dark mode via `prefers-color-scheme`
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orchestration-patterns
|
|
3
|
+
description: |
|
|
4
|
+
Knowledge about swarm orchestration patterns for coordinating parallel sub-agents.
|
|
5
|
+
TRIGGER when: user mentions "orchestrate", "parallel agents", "fan-out", "swarm",
|
|
6
|
+
"dispatch agents", "agent coordination", "concurrent", "multi-agent", "batch migration",
|
|
7
|
+
"red-team", "debate", "chaos", "emergence", "adversarial", "brownian", "builder breaker",
|
|
8
|
+
"ambient", "background", "discover", "hypothesis", "experiment", "grounding",
|
|
9
|
+
"reality check", "human role",
|
|
10
|
+
or asks how to break a task into parallel work.
|
|
11
|
+
DO NOT TRIGGER for simple tasks that don't need orchestration.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Swarm Orchestration Patterns
|
|
15
|
+
|
|
16
|
+
## Quick Reference
|
|
17
|
+
|
|
18
|
+
### When to Orchestrate
|
|
19
|
+
Use orchestration when a task has **3+ independent work units** that can run concurrently.
|
|
20
|
+
Do NOT orchestrate simple, linear tasks — the overhead isn't worth it.
|
|
21
|
+
|
|
22
|
+
### Pattern Selection
|
|
23
|
+
|
|
24
|
+
| Pattern | When to Use | Example |
|
|
25
|
+
|---------|------------|---------|
|
|
26
|
+
| **Fan-out/Fan-in** | N independent tasks, aggregate results | Research 5 different aspects of a system |
|
|
27
|
+
| **Pipeline** | Sequential dependencies, each step feeds the next | Parse → Transform → Validate → Write |
|
|
28
|
+
| **Hybrid** | Research first, then implement, then review | Most feature development |
|
|
29
|
+
| **Review Cycle** | Implementation needs quality gates | Security-sensitive changes |
|
|
30
|
+
| **Batch** | Same operation on many targets | Migrate 20 files to new format |
|
|
31
|
+
| **Competitive** | Optimal approach is uncertain | Spike: try 2 approaches, pick best |
|
|
32
|
+
| **Iterative** | Quality gate required before shipping | Security-sensitive changes, complex logic |
|
|
33
|
+
| **Adversarial** | Need to verify robustness, security-critical code | /red-team: build + break simultaneously |
|
|
34
|
+
| **Debate** | Uncertain code quality, need multi-perspective consensus | /debate: multi-round argumentation |
|
|
35
|
+
| **Chaos** | Broad improvements with no specific requirements | /chaos: brownian ratchet, CI filters |
|
|
36
|
+
| **Emergence** | Experimental — can agents self-organize? | /emergence: identical agents, no roles |
|
|
37
|
+
|
|
38
|
+
### Model Routing
|
|
39
|
+
|
|
40
|
+
| Task | Model | Rationale |
|
|
41
|
+
|------|-------|-----------|
|
|
42
|
+
| File search, listing, simple greps | haiku | Fast, cheap, sufficient for pattern matching |
|
|
43
|
+
| Documentation writing | haiku | Straightforward content generation |
|
|
44
|
+
| Codebase exploration, tracing flows | sonnet | Needs comprehension but not generation |
|
|
45
|
+
| Convention review | sonnet | Pattern matching against existing style |
|
|
46
|
+
| Code implementation | opus | Writing correct code requires deep reasoning |
|
|
47
|
+
| Security review | opus | Must catch subtle vulnerabilities |
|
|
48
|
+
| Correctness review | opus | Must reason about edge cases and logic |
|
|
49
|
+
| Debugging | opus | Root cause analysis requires deep understanding |
|
|
50
|
+
| Architecture decisions | opus | Complex trade-off reasoning |
|
|
51
|
+
| Test writing (complex) | opus | Must understand code deeply to test it well |
|
|
52
|
+
|
|
53
|
+
### Dispatch Checklist
|
|
54
|
+
Before dispatching a sub-agent, verify your prompt includes:
|
|
55
|
+
- [ ] Specific file paths and line numbers to focus on
|
|
56
|
+
- [ ] Relevant context from prior phases
|
|
57
|
+
- [ ] Clear success criteria
|
|
58
|
+
- [ ] Project conventions (from CLAUDE.md if present)
|
|
59
|
+
- [ ] Scope boundaries (what NOT to touch)
|
|
60
|
+
- [ ] Scratchpad path included for cross-agent communication
|
|
61
|
+
- [ ] Self-assessment fields (Confidence, Blockers, Files touched) requested in output
|
|
62
|
+
- [ ] Agent spawned as team member (team_name, name, run_in_background: true)
|
|
63
|
+
|
|
64
|
+
### Anti-Patterns to Avoid
|
|
65
|
+
1. **Over-orchestration**: Don't use 5 agents for a 10-line change
|
|
66
|
+
2. **Starving context**: Sub-agents can't ask questions — give them everything
|
|
67
|
+
3. **File conflicts**: Two agents editing the same file = merge hell
|
|
68
|
+
4. **Model waste**: Don't use opus for file search or documentation
|
|
69
|
+
5. **Sequential disguised as parallel**: If B depends on A's output, don't pretend they're parallel
|
|
70
|
+
|
|
71
|
+
### Cost Estimation Reference
|
|
72
|
+
|
|
73
|
+
| Model | Typical per-agent cost | Use for |
|
|
74
|
+
|-------|----------------------|---------|
|
|
75
|
+
| haiku | ~$0.02 | File search, documentation, simple greps |
|
|
76
|
+
| sonnet | ~$0.08 | Research, exploration, convention review |
|
|
77
|
+
| opus | ~$0.40 | Implementation, security review, debugging, testing |
|
|
78
|
+
|
|
79
|
+
Include estimated cost in every orchestration plan: sum of (agent count × per-model cost).
|
|
80
|
+
|
|
81
|
+
For detailed pattern documentation, see the references/ directory.
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# Example Orchestration Workflows
|
|
2
|
+
|
|
3
|
+
## Example 1: Feature Development (Hybrid Pattern)
|
|
4
|
+
|
|
5
|
+
**Task**: "Add WebSocket support to the notification system"
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Phase 1: Research (parallel, 3 agents, sonnet)
|
|
9
|
+
├── Researcher A: Current notification architecture (models, routes, services)
|
|
10
|
+
├── Researcher B: Existing WebSocket patterns in codebase (if any)
|
|
11
|
+
└── Researcher C: Test infrastructure and patterns for async code
|
|
12
|
+
|
|
13
|
+
Phase 2: Architecture (sequential, 1 agent, opus)
|
|
14
|
+
└── Orchestrator synthesizes research → proposes WebSocket architecture
|
|
15
|
+
|
|
16
|
+
Phase 3: Implementation (parallel, 2 agents, opus)
|
|
17
|
+
├── Implementer A: WebSocket server + connection manager
|
|
18
|
+
└── Implementer B: Client notification handlers + event types
|
|
19
|
+
|
|
20
|
+
Phase 4: Testing (parallel, 2 agents, opus)
|
|
21
|
+
├── Tester A: Unit tests for WebSocket server
|
|
22
|
+
└── Tester B: Integration tests for notification flow
|
|
23
|
+
|
|
24
|
+
Phase 5: Review (parallel, 2 agents, opus)
|
|
25
|
+
├── Reviewer A: Correctness + error handling review
|
|
26
|
+
└── Reviewer B: Security review (auth, connection limits, data exposure)
|
|
27
|
+
|
|
28
|
+
Result: 10 sub-agents, 5 phases, ~4 parallel dispatches
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Example 2: Bug Investigation (Pipeline + Fan-out)
|
|
32
|
+
|
|
33
|
+
**Task**: "Users report intermittent 500 errors on /api/workflows"
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Phase 1: Research (parallel, 3 agents, sonnet)
|
|
37
|
+
├── Researcher A: Recent changes to workflow endpoints (git log)
|
|
38
|
+
├── Researcher B: Error handling and logging in workflow routes
|
|
39
|
+
└── Researcher C: Database queries and connection patterns in workflows
|
|
40
|
+
|
|
41
|
+
Phase 2: Diagnosis (sequential, 1 agent, opus)
|
|
42
|
+
└── Debugger: Synthesize research, form hypotheses, trace root cause
|
|
43
|
+
|
|
44
|
+
Phase 3: Fix (sequential, 1 agent, opus)
|
|
45
|
+
└── Implementer: Apply minimal fix based on diagnosis
|
|
46
|
+
|
|
47
|
+
Phase 4: Verify (parallel, 2 agents, opus)
|
|
48
|
+
├── Tester: Write regression test, run test suite
|
|
49
|
+
└── Reviewer: Review fix for correctness and side effects
|
|
50
|
+
|
|
51
|
+
Result: 7 sub-agents, 4 phases
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Example 3: Code Migration (Batch Pattern)
|
|
55
|
+
|
|
56
|
+
**Task**: "Migrate all 15 connector plugins from sync to async"
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Phase 1: Research (parallel, 2 agents, sonnet)
|
|
60
|
+
├── Researcher A: Current sync connector interface and patterns
|
|
61
|
+
└── Researcher B: Target async interface and migration requirements
|
|
62
|
+
|
|
63
|
+
Phase 2: Template (sequential, 1 agent, opus)
|
|
64
|
+
└── Create migration template based on research
|
|
65
|
+
|
|
66
|
+
Phase 3: Batch Migration (parallel, 15 agents, opus, worktree isolation)
|
|
67
|
+
├── Implementer 1: Migrate connector_s3.py
|
|
68
|
+
├── Implementer 2: Migrate connector_gcs.py
|
|
69
|
+
├── ...
|
|
70
|
+
└── Implementer 15: Migrate connector_azure.py
|
|
71
|
+
|
|
72
|
+
Phase 4: Integration (sequential, 1 agent, opus)
|
|
73
|
+
└── Verify all connectors work together, run integration tests
|
|
74
|
+
|
|
75
|
+
Result: 19 sub-agents, 4 phases, each migration gets its own PR
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Example 4: Multi-Angle Research (Fan-out/Fan-in)
|
|
79
|
+
|
|
80
|
+
**Task**: "How does our auth system work end-to-end?"
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Phase 1: Research (parallel, 4 agents, sonnet)
|
|
84
|
+
├── Researcher A: Authentication entry points (login, OAuth, API keys)
|
|
85
|
+
├── Researcher B: Token lifecycle (creation, refresh, revocation)
|
|
86
|
+
├── Researcher C: Authorization middleware and permission checks
|
|
87
|
+
└── Researcher D: Session management and storage
|
|
88
|
+
|
|
89
|
+
Phase 2: Synthesis (sequential, orchestrator)
|
|
90
|
+
└── Merge all findings into comprehensive auth system documentation
|
|
91
|
+
|
|
92
|
+
Result: 4 sub-agents, 2 phases, produces architecture doc
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Example 5: PR Review (Fan-out/Fan-in)
|
|
96
|
+
|
|
97
|
+
**Task**: "Review PR #142 thoroughly"
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
Phase 1: Context (parallel, 2 agents, sonnet)
|
|
101
|
+
├── Researcher A: Understand PR scope from diff and commits
|
|
102
|
+
└── Researcher B: Read related CLAUDE.md and project conventions
|
|
103
|
+
|
|
104
|
+
Phase 2: Review (parallel, 3 agents, opus)
|
|
105
|
+
├── Reviewer A: Correctness — bugs, logic errors, edge cases
|
|
106
|
+
├── Reviewer B: Security — vulnerabilities, data exposure, auth
|
|
107
|
+
└── Reviewer C: Quality — patterns, naming, complexity, tests
|
|
108
|
+
|
|
109
|
+
Phase 3: Aggregate (sequential, orchestrator)
|
|
110
|
+
└── Prioritize findings: Critical > Important > Suggestions > Strengths
|
|
111
|
+
|
|
112
|
+
Result: 5 sub-agents, 3 phases
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Example 6: Design Spike (Competitive Pattern)
|
|
116
|
+
|
|
117
|
+
**Task**: "Should we use WebSockets or Server-Sent Events for real-time updates?"
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
Phase 1: Research (parallel, 2 agents, sonnet)
|
|
121
|
+
├── Researcher A: WebSocket patterns, complexity, browser support
|
|
122
|
+
└── Researcher B: SSE patterns, complexity, browser support
|
|
123
|
+
|
|
124
|
+
Phase 2: Implement (parallel, 2 agents, opus, worktree isolation)
|
|
125
|
+
├── Implementer A: WebSocket implementation
|
|
126
|
+
└── Implementer B: SSE implementation
|
|
127
|
+
|
|
128
|
+
Phase 3: Evaluate (parallel, 2 agents, opus)
|
|
129
|
+
├── Reviewer A: Review WebSocket approach
|
|
130
|
+
└── Reviewer B: Review SSE approach
|
|
131
|
+
|
|
132
|
+
Phase 4: Select (sequential)
|
|
133
|
+
└── Present comparison table, user picks
|
|
134
|
+
|
|
135
|
+
Result: 6 sub-agents, 4 phases, 2 working prototypes to compare
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Example 7: Iterative Quality Gate (Iterative Pattern)
|
|
139
|
+
|
|
140
|
+
**Task**: "Implement the payment processing module — must pass security review"
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
Phase 1: Research (parallel, 2 agents, sonnet)
|
|
144
|
+
├── Researcher A: Payment processing patterns in codebase
|
|
145
|
+
└── Researcher B: Security requirements and compliance constraints
|
|
146
|
+
|
|
147
|
+
Phase 2: Implement (sequential, 1 agent, opus)
|
|
148
|
+
└── Implementer: Build payment module based on research
|
|
149
|
+
|
|
150
|
+
Phase 3-4: Review-Fix Loop (max 3 iterations)
|
|
151
|
+
├── Iteration 1:
|
|
152
|
+
│ ├── Review: 2 critical (SQL injection, missing auth check)
|
|
153
|
+
│ └── Fix: Parameterized queries, added auth middleware
|
|
154
|
+
├── Iteration 2:
|
|
155
|
+
│ ├── Review: 1 important (insufficient input validation)
|
|
156
|
+
│ └── Fix: Added validation layer
|
|
157
|
+
└── Iteration 3:
|
|
158
|
+
└── Review: PASS (0 critical, 0 important)
|
|
159
|
+
|
|
160
|
+
Result: 7+ sub-agents, 4+ phases, guaranteed quality gate
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Example 8: Test-Driven Development (TDD Pattern)
|
|
164
|
+
|
|
165
|
+
**Task**: "Add rate limiting to the API gateway"
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
Phase 1: Research (parallel, 2 agents, sonnet)
|
|
169
|
+
├── Researcher A: Current API gateway middleware stack
|
|
170
|
+
└── Researcher B: Test infrastructure and patterns
|
|
171
|
+
|
|
172
|
+
Phase 2: Write Failing Tests (sequential, 1 agent, opus)
|
|
173
|
+
└── Tester: Write rate limit tests (per-user, per-endpoint, burst)
|
|
174
|
+
Tests run: 5 new tests, all RED ✗
|
|
175
|
+
|
|
176
|
+
Phase 3: Implement (sequential, 1 agent, opus)
|
|
177
|
+
└── Implementer: Implement rate limiter to pass tests
|
|
178
|
+
Tests run: 5 new tests, all GREEN ✓
|
|
179
|
+
|
|
180
|
+
Phase 4: Review (parallel, 2 agents)
|
|
181
|
+
├── Reviewer A (opus): Correctness + edge cases
|
|
182
|
+
└── Reviewer B (sonnet): Convention compliance
|
|
183
|
+
|
|
184
|
+
Result: 6 sub-agents, 4 phases, test-first guarantee
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Example 9: Fix PR Review Comments (Fan-out Pattern)
|
|
188
|
+
|
|
189
|
+
**Task**: "Fix the 8 review comments on PR #142"
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
Phase 1: Gather (sequential, orchestrator)
|
|
193
|
+
└── Fetch PR comments via gh, group by file
|
|
194
|
+
|
|
195
|
+
Phase 2: Fix (parallel, 3 agents, opus)
|
|
196
|
+
├── Implementer A: Fix 3 comments in src/auth/ files
|
|
197
|
+
├── Implementer B: Fix 3 comments in src/api/ files
|
|
198
|
+
└── Implementer C: Fix 2 comments in src/models/ files
|
|
199
|
+
|
|
200
|
+
Phase 3: Verify (parallel, 2 agents)
|
|
201
|
+
├── Tester: Run test suite
|
|
202
|
+
└── Reviewer: Verify each comment was properly addressed
|
|
203
|
+
|
|
204
|
+
Result: 5 sub-agents, 3 phases, systematic comment resolution
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Example 10: Adversarial Red Team (Adversarial Pattern)
|
|
208
|
+
|
|
209
|
+
**Task**: "Implement payment processing with security hardening"
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
Phase 1: Research (parallel, 2 agents, sonnet)
|
|
213
|
+
├── Researcher A: Payment processing patterns
|
|
214
|
+
└── Researcher B: Common payment security vulnerabilities
|
|
215
|
+
|
|
216
|
+
Phase 2: Build (sequential, 1 agent, opus)
|
|
217
|
+
└── Builder: Implement payment module
|
|
218
|
+
|
|
219
|
+
Phase 3: Break (parallel, 3 agents, opus)
|
|
220
|
+
├── Breaker A: Edge cases (null amounts, negative, overflow)
|
|
221
|
+
├── Breaker B: Security attacks (injection, auth bypass)
|
|
222
|
+
└── Breaker C: Mutation testing (flip conditions, remove checks)
|
|
223
|
+
|
|
224
|
+
Phase 4: Harden (sequential, 1 agent, opus)
|
|
225
|
+
└── Hardener: Fix all Critical findings from breakers
|
|
226
|
+
|
|
227
|
+
Result: 7 sub-agents, 4 phases, adversarially-hardened code
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Example 11: Multi-Agent Debate (Debate Pattern)
|
|
231
|
+
|
|
232
|
+
**Task**: "Review the new caching layer for production readiness"
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
Phase 1: Independent Review (parallel, 3 agents)
|
|
236
|
+
├── Reviewer Alpha (opus): Correctness + logic
|
|
237
|
+
├── Reviewer Beta (opus): Architecture + performance
|
|
238
|
+
└── Reviewer Gamma (sonnet): Conventions + tests
|
|
239
|
+
|
|
240
|
+
Phase 2: Debate Round (parallel, 3 agents)
|
|
241
|
+
├── Debater Alpha: Responds to Beta+Gamma findings
|
|
242
|
+
├── Debater Beta: Responds to Alpha+Gamma findings
|
|
243
|
+
└── Debater Gamma: Responds to Alpha+Beta findings
|
|
244
|
+
|
|
245
|
+
Phase 3: Verdict (sequential)
|
|
246
|
+
└── Aggregate: consensus rules, confidence-weighted
|
|
247
|
+
|
|
248
|
+
Result: 6 sub-agents, 3 phases, high-confidence verdict
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Example 12: Brownian Ratchet (Chaos Pattern)
|
|
252
|
+
|
|
253
|
+
**Task**: "Improve test coverage across src/utils/"
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
Phase 1: Decompose (sequential)
|
|
257
|
+
└── Break into 4 overlapping focus areas
|
|
258
|
+
|
|
259
|
+
Phase 2: Swarm (parallel, 4 agents, opus, worktree isolation)
|
|
260
|
+
├── Chaos 1: Focus on string utilities
|
|
261
|
+
├── Chaos 2: Focus on date/time utilities
|
|
262
|
+
├── Chaos 3: Focus on validation utilities
|
|
263
|
+
└── Chaos 4: Focus on error handling utilities
|
|
264
|
+
|
|
265
|
+
Phase 3: Ratchet (sequential)
|
|
266
|
+
├── Chaos 1: tests pass → merge
|
|
267
|
+
├── Chaos 2: tests pass → merge
|
|
268
|
+
├── Chaos 3: tests fail → discard
|
|
269
|
+
└── Chaos 4: tests pass → merge
|
|
270
|
+
|
|
271
|
+
Result: 4 agents, 3 merged, 1 discarded, net +47 tests
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Example 13: Self-Organizing Agents (Emergence Pattern)
|
|
275
|
+
|
|
276
|
+
**Task**: "Build a notification system"
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
Phase 1: Spawn (parallel, 5 identical general-purpose agents, opus)
|
|
280
|
+
├── Agent 1 → emerged as: researcher (explored existing code)
|
|
281
|
+
├── Agent 2 → emerged as: planner (wrote design doc)
|
|
282
|
+
├── Agent 3 → emerged as: implementer (wrote notification service)
|
|
283
|
+
├── Agent 4 → emerged as: tester (wrote test suite)
|
|
284
|
+
└── Agent 5 → emerged as: reviewer (reviewed agent 3's code)
|
|
285
|
+
|
|
286
|
+
Phase 2: Observe
|
|
287
|
+
└── All agents self-organized via scratchpad coordination
|
|
288
|
+
|
|
289
|
+
Result: 5 agents, no pre-assigned roles, emergent specialization
|
|
290
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Adversarial / Red Team Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Builder and breaker agents work simultaneously. One implements, the other tries to destroy. The code that survives both is genuinely robust.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Security-critical features (auth, payments, data handling)
|
|
8
|
+
- Code that must handle adversarial inputs
|
|
9
|
+
- Features where edge case coverage is critical
|
|
10
|
+
- Any code where "it works in the happy path" isn't enough
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
┌─── Builder (implement) ───┐
|
|
15
|
+
│ │
|
|
16
|
+
User Task ─→ Plan ─┤ ├─→ Harden ─→ Result
|
|
17
|
+
│ │
|
|
18
|
+
└─── Breakers (3 parallel) ──┘
|
|
19
|
+
- Edge cases
|
|
20
|
+
- Security attacks
|
|
21
|
+
- Mutation testing
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Implementation
|
|
25
|
+
```
|
|
26
|
+
# Setup
|
|
27
|
+
TeamCreate(team_name="red-team")
|
|
28
|
+
|
|
29
|
+
# Phase 1: Build
|
|
30
|
+
Agent(name="builder", team_name="red-team", run_in_background=True,
|
|
31
|
+
prompt="Implement: ...", model="opus")
|
|
32
|
+
|
|
33
|
+
# Phase 2: Break (parallel)
|
|
34
|
+
Agent(name="breaker-edges", team_name="red-team", run_in_background=True,
|
|
35
|
+
prompt="Find edge cases: ...", model="opus")
|
|
36
|
+
Agent(name="breaker-security", team_name="red-team", run_in_background=True,
|
|
37
|
+
prompt="Attack security: ...", model="opus")
|
|
38
|
+
Agent(name="breaker-mutations", team_name="red-team", run_in_background=True,
|
|
39
|
+
prompt="Mutation test: ...", model="opus")
|
|
40
|
+
|
|
41
|
+
# Phase 3: Harden
|
|
42
|
+
Agent(name="hardener", team_name="red-team", run_in_background=True,
|
|
43
|
+
prompt="Fix critical findings: ...", model="opus")
|
|
44
|
+
|
|
45
|
+
# Shutdown all, TeamDelete
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Pitfalls
|
|
49
|
+
- **Breakers too aggressive**: Finding 50 theoretical issues when 3 are real. Focus on Critical/Important only.
|
|
50
|
+
- **Builder demoralized**: The builder's code gets torn apart. Frame it as strengthening, not criticism.
|
|
51
|
+
- **False positives**: Breakers may flag things that aren't actually vulnerabilities. Harden only confirmed issues.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Batch Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Apply the same operation to N independent targets simultaneously. Each agent gets the same instructions but different scope.
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
- Migrating many files to a new format
|
|
8
|
+
- Applying the same refactor across multiple modules
|
|
9
|
+
- Running the same analysis on multiple components
|
|
10
|
+
- Any "for each X, do Y" task where X's are independent
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
```
|
|
14
|
+
┌─── Agent(target=file1.py) ───┐
|
|
15
|
+
│ │
|
|
16
|
+
Template ─→ Plan ─→┼─── Agent(target=file2.py) ───┼─→ Summary
|
|
17
|
+
│ │
|
|
18
|
+
└─── Agent(target=file3.py) ───┘
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Implementation
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
# Define the template once
|
|
25
|
+
template = """
|
|
26
|
+
Migrate {target} from v1 to v2 API format:
|
|
27
|
+
1. Replace `client.get()` with `client.request(method="GET")`
|
|
28
|
+
2. Add error handling wrapper
|
|
29
|
+
3. Update imports
|
|
30
|
+
4. Run tests for this module
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
# Setup
|
|
34
|
+
TeamCreate(team_name="batch-team")
|
|
35
|
+
for target in targets:
|
|
36
|
+
TaskCreate(subject=f"Migrate {target}", description="...")
|
|
37
|
+
|
|
38
|
+
# Dispatch one agent per target, all as teammates in parallel
|
|
39
|
+
agents = []
|
|
40
|
+
for i, target in enumerate(targets):
|
|
41
|
+
name = f"migrator-{i}"
|
|
42
|
+
agents.append(name)
|
|
43
|
+
Agent(name=name, team_name="batch-team", run_in_background=True,
|
|
44
|
+
prompt=template.format(target=target), model="sonnet", isolation="worktree")
|
|
45
|
+
|
|
46
|
+
# After all complete, shutdown each teammate
|
|
47
|
+
for name in agents:
|
|
48
|
+
SendMessage(to=name, message="shutdown_request")
|
|
49
|
+
TeamDelete(team_name="batch-team")
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Worktree Isolation
|
|
53
|
+
For batch operations that modify files, use `isolation: "worktree"` so each agent works on its own copy. This avoids merge conflicts and lets each agent's changes be reviewed independently (each opens a separate PR).
|
|
54
|
+
|
|
55
|
+
## Sizing Guidelines
|
|
56
|
+
- **Sweet spot**: 5-15 units per batch
|
|
57
|
+
- **Too few** (< 3): Just do it sequentially, overhead isn't worth it
|
|
58
|
+
- **Too many** (> 20): Token costs add up fast, consider batching in waves
|
|
59
|
+
|
|
60
|
+
## Pitfalls
|
|
61
|
+
- **Shared dependencies**: If targets import from a common module being changed, conflicts arise
|
|
62
|
+
- **Template rigidity**: Some targets may need special handling — allow escape hatches
|
|
63
|
+
- **Cost**: N agents = N × token cost. Budget accordingly.
|