Communitygithub.com

计划编排

读取计划文档,将其分解为步骤,从 ECC 目录中为每一步设计智能体链,并生成可直接粘贴的 /orchestrate 自定义提示。仅生成,从不执行 /orchestrate 本身。当用户拥有多步骤计划并希望通过编排驱动它而无需手动组合链时使用。

计划编排 是什么?

该技能专为多步骤计划文档(如 PRD、RFC、实施计划)设计,将其自动分解为独立步骤,并为每一步从 ECC 智能体目录中选择合适的智能体链,生成可直接粘贴的 /orchestrate 自定义命令。它支持插件安装(2.0.0+)和旧版裸安装两种模式,自动检测并统一输出前缀,避免命名空间冲突。技能还包含语言自动检测、Polyglot 平局处理、PyTorch 子配置文件检测,以及基于意图标签(如设计、实现、测试、重构等)的智能链组合规则,确保生成的链不超过 4 个智能体且无重复。最终输出包含步骤概览表格、每步的压缩任务描述(含验收标准)和批量执行命令块,用户只需逐条粘贴即可启动编排流程。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/plan-orchestrate

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

计划编排 是做什么的?

将计划文档桥接到 /orchestrate custom,并为每一步生成一个可直接粘贴的调用命令。该技能仅用于生成——它从不执行 /orchestrate。用户可在准备好时逐条粘贴。

何时激活

  • 用户拥有多步骤计划文档(PRD、RFC、实施计划)并希望通过 /orchestrate 驱动它。
  • 用户说“编排这个计划”、“为每一步生成编排提示”、“为此计划组合链”。
  • 存在逐步计划,但用户不想手动为每一步选择智能体。

跳过的情况:

  • 工作是单一步骤 → 直接调用 /orchestrate custom。
  • 计划不可读或为空。仅缺少明确编号不是跳过条件——请参见下面的“无明确步骤”边缘情况。

输入

<plan-doc-path> [--lang=python|typescript|go|rust|cpp|java|kotlin|flutter|auto] [--scope=all|step:<n>|range:<a>-<b>] [--dry-run]
  • <plan-doc-path> — 必需;相对或绝对路径(@docs/... 可接受)。
  • --lang — 审查语言变体;默认为 auto(从项目检测)。
  • --scope — 限制输出的步骤;默认为 all。
  • --dry-run — 仅打印分解和链理由;不输出最终提示。

权威性 /orchestrate 格式(不得偏离)

{ORCH_CMD} custom "<agent1>,<agent2>,...,<agentN>" "<task description>"

其中 {ORCH_CMD} 在阶段 0 中确定(见下文)。输出命令字符串始终使用一种具体形式——从不使用两种,也不使用占位符。

  • custom 是顺序链;每个智能体的 HANDOFF 传递给下一个。
  • 逗号分隔的智能体列表。无空格优先;容忍一个空格。
  • 不存在 --mode / --gate / --agents=... 标志——切勿发明它们。
  • 智能体名称来自本技能中的目录。任务描述中的嵌入双引号应转义为 \"。

ECC 安装形式和命名空间

两种安装形式决定了斜杠命令和每个智能体名称的前缀。两者必须保持同步——每次输出只使用一种形式,永不混合:

令 <claude-home> 表示 Claude Code 主目录:macOS/Linux 上为 ~/.claude,Windows 上为 %USERPROFILE%\.claude。按照宿主平台解析用户主目录的方式解析(不要硬编码 ~)。

形式检测{ORCH_CMD}智能体名称格式
插件安装 (2.0.0+)<claude-home>/plugins/marketplaces/ecc/ 存在/ecc:orchestrateecc:<name>
旧版裸安装上述不存在;智能体文件位于 <claude-home>/agents//orchestrate<name>

为何重要:在插件安装下,智能体注册为 ecc:tdd-guide。裸名称会强制进行模糊匹配,在并行调用下可能间歇性失败。在旧版下,前缀形式未注册,会直接失败。

可用智能体目录(必须从中选择)

通用:

  • planner — 需求重述、风险分解、步骤规划
  • architect — 架构、系统设计、重构建议
  • tdd-guide — 编写测试 → 实现 → 80%+ 覆盖率
  • code-reviewer — 通用代码审查
  • security-reviewer — 安全审计、OWASP、秘密泄露
  • refactor-cleaner — 死代码、重复、knip-class 清理
  • doc-updater — 文档、代码映射、README
  • docs-lookup — 第三方库 API 查找 (Context7)
  • e2e-runner — 端到端测试编排
  • database-reviewer — PostgreSQL 架构、迁移、性能
  • harness-optimizer — 本地智能体工具包配置
  • loop-operator — 长时间运行的自主循环
  • chief-of-staff — 多通道分类(很少适用于计划步骤)

构建错误解决器:

  • build-error-resolver (通用) / cpp-build-resolver / go-build-resolver / java-build-resolver / kotlin-build-resolver / rust-build-resolver / pytorch-build-resolver

代码审查员:

  • python-reviewer / typescript-reviewer / go-reviewer / rust-reviewer / cpp-reviewer / java-reviewer / kotlin-reviewer / flutter-reviewer

拼写错误的智能体名称会导致 /orchestrate 失败。在输出前请对照此列表检查。

工作原理

阶段 0 — 检测 ECC 模式和语言

  1. 读取 <plan-doc-path>。如果缺失或为空,报告并停止。

  2. 检测 ECC 安装形式一次,并冻结为 ECC_MODE。算法(按顺序执行,在第一个匹配处停止):

    1. 如果 <claude-home>/plugins/marketplaces/ecc/ 存在 → ECC_MODE=plugin。
    2. 否则如果 <claude-home>/agents/ 存在且至少包含一个 ECC 智能体文件(例如 tdd-guide.md、code-reviewer.md)→ ECC_MODE=legacy。
    3. 否则 → 默认 ECC_MODE=legacy 并在输出顶部发出单行警告:> Warning: could not detect ECC install; defaulting to legacy form. If you use the plugin install, edit the prefixes manually.
    4. 如果两个标记都存在(混合安装),plugin 优先级更高——插件命名空间是唯一能无需模糊匹配解析智能体名称的命名空间。

    从此刻起,输出的每一行都使用匹配的前缀,同时应用于斜杠命令和每个智能体名称。永远不要在同一个输出中同时输出两种形式。

  3. 解析 --lang。当为 auto 时,运行一种多语言感知检测:

    • 探测标记:pyproject.toml / uv.lock / requirements.txt → python;package.json → typescript;go.mod → go;Cargo.toml → rust;CMakeLists.txt 或顶层 *.cpp → cpp;pom.xml / build.gradle(Java)→ java;build.gradle.kts 或顶层 Kotlin → kotlin;pubspec.yaml → flutter。
    • 多语言平局处理:如果匹配了多个标记,选择源文件数量最多的语言(通过 git ls-files 计数,排除 vendor/、node_modules/、dist/、build/、.venv/、生成的文件和明显的测试夹具)。平局或当没有语言超过源文件的 60% 时,设置 lang=unknown。
    • 未匹配任何标记 → 设置 lang=unknown。
    • lang=unknown 是一个哨兵值——它不是智能体名称。阶段 2 的规则 4 和 5 在链组合时将其转换为 code-reviewer / build-error-resolver。
  4. 检测 PyTorch 子配置文件:当 lang=python 且 pyproject.toml / requirements.txt / uv.lock 中任何一个声明了对 torch 的依赖时,设置 pytorch=true。这仅影响 build 链选择(下面的阶段 2 规则);审查员保持为 python-reviewer。

  5. 规范化计划中声明的任何智能体名称:如果计划文本引用了插件前缀形式的智能体(例如 ecc:tdd-guide),剥离前缀以在验证或组合链之前获得裸目录名称。重新添加前缀仅在输出时根据 ECC_MODE 进行(阶段 4)。绝不允许预先添加前缀的名称流入链组合——否则在插件模式下会双重添加前缀。

阶段 1 — 分解步骤

按优先级顺序识别“步骤单元”:

  1. 明确编号:## Step N / ### Phase N / ## N. ... / 顶层有序列表。
  2. 表格中的“步骤”列。
  3. --- 分隔的块,带有动词开头的标题。
  4. 否则,将每个 H2 视为一个步骤。

为每步提取 id(从 1 开始)、title(≤ 80 字符)、intent(1–3 句话)、tags。

阶段 2 — 标记并选择链

按意图标记(允许多个标记;链从主要标记和叠加的次要标记构建):

下面的触发词不区分大小写匹配。支持多语言计划,只要含义与列出的英文触发词一致,即可匹配任何语言的词干。

标签触发词默认链
designarchitecture, design, choose, evaluate, RFCplanner,architect
planplan, breakdown, milestoneplanner
implimplement, build, add, create, porttdd-guide,<lang>-reviewer
testtest, coverage, e2e, integrationtdd-guide,e2e-runner
refactorrefactor, cleanup, dedupe, splitarchitect,refactor-cleaner,<lang>-reviewer
migrationmigrate, upgrade, rewrite, portarchitect,tdd-guide,<lang>-reviewer
dbschema, migration, index, SQL, Postgres, alembic, sqlmodeldatabase-reviewer,<lang>-reviewer
securityencrypt, auth, secret, OWASP, PIIsecurity-reviewer,<lang>-reviewer
buildbuild, compile, lint failure, CI<lang>-build-resolver(回退到 build-error-resolver)
docsdocs, readme, codemap, changelogdoc-updater
lookuplookup, reference, API usagedocs-lookup
reviewreview, audit, verify<lang>-reviewer,code-reviewer
looploop, autonomous, watchdogloop-operator

链组合规则:

  1. 主要标签选择:当步骤匹配多个标签时,表格顺序中的第一个(表格顶部 = 最高优先级)是主要标签;其余是次要标签。下面的组合规则 2 和 3 明确处理特定的多标签组合;否则,按标签表顺序附加次要链。
  2. impl + security → tdd-guide,<lang>-reviewer,security-reviewer。
  3. impl + db → tdd-guide,database-reviewer,<lang>-reviewer。
  4. 去重结果链(保留首次出现的位置)。例如,review + lang=unknown 在规则 5 后会生成 code-reviewer,code-reviewer;去重将其合并为 code-reviewer。
  5. 当 lang=unknown 时,<lang>-reviewer 解析为 code-reviewer。
  6. 当 lang=unknown 时,<lang>-build-resolver 解析为 build-error-resolver。特殊情况:如果阶段 0 设置了 pytorch=true,则对于 build 链使用 pytorch-build-resolver,无论 <lang> 是什么。没有 python-build-resolver;没有 pytorch=true 的 --lang=python 解析为 build-error-resolver。
  7. 零标签步骤:如果没有匹配的触发词,将链设置为 code-reviewer 并在“链理由”下写入 no tag matched; default review-only chain。
  8. 去重后链长度 ≤ 4。如果超出,删除最弱的标签(优先删除 lookup 和 docs)。
  9. 不要在 impl 链中配对 planner 和 architect(浪费 token)。仅在 design 步骤中配对它们。
  10. 标记为 impl、refactor 或 migration 的步骤以审查员类智能体结束——可以是 <lang>-reviewer、code-reviewer、security-reviewer 或 database-reviewer。最特定领域的审查员占据尾部位置(例如规则 2 的 impl+security 以 security-reviewer 结束;规则 3 的 impl+db 以 <lang>-reviewer 结束,因为 database-reviewer 已在该链中更早地处理迁移)。test 和 build 步骤由其自身验证器(分别是 e2e-runner 和构建解决器)把关,不需要额外的审查员。

阶段 3 — 压缩任务描述

每个输出的 <task description> 必须:

  • 是自包含的(第一个智能体不需要打开计划文档)。
  • 以 [Plan: <path>#step-<id>] 开头。
  • 包含 1–3 条可验证的验收标准。
  • 仅当计划为此步骤声明了范围时,才包含范围保护(Out of scope: ...)。逐字继承。如果计划没有范围外声明,则完全省略该子句——不要发明一个。
  • 长度为 200–600 字符;单行;嵌入的 " 转义为 \";无字面换行。

阶段 4 — 输出

使用由 ECC_MODE 确定的形式输出 Markdown。输出始终使用一种形式——每个 {ORCH_CMD} 和每个智能体名称都使用阶段 0 的匹配前缀渲染。不要输出两种形式;不要在渲染输出中包含“这是插件形式”/“剥离前缀”的说明。

具体渲染规则:

  • {ORCH_CMD} = /ecc:orchestrate(plugin 下),/orchestrate(legacy 下)。
  • {AGENT(name)} = ecc:<name>(plugin 下),<name>(legacy 下)。
  • 概览表格的“链”列使用相同的 {AGENT(name)} 渲染。
  • 每步的 bash 代码块仅包含可运行的命令。没有 # plugin form 或 # legacy form 注释——形式是隐式的,并且在整个输出中保持一致。

输出结构:

# 计划编排结果

**计划**: `<path>`
**语言**: `<detected-or-given>`
**ECC 模式**: `<plugin | legacy>`
**步骤**: <N>
**范围**: <all | step:n | range:a-b>

## 步骤概览

| # | 标题 | 标签 | 链 |
|---|---|---|---|
| 1 | ... | impl, db | `{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}` |
| ... | | | |

---

## 步骤 1 — <title>

**意图**: <1–3 句话>
**标签**: <a, b>
**链理由**: <为什么选择此链;哪个智能体完成循环>

```bash
{ORCH_CMD} custom "{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}" "[Plan: docs/foo.md#step-1] <compressed task description>; Acceptance: <1–3 items>; Out of scope: <…>"

> 上述 `{ORCH_CMD}` 和 `{AGENT(...)}` 符号描述此技能在运行时执行的替换。实际输出的 Markdown 包含已解析的字符串,绝不包含占位符。

在最后附加一个“批量执行”块,按顺序汇总每一步的命令,以便用户可以一次性粘贴所有命令。**在仅概览模式下跳过“批量执行”块**(参见“大型计划”边缘情况):当仅输出概览表格时,没有可以聚合的逐步骤命令。

### 阶段 5 — 自我检查(在输出前执行)

- [ ] 每个链中的每个智能体都来自目录(在剥离计划中出现的任何 `ecc:` 前缀后;参见阶段 0 步骤 5)。
- [ ] 已解析的 `{ORCH_CMD}` 和每个已解析的 `{AGENT(...)}` 使用**相同**形式(`plugin` 或 `legacy`)——绝不在一个输出中混合。
- [ ] 在渲染的输出中没有 `# plugin form` / `# legacy form` 注释和“剥离前缀”的说明。
- [ ] 没有发明的 `--mode` / `--gate` / `--agents=...` 字段。
- [ ] 每个任务描述是单行、双引号括起,其中嵌入的 `

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能