subagent-orchestration
できること
このスキルは、コードベースを検索したり計画を立てたりする補助エージェントに、AIがいつどのように作業を渡すかを説明します。補助エージェントをサポートするエージェントを使う人向けです。
使う場面
- ✓多数のファイルを広く検索する必要があり、メインの会話がいっぱいになってしまうとき。
- ✓互いに独立した複数の調査を、同時に進められるとき。
- ✓変更を加える前に、計画を別に下書きしてほしいとき。
スキルのリンク
https://github.com/PostHog/posthog/blob/master/packages/agent/packages/harness/src/extensions/orchestration/skills/subagent-orchestration/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“プロジェクト全体を見て、ログインがどこで処理されているかを探し、要約してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
メインのAIは、補助エージェントに明確で自己完結した作業を与えます。補助エージェントは独自の別のコンテキストで作業し、短い要約を返します。そのためメインの会話には、重要な内容だけが残ります。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Subagent Orchestration
You (the parent session) can delegate scoped work to focused subagents, each running in its own isolated Pi session with its own context window. Use this to keep your own context clean and to parallelize independent work.
When to delegate
Delegate when a piece of work is:
- Self-contained: it doesn't need your full conversation history, just a task and some context you can state explicitly.
- Isolable: it would otherwise burn a lot of your context window (e.g. broad codebase search, reading many files) for a result you can summarize down to a few paragraphs.
- Parallelizable: several independent instances of it can run at once (e.g. exploring two unrelated areas of a large codebase in the same turn).
Do not delegate trivial one-line changes, or work that fundamentally needs your full
conversation context to do correctly — that's what context (below) is for, but if
almost everything is relevant, delegation adds overhead for no benefit.
Bundled agents
| Agent | Use for | Tools | Model | Notes |
|---|---|---|---|---|
Explore |
Focused, read-only recon: find files, entry points, data flow | read, bash, grep, find, ls | Sol, falls back to your current model | Reports compressed findings, never edits |
Plan |
Turn Explore's findings (or your own) into a concrete implementation plan | read, bash, grep, find, ls | Inherits your current model | Never edits |
General |
Actual implementation: make the code changes an Explore/Plan investigation identified, or any task that needs real edits | read, bash, edit, write, grep, find, ls | Inherits your current model | Same read-write capability as you have; makes real changes |
Explore and Plan are read-only. General has the same read-write capability you do —
reach for it when a change is mechanical/independent enough to delegate (especially
several at once via parallel mode) rather than doing every edit yourself in sequence.
For a small, one-off change, just make it directly instead of delegating.
Subagents cannot themselves call subagent — they are leaves, not orchestrators. Keep
all delegation decisions in your own (parent) session.
For larger fan-out orchestration — many agents, loops over file lists, staged
map/verify/synthesize flows — prefer the workflow tool (if available), which runs a
JavaScript script coordinating these same read-only agents and returns one synthesized
result. subagent is for one-off or small parallel delegations.
A project can add its own agents (including ones that write) as .pi/agents/<name>.md
files — same frontmatter convention as the bundled agents above. See agentScope below.
The context field — always fill it in
A subagent gets only its task string, plus a small automatic digest of your last
few conversation turns (as a fallback, not a substitute). It does not see the files
you've already read, tool results you've already seen, or decisions you've already made
unless you put them in context.
Always pass context with whatever the subagent actually needs:
- File paths and line numbers you already found.
- Decisions already made ("use approach B, not A, because...").
- Constraints ("don't touch files under vendor/").
A subagent given a bare one-line task and no context will waste its own turns
re-discovering things you already know.
Modes
- single — one agent, one task. Default choice.
- parallel —
tasks: [...], up to 4 concurrent tasks. Use for independent work that can run at once, e.g.Exploreing two unrelated parts of a codebase together.
For every subagent, supply a brief description with 2 to 5 words. It states the purpose
shown in the tool call. Keep the full instructions in task.
single: { agent: "Explore", task: "Find where authentication starts.", description: "Finding auth entrypoint" }
parallel: { tasks: [
{ agent: "Explore", task: "Find authentication entrypoints.", description: "Finding auth entrypoints" },
{ agent: "Explore", task: "Find session persistence code.", description: "Finding session storage" }
] }
For parallel work, put every agent in tasks. Do not use top-level agent or task.
There is no chain mode. For a fixed pipeline (e.g. explore then plan), just call
subagent twice in sequence yourself and pass the first call's output back in as the
second call's context — you are already the orchestrator holding both results.
Recommended patter
よくある質問
作業を渡すべきでないのはどんなときですか?
小さな変更や、会話全体に依存する作業は、引き継ぎの手間に見合わないため渡しません。
補助エージェントはファイルを変更できますか?
読み取り専用の補助エージェントは検索や計画だけを行います。変更を加える補助エージェントの結果は、受け入れる前にレビューが必要です。
補助エージェントは以前の会話を覚えていますか?
自動では覚えていません。補助エージェントは新しい別のセッションで始まるため、必要な文脈をAIが明示する必要があります。
詳細
作者による元の説明
How and when to delegate work to subagents via the `subagent` tool (Explore, Plan, General). Use when a task involves codebase recon, implementation planning, or actual code changes that would benefit from an isolated context window instead of doing it all inline.
repo: PostHog/posthog
人気
- GitHubのスター
- 41k
- ランキング
- #6823
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
depot-ci
41kエージェントが、GitHub Actionsの代替であるDepot CIのワークフローを設定し実行できるよう支援します。既存のワークフローの移行や、実行ログの確認も含みます。
depot-container-builds
41kエージェントが、Depotのリモート・ビルダーでDockerイメージを作れるよう支援します。マルチプラットフォームのイメージ、レジストリへのプッシュ、ビルド失敗の修正を含みます。
depot-github-runners
41kエージェントが、GitHub Actionsのジョブを Depot が管理するランナーに移し、ランナーのサイズとラベルを選び、ランナー設定の問題を解決できるよう支援します。
editing-agents-md
41kエージェントが、AGENTS.mdとCLAUDE.mdのどちらにルールを書くべきかを判断し、ファイルを膨らませずに守られやすい形で書けるよう支援します。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。