一键导入
agentic-multiagent
Multi-agent pattern for tasks requiring specialization or scale beyond single-agent capacity. Covers topology, routing, and coordination design.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Multi-agent pattern for tasks requiring specialization or scale beyond single-agent capacity. Covers topology, routing, and coordination design.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Formal reasoning via FOL theorem proving, model finding, and categorical logic
Use modern, token-efficient command-line tools (fd, ripgrep, ast-grep, bat, sd, jq, yq, tokei, eza, dust, procs, delta, hyperfine, just) instead of legacy coreutils (find, grep, cat, sed, ls, du, ps) for any shell, file, or codebase task — on any platform (Linux/macOS/Windows) and through any executor (a terminal, Claude Code's bash tool, Desktop Commander, or an MCP shell bridge). Trigger whenever you are about to search files, grep for text, read or inspect files, find-and-replace, refactor code, traverse a repository, process JSON/YAML, or inspect disk usage or processes — even if the user did not name a specific tool. These tools are faster, .gitignore-aware, and emit clean structured output that protects the context window. For installation across operating systems and platform-specific quirks, see references/. If you run commands specifically through the LocalREPL MCP bridge, also consult the local-repl-cli skill for environment-specific gotchas.
Operating guide for the AGEM reasoning engine: native tools, honest metric interpretation, formal-logic verification via mcp-logic, and the meta-tool MCP interface.
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.
Master orchestrator for the five-question decision tree that selects the right agentic pattern from Sequential, ReAct, Planning, Reflection, or Multi-Agent.
Planning pattern for structurally articulable tasks. Planner defines stages and dependencies upfront; ReAct handles local uncertainty within each step.
| name | agentic-multiagent |
| description | Multi-agent pattern for tasks requiring specialization or scale beyond single-agent capacity. Covers topology, routing, and coordination design. |
[!TIP] TL;DR: Use this pattern ONLY when clear specialization or scale problems exist that a single agent can't handle. Multi-agent adds coordination overhead—only use when benefits outweigh costs. Key Principle: "The trigger for multi-agent use should be a clear bottleneck that specialization or scale actually solves, not architectural preference."
Multi-agent systems operate on the belief that a task benefits from decomposition into specialized roles, where parallel or modular execution outweighs the overhead of coordination.
Multi-agent systems are useful when:
┌─────────────────────────────────────────────────────────┐
│ MULTI-AGENT TOPOLOGY │
│ │
│ ┌─────────────┐ │
│ │ Coordinator │ (Task routing, orchestration) │
│ └──────┬──────┘ │
│ │ │
│ ┌────┴────┬────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────┐ ┌────────┐ ┌──────────┐ │
│ │ Spec │ │ Spec B │ │ Spec C │ (Parallel execution) │
│ │ A │ │ │ │ │ │
│ └──────┘ └────────┘ └──────────┘ │
│ │ │ │ │
│ └─────────┴────────────┘ │
│ │ │
│ ▼ │
│ [Result Aggregation / Synthesis] │
└─────────────────────────────────────────────────────────┘
When to use: Apply this pattern when:
BOTH specialization AND scale must be evaluated first using Questions 1-4.
| Task Component | Reasoning Style | Specialist Agent |
|---|---|---|
| Legal review | Formal, precise | Legal Specialist |
| Financial modeling | Numeric, analytical | Finance Specialist |
| Security auditing | Adversarial, cautious | Security Specialist |
| Code generation | Technical, systematic | Dev Specialist |
| Creative writing | Open, generative | Creative Specialist |
Signal: Clear domain boundaries in the task that need different reasoning styles.
| Problem | Single Agent Issue | Multi-Agent Solution |
|---|---|---|
| Context overflow | Task too large for window | Split across agents |
| Serial bottleneck | Sequential steps take too long | Parallel execution |
| Rate limiting | API limits slow processing | Distribute load |
Signal: Task CANNOT fit into one agent's capacity.
Who owns each task component?
| Option | When to Use | Example |
|---|---|---|
| Dedicated specialist | Clear domain expertise needed | Legal agent owns contract review |
| Pooled workers | Many similar subtasks | Multiple crawler agents |
| Hierarchical | Tasks have natural parent-child | Manager → Workers |
How are tasks assigned to agents?
| Option | When to Use | Example |
|---|---|---|
| Deterministic rules | Predictable task types | If code → Dev Agent |
| LLM routing | Ambiguous task types | Router decides based on content |
| Self-selection | Agents know their capabilities | Agent claims suitable tasks |
| Central coordinator | Complex orchestration needs | Coordinator dispatches |
How do agents interact?
| Topology | Structure | Best For |
|---|---|---|
| Sequential | Output of A → Input of B | Pipeline dependencies |
| Parallel | All agents work simultaneously | Independent subtasks |
| Debate | Agents argue positions | Diverse perspectives |
| Hierarchical | Manager → Subordinates | Nested complexity |
Sequential: Parallel: Debate:
[Agent A] ┌───────┐ [Agent A]
│ │ Agent │ ↙ ↘
[Agent B] ├───────┤ [Arbiter]
│ │ Agent │ ↘ ↙
[Agent C] ├───────┤ [Agent B]
└───────┘
Multi-agent systems add significant overhead:
| Cost | Impact |
|---|---|
| Coordination complexity | Who assigns tasks? Who resolves conflicts? |
| Shared state management | How do agents share context? |
| Failure propagation | One agent failure can cascade |
| Communication overhead | Extra latency for messaging |
| Debugging difficulty | Harder to trace execution paths |
Rule: If a single strong agent can handle the task, use one. The overhead of multiple agents outweighs the benefit.
| Signal | Cause | Fix |
|---|---|---|
| Wrong specialist selection | Routing logic issue | Use deterministic rules for predictable cases |
| Outputs don't combine well | Integration problem | Define clear output contracts |
| Deadlock | Circular dependencies | Add timeout + fallback |
If routing failures →
Analyze: Is routing deterministic? YES → debug rules
NO → consider deterministic routing
| Signal | Cause | Fix |
|---|---|---|
| Slower than single agent | Too much coordination | Reduce agent count OR simplify topology |
| Complex state sharing | Shared state management | Use structured state with clear ownership |
spawn_agem_agent — Create specialist agents with personasget_cohomology — Check cross-agent consistency (H¹ should be 0)sheaf-consistency-enforcer — Cross-agent state managementreset_agem_engine — Clean state between runssheaf-consistency-enforcer — Critical: Track state consistency across agentshipai-montague — Belief tracking per agentverifier-graph — Build causal chains across agent outputsconscience-servitor — Ethical evaluation of combined decisions1. DECOMPOSE:
a. Identify specialization boundaries
b. Identify scale bottlenecks
c. Define task ownership
2. ARCHITECT:
a. Choose topology (sequential/parallel/debate)
b. Define routing logic
c. Define output contracts
3. EXECUTE:
a. Spawn specialist agents
b. Register each in sheaf-consistency-enforcer
c. Route tasks per logic
d. Aggregate results
4. VALIDATE:
a. Check H¹ = 0 (agreement across agents)
b. If H¹ > 0 → spawn_agem_agent for resolution
c. Verify combined output quality
## Multi-Agent Task Definition
**Task**: [What needs to be done]
**Specialization Triggers**:
- [Domain boundary 1] → [Specialist A]
- [Domain boundary 2] → [Specialist B]
**Scale Triggers**:
- [Bottleneck] → [Solution]
### Topology: [sequential/parallel/debate/hierarchical]
### Routing Logic: [deterministic/LLM/self-select/coordinator]
### Agents:
┌─────────────────┬────────────────┬─────────────────┐
│ Specialist A │ [Persona] │ [Tasks owned] │
├─────────────────┼────────────────┼─────────────────┤
│ Specialist B │ [Persona] │ [Tasks owned] │
└─────────────────┴────────────────┴─────────────────┘
### Output Contracts:
- Specialist A → produces: [X], format: [Y]
- Specialist B → produces: [Z], format: [W]
### State Management:
- Shared state: [what's shared, how]
- Agent-local state: [what's private]
### Failure Handling:
- Agent failure: [fallback strategy]
- Routing failure: [fallback strategy]
- Consensus failure (H¹ > 0): [resolution strategy]
For different topologies:
# Parallel specialists (debate-style)
spawn_agem_agent(persona="Advocate") # Argues position A
spawn_agem_agent(persona="Challenger") # Argues position B
spawn_agem_agent(persona="Arbiter") # Resolves debate
# Sequential pipeline
spawn_agem_agent(persona="Collector") # Gathers data
spawn_agem_agent(persona="Analyzer") # Processes data
spawn_agem_agent(persona="Reporter") # Generates output
# Hierarchical
spawn_agem_agent(persona="Manager") # Coordinates
spawn_agem_agent(persona="Worker_A") # Subordinate
spawn_agem_agent(persona="Worker_B") # Subordinate
| Question | Answer | Use Multi-Agent? |
|---|---|---|
| Questions 1-4 resolved? | YES | Required before considering multi-agent |
| Clear specialization need? | YES | ✓ Consider |
| Clear scale need? | YES | ✓ Consider |
| Either trigger present? | YES | → Use Multi-Agent |
| No clear trigger? | NO | → Single agent sufficient |