diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 0daba52b..ad52a4e7 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -11,7 +11,7 @@ { "name": "ecc", "source": "./", - "description": "The most comprehensive Claude Code plugin — 54 agents, 206 skills, 70 legacy command shims, selective install profiles, and production-ready hooks for TDD, security scanning, code review, and continuous learning", + "description": "The most comprehensive Claude Code plugin — 54 agents, 207 skills, 70 legacy command shims, selective install profiles, and production-ready hooks for TDD, security scanning, code review, and continuous learning", "version": "2.0.0-rc.1", "author": { "name": "Affaan Mustafa", diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 36395c2f..1fe2e5a8 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "ecc", "version": "2.0.0-rc.1", - "description": "Battle-tested Claude Code plugin for engineering teams — 54 agents, 206 skills, 70 legacy command shims, production-ready hooks, and selective install workflows evolved through continuous real-world use", + "description": "Battle-tested Claude Code plugin for engineering teams — 54 agents, 207 skills, 70 legacy command shims, production-ready hooks, and selective install workflows evolved through continuous real-world use", "author": { "name": "Affaan Mustafa", "url": "https://x.com/affaanmustafa" diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 58cc04bc..63616987 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "ecc", "version": "2.0.0-rc.1", - "description": "Battle-tested Codex workflows — 200 shared ECC skills, production-ready MCP configs, and selective-install-aligned conventions for TDD, security scanning, code review, and autonomous development.", + "description": "Battle-tested Codex workflows — 207 shared ECC skills, production-ready MCP configs, and selective-install-aligned conventions for TDD, security scanning, code review, and autonomous development.", "author": { "name": "Affaan Mustafa", "email": "me@affaanmustafa.com", @@ -15,7 +15,7 @@ "mcpServers": "./.mcp.json", "interface": { "displayName": "Everything Claude Code", - "shortDescription": "200 battle-tested ECC skills plus MCP configs for TDD, security, code review, and autonomous development.", + "shortDescription": "207 battle-tested ECC skills plus MCP configs for TDD, security, code review, and autonomous development.", "longDescription": "Everything Claude Code (ECC) is a community-maintained collection of Codex-ready skills and MCP configs evolved over 10+ months of intensive daily use. It covers TDD workflows, security scanning, code review, architecture decisions, operator workflows, and more — all in one installable plugin.", "developerName": "Affaan Mustafa", "category": "Productivity", diff --git a/AGENTS.md b/AGENTS.md index 78704a58..5011c4a9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # Everything Claude Code (ECC) — Agent Instructions -This is a **production-ready AI coding plugin** providing 54 specialized agents, 206 skills, 70 commands, and automated hook workflows for software development. +This is a **production-ready AI coding plugin** providing 54 specialized agents, 207 skills, 70 commands, and automated hook workflows for software development. **Version:** 2.0.0-rc.1 @@ -147,7 +147,7 @@ Troubleshoot failures: check test isolation → verify mocks → fix implementat ``` agents/ — 54 specialized subagents -skills/ — 206 workflow skills and domain knowledge +skills/ — 207 workflow skills and domain knowledge commands/ — 70 slash commands hooks/ — Trigger-based automations rules/ — Always-follow guidelines (common + per-language) diff --git a/README.md b/README.md index d2c40764..dc47acda 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ This repo is the raw code only. The guides explain everything. ### v2.0.0-rc.1 — Surface Refresh, Operator Workflows, and ECC 2.0 Alpha (Apr 2026) - **Dashboard GUI** — New Tkinter-based desktop application (`ecc_dashboard.py` or `npm run dashboard`) with dark/light theme toggle, font customization, and project logo in header and taskbar. -- **Public surface synced to the live repo** — metadata, catalog counts, plugin manifests, and install-facing docs now match the actual OSS surface: 54 agents, 206 skills, and 70 legacy command shims. +- **Public surface synced to the live repo** — metadata, catalog counts, plugin manifests, and install-facing docs now match the actual OSS surface: 54 agents, 207 skills, and 70 legacy command shims. - **Operator and outbound workflow expansion** — `brand-voice`, `social-graph-ranker`, `connections-optimizer`, `customer-billing-ops`, `ecc-tools-cost-audit`, `google-workspace-ops`, `project-flow-ops`, and `workspace-surface-audit` round out the operator lane. - **Media and launch tooling** — `manim-video`, `remotion-video-creation`, and upgraded social publishing surfaces make technical explainers and launch content part of the same system. - **Framework and product surface growth** — `nestjs-patterns`, richer Codex/OpenCode install surfaces, and expanded cross-harness packaging keep the repo usable beyond Claude Code alone. @@ -358,7 +358,7 @@ If you stacked methods, clean up in this order: /plugin list ecc@ecc ``` -**That's it!** You now have access to 54 agents, 206 skills, and 70 legacy command shims. +**That's it!** You now have access to 54 agents, 207 skills, and 70 legacy command shims. ### Dashboard GUI @@ -1351,7 +1351,7 @@ The configuration is automatically detected from `.opencode/opencode.json`. |---------|-------------|----------|--------| | Agents | PASS: 54 agents | PASS: 12 agents | **Claude Code leads** | | Commands | PASS: 70 commands | PASS: 35 commands | **Claude Code leads** | -| Skills | PASS: 206 skills | PASS: 37 skills | **Claude Code leads** | +| Skills | PASS: 207 skills | PASS: 37 skills | **Claude Code leads** | | Hooks | PASS: 8 event types | PASS: 11 events | **OpenCode has more!** | | Rules | PASS: 29 rules | PASS: 13 instructions | **Claude Code leads** | | MCP Servers | PASS: 14 servers | PASS: Full | **Full parity** | @@ -1456,7 +1456,7 @@ ECC is the **first plugin to maximize every major AI coding tool**. Here's how e |---------|------------|------------|-----------|----------| | **Agents** | 54 | Shared (AGENTS.md) | Shared (AGENTS.md) | 12 | | **Commands** | 70 | Shared | Instruction-based | 35 | -| **Skills** | 206 | Shared | 10 (native format) | 37 | +| **Skills** | 207 | Shared | 10 (native format) | 37 | | **Hook Events** | 8 types | 15 types | None yet | 11 types | | **Hook Scripts** | 20+ scripts | 16 scripts (DRY adapter) | N/A | Plugin hooks | | **Rules** | 34 (common + lang) | 34 (YAML frontmatter) | Instruction-based | 13 instructions | diff --git a/README.zh-CN.md b/README.zh-CN.md index 4e20ab56..cd666327 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -160,7 +160,7 @@ Copy-Item -Recurse rules/typescript "$HOME/.claude/rules/" /plugin list ecc@ecc ``` -**完成!** 你现在可以使用 54 个代理、206 个技能和 70 个命令。 +**完成!** 你现在可以使用 54 个代理、207 个技能和 70 个命令。 ### multi-* 命令需要额外配置 diff --git a/agent.yaml b/agent.yaml index 90c2bc16..ee58d0f5 100644 --- a/agent.yaml +++ b/agent.yaml @@ -103,6 +103,7 @@ skills: - perl-security - perl-testing - plankton-code-quality + - plan-orchestrate - postgres-patterns - product-lens - production-scheduling diff --git a/docs/zh-CN/AGENTS.md b/docs/zh-CN/AGENTS.md index 3c52e1f6..65443453 100644 --- a/docs/zh-CN/AGENTS.md +++ b/docs/zh-CN/AGENTS.md @@ -1,6 +1,6 @@ # Everything Claude Code (ECC) — 智能体指令 -这是一个**生产就绪的 AI 编码插件**,提供 54 个专业代理、206 项技能、70 条命令以及自动化钩子工作流,用于软件开发。 +这是一个**生产就绪的 AI 编码插件**,提供 54 个专业代理、207 项技能、70 条命令以及自动化钩子工作流,用于软件开发。 **版本:** 2.0.0-rc.1 @@ -147,7 +147,7 @@ ``` agents/ — 54 个专业子代理 -skills/ — 206 个工作流技能和领域知识 +skills/ — 207 个工作流技能和领域知识 commands/ — 70 个斜杠命令 hooks/ — 基于触发的自动化 rules/ — 始终遵循的指导方针(通用 + 每种语言) diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index 0d14909a..e508c07b 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -224,7 +224,7 @@ Copy-Item -Recurse rules/typescript "$HOME/.claude/rules/" /plugin list ecc@ecc ``` -**搞定!** 你现在可以使用 54 个智能体、206 项技能和 70 个命令了。 +**搞定!** 你现在可以使用 54 个智能体、207 项技能和 70 个命令了。 *** @@ -1134,7 +1134,7 @@ opencode |---------|-------------|----------|--------| | 智能体 | PASS: 54 个 | PASS: 12 个 | **Claude Code 领先** | | 命令 | PASS: 70 个 | PASS: 35 个 | **Claude Code 领先** | -| 技能 | PASS: 206 项 | PASS: 37 项 | **Claude Code 领先** | +| 技能 | PASS: 207 项 | PASS: 37 项 | **Claude Code 领先** | | 钩子 | PASS: 8 种事件类型 | PASS: 11 种事件 | **OpenCode 更多!** | | 规则 | PASS: 29 条 | PASS: 13 条指令 | **Claude Code 领先** | | MCP 服务器 | PASS: 14 个 | PASS: 完整 | **完全对等** | @@ -1242,7 +1242,7 @@ ECC 是**第一个最大化利用每个主要 AI 编码工具的插件**。以 |---------|------------|------------|-----------|----------| | **智能体** | 54 | 共享 (AGENTS.md) | 共享 (AGENTS.md) | 12 | | **命令** | 70 | 共享 | 基于指令 | 35 | -| **技能** | 206 | 共享 | 10 (原生格式) | 37 | +| **技能** | 207 | 共享 | 10 (原生格式) | 37 | | **钩子事件** | 8 种类型 | 15 种类型 | 暂无 | 11 种类型 | | **钩子脚本** | 20+ 个脚本 | 16 个脚本 (DRY 适配器) | N/A | 插件钩子 | | **规则** | 34 (通用 + 语言) | 34 (YAML 前页) | 基于指令 | 13 条指令 | diff --git a/mcp-configs/mcp-servers.json b/mcp-configs/mcp-servers.json index 03e2e2fb..993f4235 100644 --- a/mcp-configs/mcp-servers.json +++ b/mcp-configs/mcp-servers.json @@ -41,6 +41,11 @@ "args": ["omega-memory", "serve"], "description": "Persistent agent memory with semantic search, multi-agent coordination, and knowledge graphs — run via uvx (richer than the basic memory store)" }, + "longhand": { + "command": "longhand", + "args": ["mcp-server"], + "description": "Lossless Claude Code session history — indexes raw tool calls, file edits, and thinking blocks from ~/.claude/projects/*.jsonl into local SQLite + ChromaDB before Claude Code rotates them. Complements memory/omega-memory (synthesized) with verbatim recall. Install: pip install longhand && longhand setup" + }, "sequential-thinking": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"], diff --git a/skills/plan-orchestrate/SKILL.md b/skills/plan-orchestrate/SKILL.md new file mode 100644 index 00000000..68c03db9 --- /dev/null +++ b/skills/plan-orchestrate/SKILL.md @@ -0,0 +1,262 @@ +--- +name: plan-orchestrate +description: Read a plan document, decompose it into steps, design a per-step agent chain from the ECC catalogue, and emit ready-to-paste /orchestrate custom prompts. Generative only — never invokes /orchestrate itself. Use when the user has a multi-step plan and wants to drive it through orchestrate without composing chains by hand. +origin: ECC +--- + +# Plan Orchestrate + +Bridge a plan document to `/orchestrate custom` by emitting one ready-to-paste invocation per step. The skill is generative only — it never executes `/orchestrate`. The user pastes each line when ready. + +## When to Activate + +- User has a multi-step plan document (PRD, RFC, implementation plan) and wants to drive it through `/orchestrate`. +- User says "orchestrate this plan", "give me orchestrate prompts for each step", "compose chains for this plan". +- A step-by-step plan exists but the user does not want to manually pick agents per step. + +Skip when: +- The work is one ad-hoc step → call `/orchestrate custom` directly. +- The plan is unreadable or empty. Lack of explicit numbering alone is not a skip condition — see the "No clear steps" edge case below. + +## Inputs + +``` + [--lang=python|typescript|go|rust|cpp|java|kotlin|flutter|auto] [--scope=all|step:|range:-] [--dry-run] +``` + +- `` — required; relative or absolute path (`@docs/...` accepted). +- `--lang` — reviewer language variant; defaults to `auto` (detected from project). +- `--scope` — limits emitted steps; defaults to `all`. +- `--dry-run` — print decomposition + chain rationale only; do not emit final prompts. + +## Authoritative `/orchestrate` shape (do not deviate) + +``` +{ORCH_CMD} custom ",,...," "" +``` + +Where `{ORCH_CMD}` is determined in Phase 0 (see below). The command string in the emitted output **always uses one concrete form** — never both, never a placeholder. + +- `custom` is a sequential chain; each agent's HANDOFF feeds the next. +- Comma-separated agent list. No spaces preferred; one space tolerated. +- No `--mode` / `--gate` / `--agents=...` flags exist — never invent them. +- Agent names come from the catalogue in this skill. Embedded double quotes in the task description are escaped as `\"`. + +## ECC install form and namespacing + +Two install forms determine the prefix on **both** the slash command and every agent name. The two MUST stay in sync — one form per output, never mixed: + +Let `` denote the Claude Code home directory: `~/.claude` on macOS/Linux, `%USERPROFILE%\.claude` on Windows. Resolve it the way the host platform resolves the user home directory (do not hardcode `~`). + +| Form | Detection | `{ORCH_CMD}` | Agent name format | +|---|---|---|---| +| Plugin install (1.9.0+) | `/plugins/marketplaces/everything-claude-code/` exists | `/everything-claude-code:orchestrate` | `everything-claude-code:` | +| Legacy bare install | Above absent; agent files under `/agents/` | `/orchestrate` | `` | + +Why this matters: under the plugin install, agents register as `everything-claude-code:tdd-guide`. Bare names force fuzzy matching, which fails intermittently under parallel calls. Under legacy, the prefixed forms are not registered and fail outright. + +## Available agent catalogue (must pick from these) + +General: +- `planner` — requirement restatement, risk decomposition, step planning +- `architect` — architecture, system design, refactor proposals +- `tdd-guide` — write tests → implement → 80%+ coverage +- `code-reviewer` — generic code review +- `security-reviewer` — security audit, OWASP, secret leakage +- `refactor-cleaner` — dead code, duplicates, knip-class cleanup +- `doc-updater` — documentation, codemap, README +- `docs-lookup` — third-party library API lookups (Context7) +- `e2e-runner` — end-to-end test orchestration +- `database-reviewer` — PostgreSQL schema, migration, performance +- `harness-optimizer` — local agent harness configuration +- `loop-operator` — long-running autonomous loops +- `chief-of-staff` — multi-channel triage (rarely a fit for plan steps) + +Build error resolvers: +- `build-error-resolver` (generic) / `cpp-build-resolver` / `go-build-resolver` / `java-build-resolver` / `kotlin-build-resolver` / `rust-build-resolver` / `pytorch-build-resolver` + +Code reviewers: +- `python-reviewer` / `typescript-reviewer` / `go-reviewer` / `rust-reviewer` / `cpp-reviewer` / `java-reviewer` / `kotlin-reviewer` / `flutter-reviewer` + +A misspelled agent name fails `/orchestrate`. Cross-check against this list before emitting. + +## How It Works + +### Phase 0 — Detect ECC mode + language + +1. Read ``. If missing or empty, report and stop. +2. Detect ECC install form once and freeze it into `ECC_MODE`. Algorithm (run in order, stop at the first match): + 1. If `/plugins/marketplaces/everything-claude-code/` exists → `ECC_MODE=plugin`. + 2. Else if `/agents/` exists and contains at least one ECC agent file (e.g. `tdd-guide.md`, `code-reviewer.md`) → `ECC_MODE=legacy`. + 3. Else → default to `ECC_MODE=legacy` and emit a one-line warning at the top of the output: `> Warning: could not detect ECC install; defaulting to legacy form. If you use the plugin install, edit the prefixes manually.` + 4. If both markers exist (mixed install), `plugin` wins — the plugin namespace is the only one that resolves agent names without fuzzy matching. + + From this point on, every emitted line uses the matching prefix on **both** the slash command and every agent name. **Never emit both forms in the same output.** +3. Resolve `--lang`. When `auto`, run a polyglot-aware detection: + - Probe markers: `pyproject.toml` / `uv.lock` / `requirements.txt` → python; `package.json` → typescript; `go.mod` → go; `Cargo.toml` → rust; `CMakeLists.txt` or top-level `*.cpp` → cpp; `pom.xml` / `build.gradle` (Java) → java; `build.gradle.kts` or top-level Kotlin → kotlin; `pubspec.yaml` → flutter. + - **Polyglot tie-break**: if more than one marker matches, pick the language whose source files outnumber the others (count via `git ls-files`, excluding `vendor/`, `node_modules/`, `dist/`, `build/`, `.venv/`, generated files, and obvious test fixtures). On a tie or when no language exceeds 60% of source files, set `lang=unknown`. + - No marker matched → set `lang=unknown`. + - `lang=unknown` is a sentinel — it is **not** an agent name. Phase 2 rules 4 and 5 turn it into `code-reviewer` / `build-error-resolver` at chain composition time. +4. Detect a **PyTorch sub-profile**: when `lang=python` and any of `pyproject.toml` / `requirements.txt` / `uv.lock` declares a dependency on `torch`, set `pytorch=true`. This only affects `build` chain selection (Phase 2 rule below); the reviewer remains `python-reviewer`. +5. **Normalize any agent names declared in the plan**: if the plan text references agents by their plugin-prefixed form (e.g. `everything-claude-code:tdd-guide`), strip the prefix to get the bare catalogue name before validating or composing chains. Re-prefixing happens only at output time per `ECC_MODE` (Phase 4). Never let a pre-prefixed name flow into chain composition — it would double-prefix in plugin mode. + +### Phase 1 — Decompose steps + +Identify "step units" in priority order: + +1. Explicit numbering: `## Step N` / `### Phase N` / `## N. ...` / top-level ordered list. +2. A "Step" column in a table. +3. `---`-separated blocks with verb-led headings. +4. Otherwise treat each H2 as one step. + +Per step extract `id` (1-based), `title` (≤ 80 chars), `intent` (1–3 sentences), `tags`. + +### Phase 2 — Tag and pick chain + +Tag by intent (multi-tag allowed; chain built from primary + stacked secondaries): + +Trigger words below are matched case-insensitively. Multilingual plans are supported by matching the word stems in any language as long as the meaning aligns with the listed English trigger words. + +| Tag | Trigger words | Default chain | +|---|---|---| +| `design` | architecture, design, choose, evaluate, RFC | `planner,architect` | +| `plan` | plan, breakdown, milestone | `planner` | +| `impl` | implement, build, add, create, port | `tdd-guide,-reviewer` | +| `test` | test, coverage, e2e, integration | `tdd-guide,e2e-runner` | +| `refactor` | refactor, cleanup, dedupe, split | `architect,refactor-cleaner,-reviewer` | +| `migration` | migrate, upgrade, rewrite, port | `architect,tdd-guide,-reviewer` | +| `db` | schema, migration, index, SQL, Postgres, alembic, sqlmodel | `database-reviewer,-reviewer` | +| `security` | encrypt, auth, secret, OWASP, PII | `security-reviewer,-reviewer` | +| `build` | build, compile, lint failure, CI | `-build-resolver` (falls back to `build-error-resolver`) | +| `docs` | docs, readme, codemap, changelog | `doc-updater` | +| `lookup` | lookup, reference, API usage | `docs-lookup` | +| `review` | review, audit, verify | `-reviewer,code-reviewer` | +| `loop` | loop, autonomous, watchdog | `loop-operator` | + +Chain composition rules: +1. **Primary tag selection**: when a step matches multiple tags, the **first one in table order** (top of the table = highest priority) is the primary; the rest are secondaries. Composition rules 2 and 3 below handle specific multi-tag combinations explicitly; otherwise, append secondary chains in tag table order. +2. `impl` + `security` → `tdd-guide,-reviewer,security-reviewer`. +3. `impl` + `db` → `tdd-guide,database-reviewer,-reviewer`. +4. **Deduplicate** the resulting chain (preserve first occurrence). E.g. `review` + `lang=unknown` would yield `code-reviewer,code-reviewer` after rule 5; deduplication collapses it to `code-reviewer`. +5. `-reviewer` resolves to `code-reviewer` when `lang=unknown`. +6. `-build-resolver` resolves to `build-error-resolver` when `lang=unknown`. **Special case**: if Phase 0 set `pytorch=true`, use `pytorch-build-resolver` for `build` chains regardless of ``. There is no `python-build-resolver`; `--lang=python` without `pytorch=true` resolves to `build-error-resolver`. +7. **Zero-tag steps**: if no trigger word matches, set chain to `code-reviewer` and write `no tag matched; default review-only chain` under "Chain rationale". +8. Chain length ≤ 4 after deduplication. If exceeded, drop weakest tag (`lookup` and `docs` first). +9. Do not pair `planner` and `architect` in an `impl` chain (token waste). Pair them only on `design` steps. +10. Steps tagged `impl`, `refactor`, or `migration` end with a **reviewer-class** agent — any of `-reviewer`, `code-reviewer`, `security-reviewer`, or `database-reviewer`. The most domain-specific reviewer wins the tail position (e.g. rule 2's `impl+security` ends with `security-reviewer`; rule 3's `impl+db` ends with `-reviewer` because `database-reviewer` already gates the migration earlier in the chain). `test` and `build` steps are gated by their own validators (`e2e-runner` and the build resolver respectively) and do not require an additional reviewer. + +### Phase 3 — Compress task description + +Each emitted `` must: +- Be self-contained (the first agent does not need the plan document open). +- Start with `[Plan: #step-]`. +- Include 1–3 verifiable Acceptance criteria. +- Include a Scope guard (`Out of scope: ...`) **only if the plan declares one for this step**. Inherit verbatim. If the plan has no out-of-scope statement, omit the clause entirely — do not invent one. +- Be 200–600 characters; one line; embedded `"` escaped as `\"`; no literal newlines. + +### Phase 4 — Output + +Emit Markdown using **the form determined by `ECC_MODE`**. The output uses one form throughout — every `{ORCH_CMD}` and every agent name is rendered with the matching prefix from Phase 0. **Do not emit both forms; do not include "this is plugin form" / "strip the prefix" instructions in the rendered output.** + +Concrete rendering rules: + +- `{ORCH_CMD}` = `/everything-claude-code:orchestrate` under `plugin`, `/orchestrate` under `legacy`. +- `{AGENT(name)}` = `everything-claude-code:` under `plugin`, `` under `legacy`. +- The overview-table "Chain" column uses the same `{AGENT(name)}` rendering. +- Per-step bash blocks contain only the runnable command. **No `# plugin form` or `# legacy form` comments** — the form is implicit and uniform across the whole output. + +Output structure: + +````markdown +# Plan-Orchestrate Result + +**Plan**: `` +**Lang**: `` +**ECC mode**: `` +**Steps**: +**Scope**: + +## Steps overview + +| # | Title | Tags | Chain | +|---|---|---|---| +| 1 | ... | impl, db | `{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}` | +| ... | | | | + +--- + +## Step 1 — + +**Intent**: <1–3 sentences> +**Tags**: <a, b> +**Chain rationale**: <why this chain; which agent closes the loop> + +```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: <…>" +``` +```` + +> The `{ORCH_CMD}` and `{AGENT(...)}` notation above describes the substitution this skill performs at runtime. The actual emitted Markdown contains the resolved strings, never the placeholders. + +Append a final "Batch execution" block aggregating every step's command in order so the user can paste them all at once. **Skip the Batch block in overview-only mode** (see "Large plan" edge case): when only the overview table is being emitted, there are no per-step commands to aggregate. + +### Phase 5 — Self-check (run before emitting) + +- [ ] Every agent in every chain comes from the catalogue (after stripping any `everything-claude-code:` prefix that appeared in the plan; see Phase 0 step 5). +- [ ] Resolved `{ORCH_CMD}` and every resolved `{AGENT(...)}` use the **same** form (`plugin` or `legacy`) — never mixed in one output. +- [ ] No `# plugin form` / `# legacy form` annotations and no "strip the prefix" instructions remain in the rendered output. +- [ ] No invented `--mode` / `--gate` / `--agents=...` fields. +- [ ] Each task description is single-line, double-quoted, with embedded `"` escaped. +- [ ] Each task description begins with `[Plan: <path>#step-<id>]` and includes Acceptance (1–3 items). The `Out of scope:` clause is present only when inherited from the plan. +- [ ] No duplicate agent in any chain after Phase 2 dedup. +- [ ] Chain length ≤ 4. +- [ ] Steps tagged `impl`/`refactor`/`migration` end with a reviewer-class agent (`<lang>-reviewer`, `code-reviewer`, `security-reviewer`, or `database-reviewer`). `test` and `build` are exempt — see Phase 2 rule 10. +- [ ] Zero-tag steps emit `code-reviewer` with the rationale `no tag matched; default review-only chain`. +- [ ] Overview table lists every step in the plan, regardless of `--scope`. +- [ ] Per-step detail block count matches the resolved `--scope` (full plan when `--scope=all`; one block for `step:n`; range size for `range:a-b`). In overview-only mode, no per-step blocks and no Batch block are emitted. + +## Edge cases + +- **No clear steps**: prefer H2/H3 splitting; if still ambiguous, report "no structured steps detected" with the document outline and ask the user to confirm running by outline. +- **Large plan (>1500 lines)**: enter **overview-only mode** — emit only the overview table and ask the user to narrow with `--scope` before re-running for details. In this mode, skip per-step detail blocks and skip the Batch execution block. +- **Step too broad** (e.g. "complete all backend work"): do not force a single chain. Suggest splitting into N.a and N.b and propose a split. +- **Plan declares agents** (rare): first **strip any `everything-claude-code:` prefix** to get the bare catalogue name (Phase 0 step 5), then validate against the catalogue. Replace invalid agents and explain under "Chain rationale". The bare name is re-prefixed at output time per `ECC_MODE`. +- **Polyglot project where `--lang=auto` cannot pick a winner**: set `lang=unknown`; reviewer resolves to `code-reviewer` and build resolver to `build-error-resolver`. Mention the fallback under "Chain rationale". + +## Examples + +### Example 1 — Plugin mode, Python plan + +Input: +``` +plan-orchestrate @docs/plan/example-feature.md --lang=python +``` + +Excerpt of expected output: +````markdown +## Step 2 — Encrypt sensitive UserProfile fields + +**Intent**: Introduce an `EncryptedString` SQLAlchemy type and AES-GCM encrypt `birth_datetime` / `location` before persistence; load the key from an environment variable. +**Tags**: impl, security, db +**Chain rationale**: Security-sensitive write path, so `security-reviewer` closes the chain; `database-reviewer` validates the alembic migration; `python-reviewer` covers typing and PEP 8. + +```bash +/everything-claude-code:orchestrate custom "everything-claude-code:tdd-guide,everything-claude-code:database-reviewer,everything-claude-code:python-reviewer,everything-claude-code:security-reviewer" "[Plan: docs/plan/example-feature.md#step-2] Implement EncryptedString SQLAlchemy type and migrate UserProfile.birth_datetime/location columns; key from ENV APP_DB_KEY; Acceptance: encrypt/decrypt roundtrip tests pass; alembic upgrade/downgrade clean on empty DB; no plaintext in DB after migrate; Out of scope: cross-tenant profile sharing logic" +``` +```` + +### Example 2 — Legacy mode, same step + +If `ECC_MODE=legacy` were detected, the same step would be emitted as a single uniform command (no plugin-prefixed forms anywhere in the output): + +```bash +/orchestrate custom "tdd-guide,database-reviewer,python-reviewer,security-reviewer" "[Plan: docs/plan/example-feature.md#step-2] ..." +``` + +The two examples above illustrate **the two possible outputs** for two different environments. A single skill invocation produces only one of them, end to end. + +## Notes + +- Generative only. Never invoke `/orchestrate` from inside this skill. +- Match the language of the plan document for task descriptions (agent names always remain English). +- Do not insert "Co-Authored-By" lines or emoji in the output unless the user explicitly asks.