/pstack:swarm
自动调用一句话把活切成互不相干的几块,各派一个 AI 去做,最后汇总成一份报告。
- 什么时候用
- 要挨个检查很多东西:每个包、每个功能都过一遍。
/pstack:swarm 把 packages/ 下每个包都跑一遍它的 check.sh,一个包派一个,最后给我一份报告。用它和不用它
同一件事,直接跟 AI 说,和点名用 /pstack:swarm,AI 的做法不一样:
用 /pstack:swarmPASS、ISSUES 或 BLOCKED文档写了什么
原文分 5 节,约 550 个英文单词,中文译文约 850 字,读完约 2 分钟。点一节直接跳到全文。
写法亮点
挑了几句原文:每句让 AI 做什么、为什么这样写管用、你写提示词时怎么借来用。
每份说明都要能单独看懂
Every brief stands alone.
每份说明都要能单独看懂。
- 让 AI
- 每个帮手 AI 都拿到完整的目标、范围和验证方法,不会因为缺背景做偏。
- 为什么管用
- 帮手看不到你们的对话,这一句逼 AI 把背景写进说明,而不是默认对方都知道。
- 借来用
- 交代任务时加一句:「写成能直接转给新同事的说明,对方没看过我们之前的讨论。」
先说缺的结果算什么
A gap does not count as a pass.
缺口不算通过。
- 让 AI
- 有帮手没交回结果时,报告会写明缺了哪块,不会当成都通过了。
- 为什么管用
- AI 容易把「没报错」当成「没问题」,提前规定空白算什么,就堵住了这个默认。
- 借来用
- 检查清单里加一句:「没检查到的页面算不通过,单独列出来。」
开跑之前先定输赢
For a race or mixed shape, declare
first pass,rank all, orbest-ofbefore spawning.竞速或混用时,派出之前先声明用
first pass、rank all还是best-of。- 让 AI
- 几个帮手比着做同一件事时,怎么挑赢家在开跑前就定好,结果出来后不会临时换标准。
- 为什么管用
- 先定规则再看结果,AI 就没法看完结果再挑一个对自己有利的说法。
- 借来用
- 开工前先说:「三个方案里谁加载最快就用谁。」然后再去做。
要全部,不只第一个
lists every issue it can prove, not only the first
列出它能证明的每一个问题,不只第一个
- 让 AI
- 它会把能证明的问题都列出来,不是找到一个就收工。
- 为什么管用
- AI 找到一个问题就容易停手,明说「不只第一个」,就堵住了这个习惯。
- 借来用
- 审合同时写:「把所有对我不利的条款都找出来,不要找到一条就停。」
全文
AI 读到的就是这份 SKILL.md。可以看中文、看原文,或者一段一段对照着看。
descriptionFan out N parallel workers, drain them, and return one report. Use for /pstack:swarm, 'swarm this', or parallel coverage, races, gauntlets, and exploration.
description同时派出 N 个并行干活的帮手 AI,等它们全部做完,交回一份报告。用于 /pstack:swarm、「swarm this」,或者需要并行覆盖、竞速、连番考验和探索的时候。
Swarm
Swarm(一群帮手同时干)
Start
开始
Open a todolist with one entry per phase before launching anything.
启动任何东西之前,先开一个待办清单,每个阶段一项。
- Frame
- Fan out
- Aggregate
- Report
- 定范围
- 分头派出
- 汇总
- 报告
Phase A: Frame
阶段 A:定范围
- State the done predicate and the artifact or report the swarm must return.
- 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, orbest-ofbefore spawning. - Pick the worker model from the
swarm workersline in the pstack settings file (~/.cursor/rules/pstack-models.mdcin Cursor,~/.claude/rules/pstack-models.mdin Claude Code,~/.agents/pstack-models.mdin other harnesses). If the file or that line is missing, usegrok-4.7-xhigh-fast. Forautoorinherit-parent, omitmodelso 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. - 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.
- 说清楚「怎么算做完」的判定条件,以及这群帮手必须交回的东西或报告。
- 选定形式。可以切成几块分给不同的帮手,也可以让 N 个帮手拿同样的说明竞速,或者两者混用。竞速或混用时,派出之前先声明用
first pass、rank all还是best-of。 - 从 pstack 设置文件里的
swarm workers那一行选帮手的模型(Cursor 里是~/.cursor/rules/pstack-models.mdc,Claude Code 里是~/.claude/rules/pstack-models.md,其他工具里是~/.agents/pstack-models.md)。如果文件或那一行不存在,就用grok-4.7-xhigh-fast。如果值是auto或inherit-parent,就不写model,让帮手用主对话的模型跑。如果你派帮手 AI 的工具不认某个模型名,就用默认值,并说出来。如果它连默认值也不认,就从它的报错信息或你所用工具的模型列表里,挑同一系列里最接近的有效模型名。做模型竞速时,事先写明每一路用哪个模型。按 poteto-mode 技能里「Subagents」一节,为这件活给每个帮手 AI 选推理强度,以及用快速还是标准速度。 - 帮手要写东西时,给每个帮手一个只归它写的输出位置。帮手要验证或测量某些提交时,每份说明都写明确切的 SHA。测量类的说明还要写明方法(采样几次、一次采样是什么、按什么顺序)。帮手在结果里把这两样都记下来。
Phase B: Fan out
阶段 B:分头派出
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.
在一条消息里派出全部 N 个帮手,参数用 subagent_type: generalPurpose、environment: "cloud"、run_in_background: true,再加上第 3 步选的模型;值为 auto 或 inherit-parent 时,模型不设。只有帮手需要用到用户电脑上的东西时,才用 environment: "local"。
When a worker must start from a non-default pushed branch, pass cloud_base_branch.
如果帮手必须从一个已推送的非默认分支开始,就传 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.
其他工具。 这些参数属于 Cursor 的 Task 工具,environment: "cloud" 会运行一个 Cursor 云端帮手 AI。在别的工具里,用它自己派帮手 AI 的工具:Claude Code 里是 Agent(subagent_type: general-purpose),OpenCode 里是 task(subagent_type: general),Codex 里是 spawn_agent。在那些工具里,帮手都在本地跑,所以给每个帮手各自的 worktree 或输出路径。说明和模型保持不变。你的工具没有的参数,直接去掉。如果你所用的工具根本没有派帮手 AI 的功能,比如没装扩展的 Pi,就由你自己一个接一个地把这些活做完。
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.
每份说明都要能单独看懂。写上目标、范围、确切负责的那一块或竞速的那一路、怎么验证,以及要报告什么。报告用 PASS、ISSUES 或 BLOCKED,并附上证据。能证明有缺陷的帮手报 ISSUES,并列出它能证明的每一个问题,不只第一个。
If a worker drops out, proceed with N-1 and note it.
如果有帮手中途掉线,就用剩下的 N-1 个继续,并记下这件事。
Phase C: Aggregate
阶段 C:汇总
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.
读最终结果。如果某个结果没有记下说明里要求的 SHA 和方法,就丢掉它,把那个帮手重新派一次。第二次还缺,就记为一个缺口。缺口不算通过。做覆盖检查时,每一块必需的部分都要有结果。做竞速时,按事先声明的挑选规则来:first pass、rank all 或 best-of。不要把帮手的原始输出整段贴出来。
Phase D: Report
阶段 D:报告
Return one consolidated in-chat report with a result table, issue one-liners, gaps or dropouts, and the race rule when used.
在对话里交回一份汇总报告:一张结果表、每个问题一行、缺口或掉线情况;用了竞速的话,再写上竞速规则。
原文作者 Lauren Tan(poteto),MIT 许可。译文由本站翻译,核对到 pstack 镜像 97de40d。 在 GitHub 上看