orchestrate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOrchestrate
任务编排
An explicit fans out a large task across parallel Cursor cloud agents. Workers don't talk to each other; they talk up through structured handoffs. The spawn, wait, and handoff loop lives in . The planner writes , the script executes it, and the planner reads handoffs to decide what comes next. Long-running agent loops drift; a script with a JSON state file keeps its footing.
/orchestrate <goal>scripts/cli.tsplan.jsonRequired reading: the skill (cursor/plugins/cursor-sdk). Spawning, auth, and the error taxonomy live there. Don't reimplement what that skill already documents.
cursor-sdk仅当用户明确输入 时,才会将大型任务分发到多个并行的Cursor云代理中。工作者之间不会直接通信,而是通过结构化交接信息向上汇报。生成、等待和交接的循环逻辑位于 中。规划器负责编写 ,脚本执行该文件,之后规划器读取交接信息来决定下一步操作。长时间运行的代理循环容易偏离轨道,而带有JSON状态文件的脚本可以保持稳定运行。
/orchestrate <goal>scripts/cli.tsplan.json必读内容: 技能(cursor/plugins/cursor-sdk)。 生成代理、身份验证以及错误分类的逻辑都在其中。请勿重复实现该技能已记录的功能。
cursor-sdkSetup
配置步骤
- must be a personal/user key. Create it from Cursor Dashboard > Integrations, then read
CURSOR_API_KEYAuth before using it.cursor-sdk - is optional. When set, pass
SLACK_BOT_TOKENto--slack-channel <id>or the firstkickoff, or setrun --root. The script stores the channel inSLACK_CHANNEL_ID, posts the kickoff thread there, mirrors task status, and reads Andon reactions. When the token is unset, the script logs once and runs without Slack visibility; correctness does not change.plan.slackChannel
- 必须是个人用户密钥。可从 Cursor Dashboard > Integrations 创建,使用前请阅读
CURSOR_API_KEY的身份验证文档。cursor-sdk - 为可选配置。设置后,在执行
SLACK_BOT_TOKEN或首次kickoff时传入run --root,或设置--slack-channel <id>环境变量。脚本会将频道信息存储在SLACK_CHANNEL_ID中,在该频道发布启动线程,同步任务状态,并读取Andon反应。如果未设置该令牌,脚本会记录一次日志并在无Slack可见性的情况下运行;功能正确性不受影响。plan.slackChannel
Core principles
核心原则
These rules make the tree self-converging without global coordination.
- Planners own scopes and publish tasks. They do no coding. Writing , reading handoffs, and deciding what's next are planner work. Editing files, running
plan.json, and fixing conflicts inline are not. If a planner feels the urge to code, it publishes a task for a worker instead.git merge - Planners don't know who picks up their tasks. The script routes each task to a cloud agent. The planner's mental model stays at the task level.
- Workers are isolated. One task, one clone of the repo, no channel to any other agent. One handoff when done.
- Subplanners are recursive planners. A planner publishes a "subplan this slice" task; the subplanner fully owns that slice and hands back an aggregated handoff.
- Continuous motion via handoffs. A planner that thought it was done can receive a late handoff and replan. No "finished" state until the planner decides to stop publishing.
- Propagation, not synchronization. No cross-talk between siblings. No shared state between levels. Each level sees only its children's handoffs.
这些规则确保任务树无需全局协调即可自动收敛。
- 规划器负责范围界定并发布任务,不参与编码工作。 编写 、读取交接信息以及决定下一步操作是规划器的职责。编辑文件、执行
plan.json以及在线解决冲突不属于规划器的工作。如果规划器需要编码,应发布一个任务交由工作者完成。git merge - 规划器无需知晓谁会承接其任务。 脚本会将每个任务路由到云代理。规划器只需关注任务层面即可。
- 工作者相互隔离。 一个任务对应一个仓库克隆,与其他代理无通信渠道。完成任务后仅提交一次交接信息。
- 子规划器是递归的规划器。 规划器发布“对此部分进行子规划”的任务;子规划器全权负责该部分,并返回汇总后的交接信息。
- 通过交接信息保持持续推进。 原本认为已完成的规划器可能会收到延迟的交接信息,从而重新规划。只有当规划器决定停止发布任务时,才会进入“完成”状态。
- 信息传播而非同步。 同级代理之间无交互。不同层级之间无共享状态。每个层级仅能看到其子级的交接信息。
Node types
节点类型
| Node | Runs the loop? | Scope | Output |
|---|---|---|---|
| Planner | yes | Entire user goal | User-facing message + optional PR |
| Subplanner (↻) | yes | One slice of parent's scope | Handoff to parent |
| Worker | no | One concrete task | Handoff to spawning planner |
| Verifier | no | One target's acceptance criteria | Verdict handoff to spawning planner |
| Git | n/a | Shared medium | Branches (code) + handoffs/ (meaning) |
| 节点类型 | 是否运行循环? | 范围 | 输出内容 |
|---|---|---|---|
| Planner(规划器) | 是 | 用户的整个目标 | 面向用户的消息 + 可选的PR |
| Subplanner(子规划器,↻) | 是 | 父级范围中的一个子部分 | 向父级提交的交接信息 |
| Worker(工作者) | 否 | 一项具体任务 | 向生成它的规划器提交的交接信息 |
| Verifier(验证器) | 否 | 一个目标的验收标准 | 向生成它的规划器提交的验证结果交接信息 |
| Git | 不适用 | 共享媒介 | 分支(代码) + 交接信息/(语义) |
Role
角色
Two roles, one skill. Read your role's reference file and skip the other.
Dispatcher. You're in a local IDE session and the user typed . Your job is to kick off a cloud root planner and return its URL. See . One-shot; you are not the planner.
/orchestrate <goal>references/dispatcher.mdPlanner (root or sub). You were spawned with a structured prompt that opens with "You are the root planner for:" or "You are a subplanner for:". Or the user chose to run the planning loop locally. You own a scope, publish tasks, read handoffs, decide what's next. See .
references/planner.mddisable-model-invocation: true两种角色,对应一项技能。请阅读你所在角色的参考文件,忽略另一角色的内容。
调度员(Dispatcher):你处于本地IDE会话中,用户输入了 。你的任务是启动一个云根规划器并返回其URL。请查看 。此为一次性任务;你并非规划器。
/orchestrate <goal>references/dispatcher.md规划器(Planner,根或子级):你是通过结构化提示生成的,提示开头为“You are the root planner for:”或“You are a subplanner for:”。或者用户选择在本地运行规划循环。你负责一个范围,发布任务,读取交接信息,决定下一步操作。请查看 。
references/planner.mddisable-model-invocation: true