swarm · backnotprop — скилл для Claude Code: параллельные воркеры и один отчёт
Разворачивает N параллельных воркеров на одну задачу, собирает результаты и возвращает один сводный отчёт. Пригодится для покрытия кода, гонок моделей и разведки.
npx skills add backnotprop/pstack --skill swarm -a claude-codeЧто делает swarm
Скилл ведёт работу по четырём фазам: Frame, Fan out, Aggregate, Report. Сначала вы задаёте предикат готовности и артефакт, который воркеры должны вернуть. Потом выбираете форму: нарезать задачу на слайсы, устроить гонку N воркеров на одинаковых брифах или смешать оба варианта. Для гонки правило отбора (first pass, rank all, best-of) объявляется до запуска.
Модель воркера берётся из строки swarm workers в файле настроек pstack: ~/.claude/rules/pstack-models.md в Claude, ~/.cursor/rules/pstack-models.mdc в Cursor, ~/.agents/pstack-models.md в остальных харнессах. Если файла или строки нет, скилл советует начать с grok-4.7-xhigh-fast. Для auto или inherit-parent параметр model не передаётся, и воркеры идут на родительской модели. Каждый бриф самодостаточен: цель, границы, точный слайс или плечо гонки, способ проверки и формат отчёта.
В Claude воркеры запускаются через инструмент Agent и работают локально, поэтому каждому нужен свой worktree или путь для вывода. Параметры environment: "cloud" и cloud_base_branch принадлежат инструменту Task в Cursor — в других харнессах их просто нет. Если воркер выпал, работа продолжается на N-1, и это отмечается. Результат без указанных в брифе SHA и метода отбрасывается, воркер перезапускается один раз; после второй неудачи фиксируется пробел, который не считается успехом.
Какие задачи решает
- прогнать проверку кода по нескольким слайсам сразу
- сравнить несколько моделей на одной задаче
- собрать доказательства дефектов, а не первый попавшийся
- разведать незнакомую кодовую базу параллельно
- получить один сводный отчёт вместо россыпи ответов
Примеры запросов агенту
- swarm this: проверь обработку ошибок в
src/api/и верни отчёт - запусти гонку трёх воркеров на одном брифе, правило best-of
- разбей рефакторинг на слайсы и прогони их параллельно
Как установить swarm
1Через Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill swarm -a claude-code2Вручную: положить файлы
~/.claude/skills/swarm/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/swarm/
1Через Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill swarm -a codex2Вручную: положить файлы
.agents/skills/swarm/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill swarm -a cursor2Вручную: положить файлы
.cursor/skills/swarm/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install backnotprop/pstack swarm2Вручную: положить файлы
.github/skills/swarm/SKILL.md1Через Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill swarm -a gemini-cli2Командой платформы
gemini skills install https://github.com/backnotprop/pstack --path skills/swarmВручную: положить файлы
.devin/skills/swarm/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill swarm -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о swarm
Как установить swarm в Claude?
Выполните npx skills add backnotprop/pstack --skill swarm -a claude-code. Скилл встанет в ~/.claude/skills/swarm/SKILL.md.
Что делает swarm?
Разворачивает N параллельных воркеров на одну задачу, собирает их результаты и возвращает один консолидированный отчёт с таблицей, списком проблем и пробелами.
Нужен ли файл настроек pstack?
Без него скилл тоже работает: если строки swarm workers нет, воркеры запускаются на grok-4.7-xhigh-fast.
Исходный текст
SKILL.md · MIT
--- name: swarm description: "Fan out N parallel workers, drain them, and return one report. Use for /swarm, 'swarm this', or parallel coverage, races, gauntlets, and exploration." disable-model-invocation: true --- # Swarm ## Start Open a todolist with one entry per phase before launching anything. 1. Frame 2. Fan out 3. Aggregate 4. Report ## Phase A: Frame 1. State the done predicate and the artifact or report the swarm must return. 2. Choose the shape. Partition into slices, race N workers on identical briefs, or mix both. For a race or mixed shape, declare `first pass`, `rank all`, or `best-of` before spawning. 3. Pick the worker model from the `swarm workers` line in the pstack settings file (`~/.cursor/rules/pstack-models.mdc` in Cursor, `~/.claude/rules/pstack-models.md` in Claude Code, `~/.agents/pstack-models.md` in other harnesses). If the file or that line is missing, use `grok-4.7-xhigh-fast`. For `auto` or `inherit-parent`, omit `model` so the workers run on the parent model. If your subagent tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message or your harness's model list. For a model race, name each arm's model up front. Pick each subagent's reasoning level and fast or standard speed for the job, per the Subagents section of the **poteto-mode** skill. 4. Give each worker its own writable output when it writes. When workers verify or measure commits, each brief names the exact SHAs. A measurement brief also names the method (sample count, what one sample is, order). The worker records both in its result. ## Phase B: Fan out Spawn all N workers in one message with `subagent_type: generalPurpose`, `environment: "cloud"`, `run_in_background: true`, and the step 3 model, left unset for `auto` or `inherit-parent`. Use `environment: "local"` only when the worker needs access to something on the user's computer. When a worker must start from a non-default pushed branch, pass `cloud_base_branch`. **Other harnesses.** These parameters belong to Cursor's `Task` tool, and `environment: "cloud"` runs a Cursor cloud agent. In another harness, use its subagent tool: `Agent` in Claude Code (`subagent_type: general-purpose`), `task` in OpenCode (`subagent_type: general`), `spawn_agent` in Codex. Workers run locally there, so give each one its own worktree or output path. Keep the brief and the model. Drop parameters your tool doesn't have. If your harness has no subagent tool, as in Pi without an extension, run the workers yourself, one after another. Every brief stands alone. Include the goal, scope, exact slice or race arm, how to verify, and what to report. Reports use `PASS`, `ISSUES`, or `BLOCKED` with evidence. A worker that can prove a defect reports `ISSUES` and lists every issue it can prove, not only the first. If a worker drops out, proceed with N-1 and note it. ## Phase C: Aggregate Read the terminal results. Drop a result that does not record the SHAs and method its brief names, and respawn that worker once. After a second miss, record a gap. A gap does not count as a pass. For coverage, every required slice needs a result. For a race, apply the selection rule declared up front. Use first pass, rank all, or best-of. Do not paste raw worker dumps. ## Phase D: Report Return one consolidated in-chat report with a result table, issue one-liners, gaps or dropouts, and the race rule when used.
© backnotprop · MIT · backnotprop/pstack
Похожие скиллы
Все скиллы по теме «Настройка агента: память, контекст, субагенты» →Сначала — swarm от других авторов.