Aller au contenu
Skillpedia
Agents41k · #6823

subagent-orchestration

Ce qu’il fait

Cette skill explique quand et comment l'IA doit confier du travail à des agents auxiliaires, comme ceux qui recherchent dans une base de code ou rédigent un plan. Elle s'adresse aux personnes qui utilisent un agent prenant en charge ces auxiliaires.

Quand l’utiliser

  • ✓Quand une tâche exige une recherche large dans de nombreux fichiers qui saturerait la conversation principale.
  • ✓Quand plusieurs recherches indépendantes peuvent être menées en même temps.
  • ✓Quand vous voulez qu'un plan soit rédigé séparément avant toute modification.

Lien du skill

https://github.com/PostHog/posthog/blob/master/packages/agent/packages/harness/src/extensions/orchestration/skills/subagent-orchestration/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/PostHog/posthog/blob/master/packages/agent/packages/harness/src/extensions/orchestration/skills/subagent-orchestration/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Parcours tout le projet pour trouver où la connexion est gérée, et résume-le-moi.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'assistant principal confie à un auxiliaire une tâche claire et autonome. L'auxiliaire travaille dans son propre contexte séparé et renvoie un résumé court, si bien que la conversation principale ne garde que l'essentiel.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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

Questions fréquentes

Quand l'IA ne doit-elle pas déléguer ?

Pour les petites modifications ou les travaux qui dépendent de toute la conversation, car la délégation ajoute des coûts pour peu de gain.

Les auxiliaires peuvent-ils modifier mes fichiers ?

Les auxiliaires en lecture seule ne font que chercher ou planifier. Ceux qui font des modifications nécessitent toujours votre revue avant d'accepter le résultat.

Les auxiliaires se souviennent-ils de notre conversation précédente ?

Pas automatiquement. L'IA doit énoncer le contexte dont un auxiliaire a besoin, car chacun démarre dans une session neuve et séparée.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
41k
Position au classement
#6823
Licence
—
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires