plan-orchestrate
affaan-m/ECC
計画文書を読み込み、それを各ステップに分解し、ECCカタログからステップごとのエージェントチェーンを設計し、実行することなく、そのまま貼り付けたりオーケストレーションしたりできるカスタムプロンプトを出力します。
...すべて拡張しますPlan Orchestrate
計画文書を/orchestrate customに連携し、各ステップごとに貼り付け可能な呼び出し文を1つ生成します。このスキルは生成専用であり、/orchestrate を実行することはありません。ユーザーは準備が整い次第、各行を貼り付けます。
有効にするタイミング
- ユーザーが複数ステップからなる計画文書(PRD、RFC、実装計画)を所持しており、それを
/orchestrateを通じて実行したい場合。 - ユーザーが「このプランをオーケストレートして」、「各ステップごとにオーケストレート用のプロンプトを表示して」、「このプランのチェーンを作成して」と発言する場合。
- 段階的な計画は存在するが、ユーザーは各ステップごとにエージェントを手動で選択したくない場合。
以下の場合はスキップ:
- 作業が単一のアドホックなステップである場合 → 直接
/orchestrate custom を呼び出します。 - 計画が判読不能、または空の場合。明示的な番号付けがないことだけではスキップ条件にはなりません — 以下の「明確なステップがない」というエッジケースを参照してください。
入力
[--lang=python|typescript|go|rust|cpp|java|kotlin|flutter|auto] [--scope=all|step:|range:-] [--dry-run]
— 必須。相対パスまたは絶対パス(@docs/...も有効)。--lang— レビュー対象の言語バリエーション。デフォルトはauto(プロジェクトから検出)。--scope— 出力されるステップを制限します。デフォルトはallです。--dry-run— 分解とチェーンの根拠のみを出力し、最終的なプロンプトは出力しない。
標準的な/orchestrateシェイプ(これから逸脱しないでください)
{ORCH_CMD} custom ",,...," ""
ここで、{ORCH_CMD}はフェーズ 0 で決定される(後述)。出力されるコマンド文字列は常に 1 つの具体的な形式を使用する— 両方を併用したり、プレースホルダーを使用したりしてはならない。
custom は順次連結されたチェーンであり、各エージェントの HANDOFF が次のエージェントに渡されます。- エージェントのリストはコンマ区切りです。スペースは含まないことが推奨されますが、1 スペース程度なら許容されます。
--mode/--gate/--agents=...といったフラグは存在しません。決してこれらを独自に作成しないでください。- エージェント名は、このスキル内のカタログから取得されます。タスクの説明文中に埋め込まれた二重引用符は、
\"としてエスケープされます。
ECCのインストール形式と名前空間
2つのインストール形式によって、スラッシュコマンドおよびすべてのエージェント名のプレフィックスが決定されます。これら2つは必ず同期を保つ必要があります。出力ごとに1つの形式を使用し、決して混在させてはいけません:
ここで をClaude Codeのホームディレクトリとします:macOS/Linuxでは~/.claude、Windowsでは%USERPROFILE%\.claude。ホストプラットフォームがユーザーのホームディレクトリを解決する方法に従って解決してください(~をハードコードしないでください)。
| 形式 | 検出 | {ORCH_CMD} |
エージェント名の形式 |
|---|---|---|---|
| プラグインのインストール (1.9.0 以降) | が存在する |
/everything-claude-code:orchestrate |
everything-claude-code: |
| 従来の基本インストール | 上記が存在しない場合、配下のエージェントファイル |
/orchestrate |
|
これが重要な理由:プラグインインストールでは、エージェントはeverything-claude-code:tdd-guide として登録されます。プレフィックスなしの名称ではあいまい一致が強制されるため、並列呼び出し時に断続的に失敗します。レガシー方式では、プレフィックス付きの形式は登録されず、即座に失敗します。
利用可能なエージェント一覧(これらの中から選択する必要があります)
一般:
planner— 要件の再定式化、リスクの分解、ステップごとの計画architect— アーキテクチャ、システム設計、リファクタリングの提案tdd-guide— テスト作成 → 実装 → カバレッジ80%以上コードレビュー担当者— 一般的なコードレビューセキュリティレビュー担当者— セキュリティ監査、OWASP、機密情報の漏洩リファクタリング・クリーナー— デッドコード、重複コード、knipクラスのクリーンアップdoc-updater— ドキュメント、コードマップ、READMEdocs-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 モードと言語の検出
読み込み
。欠落または空の場合は、報告して停止する。ECCのインストール形式を一度検出し、それを
ECC_MODEとして固定する。アルゴリズム(順に実行し、最初の一致で停止):が存在する場合 →/plugins/marketplaces/everything-claude-code/ ECC_MODE=plugin。- それ以外の場合、
が存在し、少なくとも 1 つの ECC エージェントファイル(例:/agents/ tdd-guide.md、code-reviewer.md)が含まれている場合 →ECC_MODE=legacy。 - それ以外の場合 → デフォルトで
ECC_MODE=legacyとし、出力の先頭に 1 行の警告を出力します:> 警告: ECC のインストールを検出できませんでした。デフォルトでレガシー形式を使用します。プラグインインストールを使用する場合は、プレフィックスを手動で編集してください。 - 両方のマーカーが存在する場合(混合インストール)、
プラグインが優先されます。つまり、プラグインのネームスペースのみが、あいまい一致なしでエージェント名を解決します。
この時点以降、出力されるすべての行では、スラッシュコマンドとすべてのエージェント名の両方に、一致するプレフィックスが使用されます。同じ出力に両方の形式を出力することは決してありません。
--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 により、チェーン構成時にこれがコードレビュー担当者/ビルドエラー解決担当者に変換されます。
- 検出対象のマーカー:
PyTorch サブプロファイルを検出:
lang=pythonであり、かつpyproject.toml/requirements.txt/uv.lockのいずれかでtorchへの依存関係が宣言されている場合、pytorch=trueに設定します。これはビルドチェーンの選択(以下のフェーズ 2 のルール)にのみ影響し、レビュアーはpython-reviewerのままです。プラン内で宣言されたエージェント名を正規化する:プランのテキスト内で、プラグイン接頭辞が付いた形式(例:
everything-claude-code:tdd-guide)でエージェントが参照されている場合、チェーンの検証や構成を行う前に、接頭辞を削除してカタログ名のみを取得する。 プレフィックスの再付与は、ECC_MODEに基づき出力時(フェーズ 4)にのみ行われます。プレフィックスが既に付与された名前がチェーンの構成に流れないようにしてください。そうしないと、プラグインモードでプレフィックスが二重に付与されてしまいます。
フェーズ 1 — ステップの分解
優先順位に従って「ステップ単位」を特定します:
- 明示的な番号付け:
## ステップ N/### フェーズ N/## N. .../ トップレベルの順序付きリスト。 - 表内の「ステップ」列。
----で区切られた、動詞で始まる見出しを持つブロック。- それ以外の場合は、各H2見出しを1つのステップとして扱う。
ステップごとに、ID(1から始まる)、タイトル(80文字以内)、意図(1~3文)、タグを抽出する。
フェーズ 2 — タグ付けとチェーンの選定
意図に基づいてタグ付けを行う(複数タグ可。チェーンは主要タグ+積み重ねられた二次タグで構成):
以下のトリガーワードは、大文字小文字を区別せずに照合されます。多言語プランは、意味が記載された英語のトリガーワードと一致する限り、どの言語の語幹とも照合することでサポートされます。
| タグ | トリガーワード | デフォルトのチェーン |
|---|---|---|
design |
アーキテクチャ、設計、選択、評価、RFC | プランナー、アーキテクト |
計画 |
計画、内訳、マイルストーン | プランナー |
実装 |
実装、構築、追加、作成、移植 | tdd-guide、 |
test |
テスト、カバレッジ、E2E、統合 | tdd-guide, e2e-runner |
リファクタリング |
リファクタリング、クリーンアップ、重複排除、分割 | architect、refactor-cleaner、 |
移行 |
移行、アップグレード、書き換え、移植 | architect,tdd-guide, |
db |
スキーマ、移行、インデックス、SQL、Postgres、alembic、sqlmodel | database-reviewer、 |
セキュリティ |
暗号化、認証、シークレット、OWASP、PII | security-reviewer、 |
ビルド |
ビルド、コンパイル、lint エラー、CI | (build-error-resolverにフォールバック) |
ドキュメント |
ドキュメント、README、コードマップ、変更履歴 | doc-updater |
検索 |
lookup、リファレンス、APIの使用方法 | docs-lookup |
レビュー |
レビュー、監査、検証 | |
ループ |
ループ、自律型、ウォッチドッグ | ループ演算子 |
チェーン構成ルール:
- プライマリタグの選択:あるステップが複数のタグに一致する場合、テーブル順で最初のもの(テーブルの先頭=最優先)がプライマリとなり、残りはセカンダリとなる。以下の構成ルール2および3は、特定のマルチタグの組み合わせを明示的に扱う。それ以外の場合は、タグテーブルの順序に従ってセカンダリチェーンを連結する。
impl+security→tdd-guide,.-reviewer,security-reviewer impl+db→tdd-guide,database-reviewer,。-reviewer - 結果として得られたチェーンから重複を削除する(最初に現れたものを保持する)。例:
review+lang=unknownの場合、ルール5の適用後はcode-reviewer,code-reviewerとなるが、重複削除によりcode-reviewerに統合される。 、-reviewer は lang=unknownの場合、code-reviewerに解決される。-build-res olverは、lang=unknownの場合、build-error-resolverに解決されます。特例:フェーズ 0 でpytorch=trueが設定されている場合、。python-build-resolverは存在しません。pytorch=trueでない場合の--lang=pythonは、build-error-resolverに解決されます。- タグなしのステップ:一致するトリガーワードがない場合、チェーンを
code-reviewerに設定し、「一致するタグなし」と記述する。「チェーンの根拠」の下に、デフォルトのレビュー専用チェーンを記載する。 - 重複除去後のチェーンの長さは 4 以下とする。これを超える場合は、最も弱いタグを削除する(
検索とドキュメントを優先)。 実装チェーンでは、plannerとarchitectをペアにしない(トークンの無駄)。これらをペアにするのは設計ステップに限る。impl、refactor、またはmigrationのタグが付いたステップは、、-reviewer code-reviewer、security-reviewer、またはdatabase-reviewerのいずれかのレビュアークラスのエージェントで終了する。 最もドメイン特化度の高いレビュアーが末尾の位置を占める(例:ルール2の「impl+security」はsecurity-reviewerで終了する;ルール3の「impl+db」はで終了する。これは、-reviewer データベースレビュアーがチェーンの前の段階で既に移行をゲートしているためである)。テストおよびビルドのステップは、それぞれ独自のバリデータ(e2e-runnerおよびビルド・リゾルバー)によってゲート制御されており、追加のレビュー担当者は必要ありません。
フェーズ3 — タスク記述の圧縮
出力される各 は、以下の条件を満たす必要があります:
- 自己完結していること(最初のエージェントがプラン文書を開いていなくてもよい)。
[Plan:で始まること。#step- ] - 1~3つの検証可能な受け入れ基準を含めること。
- 計画書がこのステップに対してスコープガード(
範囲外:...)を宣言している場合にのみ、それを含めること。その内容をそのまま継承すること。計画書に範囲外の記述がない場合は、その条項を完全に省略すること — 勝手に作成してはならない。 - 200~600 文字とし、1 行に収め、埋め込みの
" は\"でエスケープし、リテラルな改行は含めないこと。
フェーズ 4 — 出力
ECC_MODEによって決定された形式を使用してMarkdownを出力する。 出力は一貫して1つの形式を使用する — すべての{ORCH_CMD}およびエージェント名は、フェーズ0で指定された対応するプレフィックス付きでレンダリングされる。両方の形式を出力してはならない。また、レンダリングされた出力に「これはプラグイン形式です」や「プレフィックスを削除する」といった指示を含めてはならない。
具体的なレンダリング規則:
{ORCH_CMD}=プラグイン環境では/everything-claude-code:orchestrate、レガシー環境では/orchestrate。{AGENT(name)}=plugin環境ではeverything-claude-code:、レガシー環境では。- 概要表の「Chain」列では、同じ
{AGENT(name)}レンダリングを使用します。 - ステップごとのbashブロックには、実行可能なコマンドのみが含まれます。
# plugin形式や# legacy形式のコメントは含まれません。形式は暗黙的であり、出力全体を通じて統一されています。
出力の構造:
#Plan-Orchestrate の結果
**計画**: ``
**言語**: ``
**ECC モード**: ``
**ステップ**:
**スコープ**:
## ステップの概要
| # | タイトル | タグ | チェーン |
|---|---|---|---|
| 1 | ... | impl, db | `{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}` |
| ... | | | |
---
## ステップ 1 —
**意図**:<1–3 sentences>
**タグ**:
**チェーンの根拠**:
```bash
{ORCH_CMD} custom "{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}" "[Plan: docs/foo.md#step-1]; Acceptance:<1–3 items>; Out of scope:<…>"
```
上記の
{ORCH_CMD}および{AGENT(...)}という表記は、このスキルが実行時に実行する置換を表しています。実際に生成される Markdown には、展開された文字列が含まれ、プレースホルダーが含まれることはありません。
ユーザーがすべてのコマンドを一度に貼り付けられるよう、各ステップのコマンドを順番に集約した最終的な「バッチ実行」ブロックを追加します。概要表示のみのモードでは、このバッチブロックを省略します(「大規模なプラン」のエッジケースを参照):概要テーブルのみが出力される場合、集約すべきステップごとのコマンドは存在しないためです。
フェーズ 5 — 自己チェック(出力前に実行)
- 各チェーン内のすべてのエージェントはカタログから取得されます(プラン内に現れた「
everything-claude-code:」というプレフィックスはすべて削除済み。フェーズ0のステップ5を参照)。 - 解決済みの
{ORCH_CMD}およびすべての解決済みの{AGENT(...)}は、同じ形式(プラグインまたはレガシー)を使用します。1つの出力内で混在することは決してありません。 - レンダリングされた出力には、
# plugin form/# legacy formといった注釈や、「プレフィックスを削除する」という指示は一切残っていません。 -
--mode/--gate/--agents=...といったフィールドは生成されません。 - 各タスクの説明は 1 行で、二重引用符で囲まれ、埋め込まれた
"はエスケープされます。 - 各タスクの説明は
[Plan:で始まり、受け入れ条件(1~3 項目)が含まれています。「#step- ] Out of scope:」句は、計画から継承された場合にのみ存在します。 - フェーズ 2 の重複排除後、どのチェーンにも重複するエージェントが存在しないこと。
- チェーンの長さは 4 以下です。
-
impl/refactor/migrationのタグが付けられたステップは、レビューアクラスのエージェント(、-reviewer code-reviewer、security-reviewer、またはdatabase-reviewer)で終わります。testおよびbuild は例外です — フェーズ 2 のルール 10 を参照してください。 - タグのないステップは、「
一致するタグがない」という理由とともにcode-reviewerを発行します。デフォルトはレビューのみのチェーンです。 - 概要テーブルには、
--scopeの設定にかかわらず、プラン内のすべてのステップが一覧表示されます。 - ステップごとの詳細ブロックの数は、解決された
--scopeと一致します(--scope=allの場合は計画全体、step:nの場合は 1 ブロック、range:a-bの場合は範囲サイズ)。概要のみのモードでは、ステップごとのブロックも Batch ブロックも出力されません。
エッジケース
- 明確なステップがない場合:H2/H3 の分割を優先します。それでも曖昧な場合は、「構造化されたステップが検出されませんでした」と報告し、ドキュメントのアウトラインを表示して、アウトラインに基づいて実行することをユーザーに確認します。
- 大規模なプラン(1500行以上):概要表示のみモードに入り、概要テーブルのみを出力し、詳細を確認するために再実行する前に、
--scopeを使用して範囲を絞り込むようユーザーに促します。このモードでは、ステップごとの詳細ブロックとバッチ実行ブロックはスキップされます。 - ステップの範囲が広すぎる場合(例:「すべてのバックエンド作業を完了する」):単一のチェーンを強制しない。N.a と N.b への分割を提案し、分割案を示す。
- プランがエージェントを宣言している場合(稀):まず
「everything-claude-code:」というプレフィックスをすべて削除して、カタログ名のみを取得します(フェーズ 0 ステップ 5)。次に、カタログに対して妥当性を検証します。無効なエージェントは置き換え、「チェーンの根拠」の項でその理由を説明します。カタログ名のみは、出力時にECC_MODEに応じてプレフィックスが再付与されます。 -
--lang=auto では優先言語を決定できない多言語プロジェクトの場合:lang=unknown を設定する。reviewer はcode-reviewerに、build resolver はbuild-error-resolverに解決する。「チェーンの根拠」の項でフォールバックについて言及する。
例
例 1 — プラグインモード、Python プラン
入力:
plan-orchestrate @docs/plan/example-feature.md --lang=python
期待される出力の抜粋:
## ステップ 2 — 機密性の高い UserProfile フィールドの暗号化
**意図**: `EncryptedString` という SQLAlchemy 型を導入し、永続化前に `birth_datetime` / `location` を AES-GCM で暗号化します。鍵は環境変数から読み込みます。
**タグ**: impl, security, db
**チェーンの根拠**: セキュリティ上重要な書き込みパスであるため、`security-reviewer` がチェーンを締めくくる。`database-reviewer` が Alembic マイグレーションを検証し、`python-reviewer` が型付けと 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" "[計画: docs/plan/example-feature.md#step-2] EncryptedString SQLAlchemy 型を実装し、UserProfile.birth_datetime/location カラムをマイグレーションする。キーは ENV の APP_DB_KEY から取得する。 受け入れ条件:暗号化/復号の往復テストに合格すること;空のデータベースにおいてAlembicのアップグレード/ダウングレードが正常に完了すること;移行後にデータベースに平文が残らないこと;対象外:テナント間のプロファイル共有ロジック"
```
例 2 — レガシーモード、同じステップ
ECC_MODE=legacy が検出された場合、同じ手順が単一の統一されたコマンドとして出力されます(出力内のどこにもプラグイン接頭辞付きの形式は含まれません):
/orchestrate custom "tdd-guide,database-reviewer,python-reviewer,security-reviewer" "[Plan: docs/plan/example-feature.md#step-2] ..."
上記の 2 つの例は、2 つの異なる環境における2 つの可能な出力を示しています。1 回のスキル呼び出しでは、エンドツーエンドでこれらの中から 1 つだけが生成されます。
注
- 生成専用です。このスキル内部から
/orchestrateを呼び出してはなりません。 - タスクの説明文は、計画文書の言語に合わせてください(エージェント名は常に英語のままです)。
- ユーザーから明示的に求められない限り、出力に「Co-Authored-By」行や絵文字を挿入しないでください。
---
name: plan-orchestrate
description: Reads a plan document, decomposes it into steps, designs a per-step agent chain from the ECC catalogue, and emits ready-to-paste /orchestrate custom prompts without executing them.
---
# 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
```
<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>` — 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 "<agent1>,<agent2>,...,<agentN>" "<task description>"
```
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 `<claude-home>` 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+) | `<claude-home>/plugins/marketplaces/everything-claude-code/` exists | `/everything-claude-code:orchestrate` | `everything-claude-code:<name>` |
| Legacy bare install | Above absent; agent files under `<claude-home>/agents/` | `/orchestrate` | `<name>` |
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 `<plan-doc-path>`. 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 `<claude-home>/plugins/marketplaces/everything-claude-code/` exists → `ECC_MODE=plugin`.
2. Else if `<claude-home>/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,<lang>-reviewer` |
| `test` | test, coverage, e2e, integration | `tdd-guide,e2e-runner` |
| `refactor` | refactor, cleanup, dedupe, split | `architect,refactor-cleaner,<lang>-reviewer` |
| `migration` | migrate, upgrade, rewrite, port | `architect,tdd-guide,<lang>-reviewer` |
| `db` | schema, migration, index, SQL, Postgres, alembic, sqlmodel | `database-reviewer,<lang>-reviewer` |
| `security` | encrypt, auth, secret, OWASP, PII | `security-reviewer,<lang>-reviewer` |
| `build` | build, compile, lint failure, CI | `<lang>-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 | `<lang>-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,<lang>-reviewer,security-reviewer`.
3. `impl` + `db` → `tdd-guide,database-reviewer,<lang>-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. `<lang>-reviewer` resolves to `code-reviewer` when `lang=unknown`.
6. `<lang>-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 `<lang>`. 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 `<lang>-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 `<lang>-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 `<task description>` must:
- Be self-contained (the first agent does not need the plan document open).
- Start with `[Plan: <path>#step-<id>]`.
- 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:<name>` under `plugin`, `<name>` 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**: `<path>`
**Lang**: `<detected-or-given>`
**ECC mode**: `<plugin | legacy>`
**Steps**: <N>
**Scope**: <all | step:n | range:a-b>
## Steps overview
| # | Title | Tags | Chain |
|---|---|---|---|
| 1 | ... | impl, db | `{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}` |
| ... | | | |
---
## Step 1 — <title>
**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.
すべてのファイル
1件のファイルplan-orchestrateをインストール
スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。
ZIPをダウンロードリポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。
git clone https://github.com/affaan-m/ECC/tree/main/skills/plan-orchestrate # Copy SKILL.md to your .claude/skills/ directory
コピー





家
