factory-swarm
Fan out N parallel workers across slices or races, drain them, and return one consolidated report. Use for /factory-swarm, 'swarm this', parallel coverage…
от watt-mind★ 25 звёзд на GitHub
Установить factory-swarm в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Factory Swarm
Fan out N parallel workers, enforce SHA/method discipline, aggregate terminal results, and return one consolidated report. Adapted from pstack's swarm for Factory's T3Code-native orchestrator, harness-native subagents, and factory swarm CLI runner.
Open a checklist with one entry per phase before launching anything:
- Frame
- Fan out
- Aggregate
- Report
Per-Node Configuration (~/.factory/swarm.yaml)
factory swarm reads ~/.factory/swarm.yaml on the active node (falling back to $FACTORY_ROOT/config/swarm.example.yaml):
defaults.worker: default worker profile (opus->claude-opus-5-5) used for partitioned slices unless overridden.profiles.race: cross-harness race arms (gpt-solviacodex,fableviaclaude,carbonviaagy), withargonandpifallback available.
Inspect the node's resolved worker roster anytime with:
factory swarm config
Backend Selection (T3Code-native vs. Harness Subagents vs. CLI Runner)
- T3Code-native (preferred when inside T3Code): If T3Code Orchestrator MCP tools (
orchestrator_capabilities,delegate_task,task_cancel,t3_thread_wait,t3_thread_read) are available in the session:- Call
orchestrator_capabilitiesonce per thread before your firstdelegate_task. - Fan out all N workers via
delegate_task(mode: "async") — never usecreate_threadsort3_thread_launchfor worker fan-out (those create top-level threads, reserved for explicit user requests). - Follow
delegate_task'snextbehavior: end your turn for reactive wakeup rather than pollingtask_statusor looping ont3_thread_wait. - Each new review or re-check is a fresh
delegate_task, nevert3_thread_sendto a finished child; cancel replaced or extra delegates withtask_cancel(nevert3_thread_interrupt). - Worktree interaction:
delegate_taskonly acceptsisolation: "shared" | "worktree"(noworktreePathparam). For repos withbin/worktree-up.sh, runbin/worktree-up.sh <ISSUE-ID>sequentially in the coordinator and passisolation: "shared"withworktree: <abs-path>spelled out intask, or initialize per-worktree ports/DB inside anisolation: "worktree"checkout.
- Call
- Harness-native subagents (same-harness interactive): When running partitioned slices inside a single harness (
claude,codex,agy,cursor) without cross-vendor race arms, you may use the harness's nativeswarm/invoke_subagent/run_workflowtools with isolated worktrees (workspace:"share"orbin/worktree-up.sh). - CLI runner (
factory swarm run): For cross-harness races or headless/terminal fan-outs acrosscodex,claude,agy, andpi, runfactory swarm run.
Phase A: Frame
- State the done predicate and the artifact or report the swarm must return.
- Choose the shape:
partition(disjoint slices),race(N workers on identical briefs), ormixed. Forraceormixed, declare the selection rule up front:first-pass,rank-all, orbest-of. - Enforce SHA & measurement discipline: When workers verify or measure commits, every brief names the exact commit SHAs. A measurement brief also names the method (sample count, what one sample is, order). Workers must echo both in their result.
- Isolate writable outputs: Every concurrent writer gets its own
$TMPDIRdirectory or isolatedgit worktree(never share a writable checkout or usegit stash).
Phase B: Fan out
Launch all N workers in parallel. Every brief must stand alone and state:
- Goal, scope, exact slice or race arm, and required verification command.
- Expected verdict token:
PASS,ISSUES, orBLOCKEDwith concrete evidence (file:line, SHA, or command output). A worker that can prove a defect reportsISSUESand lists every issue it can prove, not only the first.
CLI invocation example (partitioned slices JSON or race):
factory swarm run \
--shape partition \
--tasks-file "$TMPDIR/swarm-<id>/tasks.json" \
--mode sandbox \
--json
Or for a cross-harness race:
factory swarm run \
--shape race \
--rule best-of \
--profile race \
--prompt-file "$TMPDIR/swarm-<id>/prompt.md" \
--json
If a worker drops out or fails, proceed with N - 1 and record the dropout.
Phase C: Aggregate
- Enforce brief contracts: Drop any result that omits the required commit SHAs or measurement method named in its brief, and respawn that worker once. After a second miss, record a gap (a gap never counts as
PASS). - Check coverage / apply race rule: For
partition, verify every required slice has a result. Forrace, apply the declared selection rule (first-pass,rank-all, orbest-of). - Synthesize, never dump: Distill findings; never paste raw worker logs into chat.
Phase D: Report & Cleanup
- If you used
factory swarm run, clean up temporary worktrees/sandboxes once
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл factory-swarm?
Fan out N parallel workers across slices or races, drain them, and return one consolidated report. Use for /factory-swarm, 'swarm this', parallel coverage, races, gauntlets, and exploration.
Как установить скилл factory-swarm?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл factory-swarm запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…