Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ACO swarm intelligence with modular Workflow composition and adversarial decision gates. Coordinator drives iteration loop; 4 composable Workflow scripts handle exploration, scoring, convergence, and synthesis — each with built-in adversarial patterns.
.claude/skills/catlog22-team-adversarial-swarm/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 171% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 100% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-21 | ✓→✓ | = Same ✓ | 170% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 17% | 0% |
<required_reading> @~/.maestro/workflows/run-mode-lite.md </required_reading>
ACO 蚁群优化 + 模块化 Workflow 编排 + 对抗决策。
继承 team-swarm 的蚁群算法核心(Python ACO 脚本),用 4 个可组合的 Workflow 脚本 替代 team-worker 架构,在每个决策节点注入对抗性 agent 模式。
SKILL.md (Coordinator — this file)
│
│ Phase 1: Config Generation (inline)
│ Phase 2: ACO Init (Bash: aco.py init)
│
│ Phase 3: Iteration Loop ×K
│ ┌──────────────────────────────────────────────────┐
│ │ 3a. Bash: aco.py select → assignments │
│ │ 3b. Workflow(wf-swarm-explore) ← 模块1 │
│ │ N ants parallel → ant_results │
│ │ 3c. Workflow(wf-swarm-score) ← 模块2 │
│ │ 3-vote adversarial scoring → verified_scores │
│ │ 3d. Write scores → Bash: aco.py update │
│ │ 3e. Workflow(wf-swarm-converge) ← 模块3 │
│ │ prosecutor/defender/judge → converged? │
│ │ 3f. if converged: break │
│ └──────────────────────────────────────────────────┘
│
│ Phase 4: Bash: aco.py report
│ Workflow(wf-swarm-synthesize) ← 模块4
│ 3-perspective analysis + arbitration → best-solution.md| Module | Script | Args Interface | Adversarial Pattern | Returns | |--------|--------|---------------|--------------------|---------| | Explore | workflows/wf-swarm-explore.js | { iteration, assignments[], objective, session, config } | N ants parallel | { ant_results[] } | | Score | workflows/wf-swarm-score.js | { iteration, ant_results[], objective, rubric? } | 3-vote per ant (prosecutor/defender/judge) | { scores{}, calibration } | | Converge | workflows/wf-swarm-converge.js | { iteration, best, history[], config } | prosecutor(continue)/defender(stop)/judge | { converged, reason, confidence } | | Synthesize | workflows/wf-swarm-synthesize.js | { best, top_k[], convergence_story, objective } | 3-perspective + arbitrator | { report, caveats } |
每个模块独立可用,也可由 Coordinator 组合编排。
所有依赖均在本 skill 内部,无外部引用。
<this-skill>/scripts/aco.pyGlob(".claude/skills/team-adversarial-swarm/scripts/aco.py")pheromone.py, scoring.py(同目录)init / select / update / converged / report<this-skill>/workflows/wf-swarm-*.jsGlob(".claude/skills/team-adversarial-swarm/workflows/wf-swarm-*.js")| Spec | Purpose | |------|---------| | specs/swarm-protocol.md | Coordinator ↔ Script ↔ Workflow 三方协议 | | specs/pheromone-schema.md | 信息素矩阵结构、更新公式、蒸发规则 | | specs/ant-output-schema.md | 蚁输出 JSON 合约(三层评分) | | specs/convergence-criteria.md | 双层收敛:Python 信号 + 对抗辩论 | | specs/swarm-config-template.json | 用户配置模板 |
{run_dir}/work/team/
├── swarm-config.json # Phase 1 output
├── pheromone/ # ACO state (managed by aco.py)
│ ├── current.json
│ └── history/
├── trails/ # Per-iteration trails (managed by aco.py)
├── scores/ # Adversarial scoring results
│ └── iter-<k>-scores.json
├── {run_dir}/outputs/ # Formal deliverables
│ ├── ant-<k>-<id>.json # Ant outputs
│ └── best-solution.md # Final synthesis
├── workflows/ # Workflow run artifacts
│ ├── explore-<k>.json # Per-iteration explore results
│ ├── score-<k>.json # Per-iteration score results
│ └── converge-<k>.json # Per-iteration convergence decision
└── best.json # Canonical best (managed by aco.py)Glob("{run_dir}/work/team/swarm-config.json") → 查找活跃 sessionworkflows/converge-*.json 未标记 converged → 恢复到对应迭代解析用户 intent,生成 swarm-config.json。
若 intent 不够明确,用 request_user_input 澄清:
生成 config 字段:
json{ "task": { "objective": "...", "evidence_requirements": "..." }, "swarm": { "n_ants": 5, "max_iterations": 5 }, "aco": { "alpha": 1.0, "beta": 2.0, "rho": 0.1, "q": 1.0 }, "task_space": { "nodes": [...], "auto_discover_from": "..." }, "scoring": { "mode": "adversarial", "rubric": "..." }, "convergence": { "patience": 2, "min_improvement": 0.01, "max_iterations": 5 } }
Write 到 {run_dir}/work/team/swarm-config.json。
TAS-<slug>-<date>Bash: python <aco.py> --session {run_dir}/work/team init{ n_nodes, n_edges, pheromone_path }After session folder creation and before role-spec generation:
run_id / run_dir (injected by an orchestrator), store them in team-session.json and skip create — a second create mints an empty duplicate Run. Otherwise: maestro run create team-adversarial-swarm --session <slug> --intent "<task summary>"YYYYMMDD-team-adversarial-swarm-<topic> (ASCII, ≤64 chars)run_id and run_dir in team-session.json:json "run": { "run_id": "<id>", "run_dir": "<path>" }
team-session.json.run.run_id → maestro run check <run_id> (idempotent). If status=sealed, create a new run and update the field. If run.run_id is missing, resolve in order: birth-packet injection, then <session>/artifacts/; if all are absent, fail closed — report session corruption and do NOT create a new Run.pythonfor k in range(1, max_iterations + 1): # 3a. ACO selection assignments = Bash("python aco.py --session {run_dir}/work/team select --iter k") # 3b. Parallel exploration (Workflow Module 1) explore_result = Workflow({ scriptPath: "<skill>/workflows/wf-swarm-explore.js", args: { iteration: k, assignments, objective, session, config } }) # 3c. Adversarial scoring (Workflow Module 2) score_result = Workflow({ scriptPath: "<skill>/workflows/wf-swarm-score.js", args: { iteration: k, ant_results: explore_result.ant_results, objective, rubric } }) # 3d. Write scores + pheromone update Write("{run_dir}/work/team/scores/iter-k-scores.json", score_result) Bash("python aco.py --session {run_dir}/work/team --run-dir <run_dir> update --iter k") # 3e. Adversarial convergence check (Workflow Module 3) converge_result = Workflow({ scriptPath: "<skill>/workflows/wf-swarm-converge.js", args: { iteration: k, best: aco_best, history: iter_history, config } }) # 3f. Save + check Write("{run_dir}/work/team/workflows/converge-k.json", converge_result) if converge_result.converged: break
注意:每次 Workflow 调用是独立的,数据通过 args 传入、返回值传出。 Coordinator 负责 Workflow 间的数据桥接和 Python 脚本调用。
Bash: python aco.py --session {run_dir}/work/team report → 获取 best + top_k + curve Workflow({ scriptPath: "<skill>/workflows/wf-swarm-synthesize.js", args: { best, top_k, convergence_story, objective } })
{run_dir}/outputs/best-solution.mdexplore → score → update → converge → [loop] → synthesizeexplore → update(self_score) → converge → synthesizeexplore(k=1) → score(k=1) // 不循环,只看一轮score(ant_results from files) → 输出 verified_scoressynthesize(best, top_k) → best-solution.md| Scenario | Resolution | |----------|------------| | aco.py 未找到 | Glob team-swarm skill 路径;提示安装 | | Python < 3.10 | 尝试 python3;报告依赖 | | Workflow 执行失败 | 记录错误,提供 --resume 恢复点 | | 所有蚁全部失败 | 暂停,request_user_input(重试/终止/调整config) | | 收敛从不触发 | max_iterations 安全网总会触发 | | 幻觉集群 (>50% 蚁被降分) | 暂停,request_user_input(继续/调整评分规则) |
Run lifecycle completion (before displaying results):
maestro session done <run_id>展示最终结果 + 交互选择:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-06 | fail→fail | 6,469 | 6,940 | +7% | 1 | 1 | 0% | 191 | 3,461 | +1712% | 0 | 0 | — |
case-21 | pass→pass | 9,396 | 8,110 | -14% | 1 | 1 | 0% | 1,635 | 4,408 | +170% | 0 | 0 | — |
case-01 | fail→fail | 38,478 | 4,688 | -88% | 1 | 1 | 0% | 6,196 | 3,362 | -46% | 0 | 0 | — |
case-02 | fail→fail | 31,912 | 6,779 | -79% | 1 | 1 | 0% | 5,326 | 3,426 | -36% | 0 | 0 | — |
case-03 | fail→fail | 32,518 | 6,478 | -80% | 1 | 1 | 0% | 6,193 | 3,378 | -45% | 0 | 0 | — |
case-04 | pass→pass | 18,269 | 10,525 | -42% | 1 | 1 | 0% | 3,467 | 4,044 | +17% | 0 | 0 | — |
case-05 | fail→fail | 20,998 | 6,508 | -69% | 1 | 1 | 0% | 3,747 | 3,528 | -6% | 0 | 0 | — |
case-07 | fail→fail | 12,157 | 4,284 | -65% | 1 | 1 | 0% | 2,369 | 3,234 | +37% | 0 | 0 | — |
case-08 | fail→fail | 2,733 | 7,918 | +190% | 1 | 1 | 0% | 445 | 3,367 | +657% | 0 | 0 | — |
case-09 | fail→pass | 9,078 | 5,838 | -36% | 1 | 1 | 0% | 1,479 | 4,010 | +171% | 0 | 0 | — |
case-10 | fail→pass | 12,202 | 5,597 | -54% | 1 | 1 | 0% | 1,955 | 3,918 | +100% | 0 | 0 | — |
case-11 | fail→fail | 6,481 | 5,828 | -10% | 1 | 1 | 0% | 901 | 3,301 | +266% | 0 | 0 | — |
case-12 | fail→fail | 8,226 | 6,778 | -18% | 1 | 1 | 0% | 1,274 | 3,344 | +162% | 0 | 0 | — |
case-13 | fail→fail | 17,092 | 5,864 | -66% | 1 | 1 | 0% | 2,468 | 3,294 | +33% | 0 | 0 | — |
case-14 | fail→fail | 7,871 | 11,783 | +50% | 1 | 1 | 0% | 1,202 | 4,244 | +253% | 0 | 0 | — |
case-15 | fail→fail | 9,847 | 30,963 | +214% | 1 | 1 | 0% | 1,460 | 7,807 | +435% | 0 | 0 | — |
case-16 | fail→fail | 20,465 | 5,843 | -71% | 1 | 1 | 0% | 2,883 | 3,346 | +16% | 0 | 0 | — |
case-17 | fail→fail | 11,529 | 5,585 | -52% | 1 | 1 | 0% | 1,602 | 3,352 | +109% | 0 | 0 | — |
case-18 | fail→fail | 11,905 | 5,518 | -54% | 1 | 1 | 0% | 1,777 | 3,420 | +92% | 0 | 0 | — |
case-19 | fail→fail | 21,792 | 7,755 | -64% | 1 | 1 | 0% | 2,566 | 3,326 | +30% | 0 | 0 | — |
case-20 | fail→pass | 17,148 | 6,940 | -60% | 1 | 1 | 0% | 2,507 | 3,669 | +46% | 0 | 0 | — |
case-22 | fail→fail | 8,350 | 25,039 | +200% | 1 | 1 | 0% | 877 | 3,488 | +298% | 0 | 0 | — |
case-23 | pass→pass | 11,085 | 7,560 | -32% | 1 | 1 | 0% | 1,594 | 4,126 | +159% | 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. 23 cases were attempted, and 7 counted toward the lift figure. The other 16 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 +13 percentage points is the difference between those two pass rates over the 7 comparable cases.
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.