swarm

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Swarm

Swarm

Fan out N parallel cloud workers. They may cover separate slices, race the same brief, or mix both. The parent waits, aggregates, and returns one report.
调度N个并行云工作者。它们可以处理不同的任务切片、针对同一任务进行竞速,或两者混合使用。父进程会等待所有工作者完成,汇总结果后返回一份报告。

Start

启动步骤

Open a todolist with one entry per phase before launching anything.
  1. Frame
  2. Fan out
  3. Aggregate
  4. Report
在启动任何操作前,先创建一个待办事项列表,每个阶段对应一项条目:
  1. 框架定义
  2. 调度分发
  3. 结果汇总
  4. 生成报告

Phase A: Frame

阶段A:框架定义

  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. Set N from the user or derive it from the shape. N is total workers, not the cloud concurrency limit.
  4. Pick the worker model from
    swarm workers
    in
    ~/.cursor/rules/pstack-models.mdc
    when present. Otherwise use
    grok-4.6-fast-xhigh
    . For a model race, name each arm's model up front.
  5. Give each worker its own writable output when it writes. Use a worktree, branch, or
    /tmp/swarm-<slug>/worker-<n>/
    .
  1. 明确完成判定条件,以及Swarm必须返回的产物或报告内容。
  2. 选择任务模式:将任务划分为多个切片、让N个工作者针对相同任务竞速,或混合两种模式。如果是竞速或混合模式,在启动工作者前需声明采用“首次通过”“全部排名”或“最优选择”规则。
  3. 根据用户输入或任务模式确定N的值。N是工作者的总数,而非云并发限制。
  4. 若存在
    ~/.cursor/rules/pstack-models.mdc
    文件,从其中的
    swarm workers
    中选择工作者模型。否则使用
    grok-4.6-fast-xhigh
    。如果是模型竞速,需提前指定每个分支使用的模型。
  5. 为每个工作者分配独立的可写输出路径,可使用工作树、分支或
    /tmp/swarm-<slug>/worker-<n>/
    路径。

Phase B: Fan out

阶段B:调度分发

Spawn all N workers in one message with
subagent_type: generalPurpose
,
environment: "cloud"
,
run_in_background: true
, and the configured model. 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
.
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.
If a worker drops out, proceed with N-1 and note it.
通过一条消息启动所有N个工作者,配置参数包括
subagent_type: generalPurpose
environment: "cloud"
run_in_background: true
以及选定的模型。仅当工作者需要访问用户电脑上的内容时,才使用
environment: "local"
若工作者需要从非默认的已推送分支启动,需传入
cloud_base_branch
参数。
每个任务指令需独立完整,包含目标、范围、具体的任务切片或竞速分支、验证方式以及报告要求。报告需使用
PASS
ISSUES
BLOCKED
状态,并附上相关证据。
如果某个工作者退出,继续使用剩余的N-1个工作者,并记录该情况。

Phase C: Aggregate

阶段C:结果汇总

Read the terminal results. 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.
Keep a compact result table, one-line evidenced issues, and explicit gaps or dropouts.
读取最终结果。对于覆盖测试模式,每个必填切片都需要有结果。对于竞速模式,应用之前声明的选择规则:首次通过、全部排名或最优选择。请勿直接粘贴工作者的原始输出。
整理出简洁的结果表格、单行的问题说明(附证据),以及明确的空白项或工作者退出记录。

Phase D: Report

阶段D:生成报告

Return one consolidated in-chat report with the table, issue one-liners, gaps or dropouts, and the race rule when used.
返回一份整合后的聊天内报告,包含结果表格、单行问题说明、空白项或退出记录,以及所使用的竞速规则(若适用)。",