team-swarm

SkillAI & models

Swarm intelligence team skill, ACO-driven multi-agent exploration

Use team-swarm in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add team-swarm and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the team-swarm skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

team-swarmStart free

What this skill tells your AI

The instructions your AI receives, as published by catlog22/maestro-flow in .codex/skills/team-swarm/SKILL.md and read by Ahel’s review.

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>

Team Swarm

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.

Architecture

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 Registry

RolePathPrefixInner Loop
coordinatorroles/coordinator/role.md——
antroles/ant/role.mdANT-*false
scorerroles/scorer/role.mdSCORE-*false
analystroles/analyst/role.mdANALYST-*false

Role Router

Parse $ARGUMENTS:

  • Has --role <name> -> Read roles/<name>/role.md, execute Phase 2-4
  • No --role -> @roles/coordinator/role.md, execute entry router

Shared Constants

  • Session prefix: TS
  • Session path: {run_dir}/work/team/
  • Team name: swarm
  • Script root: <skill_root>/scripts/aco.py (Python 3.10+)
  • Message bus: mcp__maestro__team_msg(session_id=<run-id>, ...)

Worker Spawn Template

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).`
})

User Commands

CommandAction
check / statusView iteration progress + convergence curve
resume / continueResume interrupted iteration
feedback <text>Inject feedback into wisdom; applies at next iteration
revise <ITER>Re-run a specific iteration (rare)

Specs Reference

SpecPurpose
specs/swarm-protocol.mdMaster protocol: script <-> coordinator interface, data flow
specs/pheromone-schema.mdPheromone JSON structure, update formula, evaporation
specs/ant-output-schema.mdCritical contract for ant JSON artifacts
specs/convergence-criteria.mdStop conditions, multi-criterion logic
specs/swarm-config-template.jsonUser-facing config template with all knobs

Scripts

ScriptPurposeInvocation
scripts/aco.pyMain CLI: init / select / update / converged / reportpython aco.py --session <path> <cmd>
scripts/pheromone.pyPheromone matrix module (imported by aco.py)—
scripts/scoring.pyPluggable scorer (script + fallback modes)—

Session Directory

{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 bus

Completion Action

When 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" }
    ]
  }]
})

Error Handling

ScenarioResolution
aco.py not foundVerify <skill_root>/scripts/aco.py; check Python install
Python version < 3.10Use python3 or report dependency error
Config validation failsrequest_user_input to fix, regenerate, retry
All ants fail in iterationHalt, request_user_input (retry / abort / refine config)
Hallucination cluster (>50%)Pause, request_user_input (continue / refine scoring)
Convergence never tripsmax_iterations safety net always fires
Session corruptionPhase 0 reconciliation; archive if irrecoverable

Signals

GitHub stars
560
Forks
68
Last commit
Sep 2026
Advanced
Item type
skill
Key
team-swarm
Source
github.com/catlog22/maestro-flow