| name | orchestrate |
| source | ../../../../skills/orchestrate/SKILL.md |
| source_version | 2.0.0 |
| translation_version | 2.0.0 |
| last_synced | "2026-07-16T00:00:00.000Z" |
| source_hash | e66c388ce04a |
| scope | universal |
| description | [UDS] 以 Claude 原生 Agent tool 编排多任务执行计划(DAG-based,无外部引擎)。
Use when: executing a plan.json file with parallel/sequential task dependencies.
Keywords: orchestrate, plan, execute, DAG, task plan, 编排, 执行计划, 并行.
|
| argument-hint | <plan.json> [--dry-run] |
/orchestrate — 任务计划编排 Skill
语言: English | 简体中文
用法
/orchestrate <plan.json> # 执行计划
/orchestrate <plan.json> --dry-run # 仅验证,不执行
执行流程
Step 1:读取与解析计划(Claude-native)
使用 Read tool 读取 plan.json,直接由 Claude 解析:
- 读取 JSON 文件,解析为任务清单
- 验证结构:
tasks 非空、每个 task 含 id、title、spec
- 安全扫描:检查
task.spec 是否含危险指令(rm -rf /、DROP DATABASE、git push --force)
- 拓扑排序:依
depends_on 字段将 tasks 分组为执行层(layers)
- Layer 0:没有依赖的 tasks(可并行)
- Layer N:依赖全部在 Layer 0..N-1 中的 tasks
若 validation.valid 为 false,输出错误信息并停止。
Step 2:呈现执行计划
向用户显示解析结果:
计划:<project> 品质:<quality>
──────────────────────────────────
Layer 0 (并行):T-001, T-002
Layer 1 (序列):T-003 (依赖 T-001)
Layer 2 (序列):T-004 (依赖 T-002, T-003)
──────────────────────────────────
共 4 个任务,3 个执行层
若使用 --dry-run:显示以上摘要后立即停止,不启动任何 Agent。
Step 3:逐层执行
对 layers 数组中的每一层:
- 同层并行:同一层的 tasks 在同一消息中启动多个 Agent tool
- Agent tool 参数:
prompt:task.spec + acceptance_criteria + user_intent 组合而成的执行提示
isolation: "worktree":每个 task 在独立 git worktree 执行
description:"Task {task.id}: {task.title}"
- 等待完成:所有同层 agents 完成后,才进入下一层
Agent 提示模板:
Task: {task.title}
Spec:
{task.spec}
Acceptance Criteria:
{task.acceptance_criteria 逐条列出}
User Intent:
{task.user_intent}
After completing the task, run: {task.verify_command}
Step 4:依赖失败处理
如果某个 task 的 agent 回报失败:
- 标记该 task 为
failed
- 后续层中
depends_on 包含该 task ID 的所有 tasks 标记为