Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Swarm intelligence team skill — ACO-driven multi-agent exploration with hybrid LLM coordinator + Python optimization controller. Coordinator generates swarm-config from user task, then runs K iterations of N parallel ants guided by pheromone state. Universal task space via config (nodes + scoring rule). Triggers on "team swarm", "swarm intelligence", "蚁群".
.claude/skills/catlog22-team-swarm/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 69% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 63% | 0% |
> Agent timeout: spawn_agent 异步执行且无内置超时 — 除明确短任务外一律 spawn_agent 后立即 wait_agent({ timeout_ms: 3600000 })(上限 1 小时)阻塞等待,绝不依赖 30000 默认值;timed_out: true 且 Agent 未完成时再次 wait_agent 续等,不丢弃。批量场景使用 spawn_agents_on_csv({ max_runtime_seconds: 3600, ... })。
<required_reading> @~/.maestro/workflows/run-mode-lite.md </required_reading>
Orchestrate ant-colony-style exploration over a user-defined task space. Hybrid coordinator: LLM handles task translation + worker spawning; Python script owns all numeric decisions (selection / pheromone update / convergence). Universal — task space and scoring rule come from swarm-config.json.
spawn_agent({ task_name: "team_swarm", message: "Execute skill team-swarm, args: task description" })
|
SKILL.md (this file) = Router
|
+--------------+--------------+
| |
no --role flag --role <name>
| |
Coordinator Worker
roles/coordinator/role.md roles/<name>/role.md
|
+-- Phase 1: gen swarm-config
+-- Phase 2: init --> Bash: scripts/aco.py init
+-- Phase 3: iterate (K rounds, each = spawn-and-stop)
| |
| +-- Bash: aco.py select --iter k -> N assignments
| +-- Spawn N x team-worker(ant)
| +-- [callback when all ants done]
| +-- (optional) Spawn team-worker(scorer)
| +-- Bash: aco.py update --iter k
| +-- Bash: aco.py converged
| +-- branch: loop k+1 OR Phase 4
|
+-- Phase 4: converge --> Bash: aco.py report -> Spawn team-worker(analyst)
-> best-solution.md| Role | Path | Prefix | Inner Loop | |------|------|--------|------------| | coordinator | roles/coordinator/role.md | — | — | | ant | roles/ant/role.md | ANT- | false | | scorer | [roles/scorer/role.md](roles/scorer/role.md) | SCORE- | false | | analyst | roles/analyst/role.md | ANALYST- | false |
Parse $ARGUMENTS:
--role <name> -> Read roles/<name>/role.md, execute Phase 2-4--role -> @roles/coordinator/role.md, execute entry routerTS{run_dir}/work/team/swarm<skill_root>/scripts/aco.py (Python 3.10+)mcp__maestro__team_msg(session_id=<run-id>, ...)Coordinator spawns workers using this template:
spawn_agent({
subagent_type: "team-worker",
description: "Spawn <role> worker",
team_name: "swarm",
name: "<role>",
run_in_background: true,
prompt: `## Role Assignment
role: <role>
role_spec: <skill_root>/roles/<role>/role.md
session: {run_dir}/work/team
session_id: <run-id>
team_name: swarm
requirement: <task-description>
inner_loop: false
## Assignment (ant only)
<assignment JSON from aco.py select>
## Progress Milestones
session_id: <run-id>
Report progress via team_msg at natural phase boundaries.
Report blockers immediately via team_msg type="blocker".
Report completion via team_msg type="task_complete" after final send_message.
Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
})| Command | Action | |---------|--------| | check / status | View iteration progress + convergence curve | | resume / continue | Resume interrupted iteration | | feedback <text> | Inject feedback into wisdom; applies at next iteration | | revise <ITER> | Re-run a specific iteration (rare) |
| Spec | Purpose | |------|---------| | specs/swarm-protocol.md | Master protocol: script <-> coordinator interface, data flow | | specs/pheromone-schema.md | Pheromone JSON structure, update formula, evaporation | | specs/ant-output-schema.md | Critical contract for ant JSON artifacts | | specs/convergence-criteria.md | Stop conditions, multi-criterion logic | | specs/swarm-config-template.json | User-facing config template with all knobs |
| Script | Purpose | Invocation | |--------|---------|------------| | scripts/aco.py | Main CLI: init / select / update / converged / report | python aco.py --session <path> <cmd> | | scripts/pheromone.py | Pheromone matrix module (imported by aco.py) | — | | scripts/scoring.py | Pluggable scorer (script + fallback modes) | — |
{run_dir}/work/team/
├── team-session.json # Session state
├── swarm-config.json # User-facing config (Phase 1 output)
├── role-binding.json # Worker role_spec path map
├── task-space.json # Resolved nodes list
├── pheromone/
│ ├── current.json # Latest pheromone (each iter overwrites)
│ ├── init.json # Frozen initial state
│ └── history/<iter>.json # Per-iter snapshot
├── trails/<iter>.jsonl # Per-iter all-ant paths + scores
├── scores/iter-<iter>-scores.json # Scorer output (if mode == llm)
├── {run_dir}/outputs/ # Formal deliverables
│ ├── ant-<iter>-<id>.json # Per-ant schema-locked output
│ ├── swarm-report.json # Phase 4 full report dump
│ └── best-solution.md # Analyst final synthesis
├── best.json # Canonical best solution
├── wisdom/ # learnings / decisions / issues
└── .msg/ # Message busWhen swarm converges, coordinator presents:
request_user_input({
questions: [{
question: "Swarm pipeline complete. What would you like to do?",
header: "Completion",
multiSelect: false,
options: [
{ label: "Archive & Clean (Recommended)", description: "Archive session, delete team" },
{ label: "Keep Active", description: "Preserve for follow-up" },
{ label: "Export Best Solution", description: "Copy best-solution.md to target" },
{ label: "Run Another Round", description: "Reset convergence, K more iterations" }
]
}]
})| Scenario | Resolution | |----------|------------| | aco.py not found | Verify <skill_root>/scripts/aco.py; check Python install | | Python version < 3.10 | Use python3 or report dependency error | | Config validation fails | request_user_input to fix, regenerate, retry | | All ants fail in iteration | Halt, request_user_input (retry / abort / refine config) | | Hallucination cluster (>50%) | Pause, request_user_input (continue / refine scoring) | | Convergence never trips | max_iterations safety net always fires | | Session corruption | Phase 0 reconciliation; archive if irrecoverable |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 30,553 | 5,836 | -81% | 1 | 1 | 0% | 4,772 | 2,313 | -52% | 0 | 0 | — |
case-02 | pass→pass | 14,832 | 7,212 | -51% | 1 | 1 | 0% | 2,188 | 3,362 | +54% | 0 | 0 | — |
case-03 | fail→pass | 18,007 | 5,473 | -70% | 1 | 1 | 0% | 2,592 | 2,961 | +14% | 0 | 0 | — |
case-04 | fail→pass | 24,572 | 3,498 | -86% | 1 | 1 | 0% | 1,348 | 2,458 | +82% | 0 | 0 | — |
case-05 | pass→pass | 12,269 | 3,769 | -69% | 1 | 1 | 0% | 1,749 | 2,690 | +54% | 0 | 0 | — |
case-06 | fail→pass | 15,847 | 3,576 | -77% | 1 | 1 | 0% | 2,416 | 2,632 | +9% | 0 | 0 | — |
case-07 | fail→pass | 8,549 | 1,962 | -77% | 1 | 1 | 0% | 1,353 | 2,292 | +69% | 0 | 0 | — |
case-08 | fail→pass | 21,858 | 2,092 | -90% | 1 | 1 | 0% | 1,452 | 2,372 | +63% | 0 | 0 | — |
case-09 | fail→pass | 9,581 | 4,465 | -53% | 1 | 1 | 0% | 1,457 | 2,755 | +89% | 0 | 0 | — |
case-10 | fail→pass | 6,795 | 4,183 | -38% | 1 | 1 | 0% | 992 | 2,694 | +172% | 0 | 0 | — |
case-11 | fail→pass | 17,119 | 4,597 | -73% | 1 | 1 | 0% | 2,430 | 2,863 | +18% | 0 | 0 | — |
case-12 | fail→pass | 7,540 | 2,889 | -62% | 1 | 1 | 0% | 1,143 | 2,489 | +118% | 0 | 0 | — |
case-13 | fail→pass | 10,016 | 2,849 | -72% | 1 | 1 | 0% | 1,311 | 2,451 | +87% | 0 | 0 | — |
case-14 | fail→pass | 14,170 | 7,144 | -50% | 1 | 1 | 0% | 2,026 | 3,132 | +55% | 0 | 0 | — |
case-15 | fail→pass | 9,228 | 4,762 | -48% | 1 | 1 | 0% | 1,344 | 2,670 | +99% | 0 | 0 | — |
case-16 | fail→pass | 11,959 | 2,835 | -76% | 1 | 1 | 0% | 1,760 | 2,433 | +38% | 0 | 0 | — |
case-17 | fail→pass | 8,584 | 2,117 | -75% | 1 | 1 | 0% | 1,443 | 2,366 | +64% | 0 | 0 | — |
case-18 | fail→pass | 12,705 | 4,362 | -66% | 1 | 1 | 0% | 1,804 | 2,732 | +51% | 0 | 0 | — |
case-19 | fail→pass | 13,782 | 2,580 | -81% | 1 | 1 | 0% | 1,977 | 2,445 | +24% | 0 | 0 | — |
case-20 | pass→pass | 19,155 | 18,684 | -2% | 1 | 1 | 0% | 3,527 | 4,496 | +27% | 0 | 0 | — |
case-21 | pass→pass | 10,542 | 10,456 | -1% | 1 | 1 | 0% | 1,818 | 3,691 | +103% | 0 | 0 | — |
case-22 | pass→fail | 21,990 | 8,328 | -62% | 1 | 1 | 0% | 3,302 | 2,529 | -23% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +68 percentage points is the difference between those two pass rates over the 19 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.