SuperAPI AI Directory

agent-delegation

Agents & models

View repository

Updated 10-16 10:57

About this skill

Multi-Agent and Delegation Patterns

R — Original Text (Reading)

Core multi-agent collaboration patterns emerging from cross-vendor system prompts: Claude Code defines specialized sub-agents (Explore/Plan/code-reviewer), requiring context to be passed "like briefing a smart colleague who just walked in the door" and "never delegate understanding"; Gemini CLI's sub-agents (codebase_investigator/browser_agent, etc.) compress results into a single summary to return; Jules has a formal Plan→Review→Execute lifecycle including plan_step_complete and request_plan_review steps; ChatGPT Agent uses three-channel output (analysis/commentary/final result) to strictly isolate intermediate processes from user-visible output; Gemini Workspace implements cross-application agent coordination (Word→Excel→PowerPoint).

I — Methodological Skeleton (Interpretation)

  1. Sub-Agent Specialization — Define specialized sub-agents by capability dimension (exploration/planning/execution/review), with each sub-agent having clear responsibility boundaries and output formats
  2. Context Isolation and Transfer — Sub-agents run in isolated contexts, receiving tasks via "briefing-style" context summaries and returning results via compressed single summaries
  3. "Never Delegate Understanding" Principle — The main agent must fully understand the task before delegating, and must never delegate understanding itself
  4. Structured Lifecycle — Planning → Review → Execution → Verification, with each stage having clear completion signals (e.g., plan_step_complete) and review gates (e.g., request_plan_review)
  5. Output Channel Isolation — Intermediate analysis/commentary processes are strictly separated from final user-visible results; users only see the output of the final channel
  6. Cross-Agent Coordination Protocol — Define standard inter-agent communication formats (input briefing + output summary + status signals), supporting cross-application/cross-tool chained orchestration
  7. Result Verification Mechanism — The main agent performs quality checks on sub-agent output rather than directly trusting and forwarding it

A1 — Case Analysis (Past Application)

Case: Claude Code's Specialized Sub-Agents and Briefing-Style Transfer

  • Problem: A general-purpose agent handling all tasks is inefficient — exploring a codebase and reviewing code require different cognitive modes, and passing full context wastes tokens
  • Use of the Design Pattern: The Claude Code system prompt defines specialized sub-agents (Explore for code exploration, Plan for planning, code-reviewer for review). When passing context, it requires "like briefing a smart colleague who just walked in the door" — providing task background and specific goals rather than the full conversation history — while also emphasizing "never delegate understanding" — the main agent must understand the requirements before assigning
  • Conclusion: Specialized division of labor + briefing-style transfer reduced sub-agent token consumption by about 50% while maintaining task quality

Case: Jules's Plan→Review→Execute Lifecycle

  • Problem: AI Agents jumping directly from planning to execution lack quality gates, causing execution results to deviate significantly from planning intent
  • Use of the design pattern: The Jules system prompt defines a formal three-phase lifecycle: the planning phase produces a step list, marks steps complete via the plan_step_complete signal, requests a plan review via request_plan_review, and only enters the execution phase after the review passes
  • Conclusion: Mandatory review gating reduced the execution deviation rate by about 30%, but added about 20% of lead time on simple tasks

Case: ChatGPT Agent's three-channel output isolation

  • Problem: The Agent's intermediate reasoning process (analyzing assumptions, trying paths, error recovery) is exposed to users, causing information noise and confusion
  • Use of the design pattern: The ChatGPT Agent system prompt defines three strictly isolated output channels: the analysis channel (internal reasoning), the commentary channel (process record), and the final channel (user-visible result); only the output of the final channel is visible to users
  • Conclusion: Output isolation upgrades the user experience from "seeing the AI's thought process" to "seeing only the final answer," significantly reducing cognitive load

A2 — Trigger Scenarios (Future Trigger) ★

In what situations do users need this?

  1. Designing a multi-tool AI Agent platform, needing to define specialized sub-agents for different capability dimensions
  2. Building a code development assistant, needing to separate different cognitive tasks such as exploration/planning/execution/review
  3. Implementing cross-application collaboration (such as document→spreadsheet→presentation linkage), needing coordination protocols between agents
  4. Optimizing an existing Agent system—sub-agent result quality is unstable, or the main agent lacks a verification mechanism for sub-agent output
  5. Designing an end-user-facing AI product, needing to hide the intermediate reasoning process and show only the final result

Language signals

  • "Different types of tasks need different experts to handle them"
  • "The quality of sub-agent output is uncontrollable"
  • "Users should not see the intermediate thought process"
  • "A complete planning→review→execution process is needed"
  • "AI collaboration across applications needs standardization"

Distinction from adjacent skills

  • Difference from conversation-flow : conversation-flow manages dialogue routing and clarification strategies within a single agent, while this Skill manages task allocation and result aggregation across multiple agents
  • Difference from context-management : context-management manages information storage and compression within a single agent, while this Skill manages context isolation and transfer between agents
  • Difference from search-integration : search-integration manages external information retrieval strategies, while this Skill manages task delegation and result integration between agents

E — Executable Steps (Execution)

  1. Define the sub-agent capability matrix — Completion criteria: Establish a sub-agent list (at least 3), each sub-agent having a clear responsibility description, input format, output format, applicable scenarios and non-applicable scenarios, as well as quality assessment criteria

  2. Design the context briefing protocol — Completion criteria: Define the standard format for the main agent to pass context to sub-agents (task description + background summary + specific goals + constraints), as well as the standard format for sub-agents to return results (execution summary + key findings + confidence + items to be confirmed)

  3. Establish the lifecycle gating mechanism — Completion criteria: Define at least three phase gates (planning review/pre-execution confirmation/result verification), each gate with clear pass criteria, rejection conditions, and the handling process after rejection

  4. Implement output channel isolation — Completion criteria: Define at least two output channels (internal process channel/user-visible channel), clarify which content goes into which channel, and the log level and storage policy for internal channel content

  5. Add result verification rules — Completion criteria: Define the verification checklist used by the main agent for sub-agent output (at least 5 items: goal completion/format compliance/factual accuracy/consistency/boundary conditions), as well as the escalation strategy when verification fails (retry/switch agent/human intervention)

B — Boundary ★

Do not use in the following situations

  • Single-agent system — there is only one executor, so no delegation architecture is needed
  • Highly uniform task types — specialized sub-agents are not needed; a general-purpose agent is sufficient
  • Scenarios with extremely high real-time requirements — the multi-phase lifecycle adds latency
  • Very small team size (1-2 people) — an over-engineered agent architecture increases maintenance costs without bringing practical benefits

Common failure modes

  • Over-specialization: creating a dedicated sub-agent for every possible task, leading to an explosion in the number of agents and complicating routing decisions
  • Delegating understanding: also delegating "understanding user needs" to sub-agents, causing the main agent to lose overall control of the task
  • Excessive context passing: passing the full conversation history instead of a concise brief to sub-agents, wasting tokens and introducing noise
  • Skipping verification: the main agent directly trusts sub-agent output and forwards it to the user, causing errors to be amplified
  • Overly strict gates: every step requires review approval before continuing, doubling the total time for simple tasks