Skip to content
Skillpedia
Agents29k · #9774

agent-delegation

What it does

It is a reference for writing good prompts when one AI agent hands work to another. It is for people who build or run multi-agent setups and want the delegated work to be useful.

When to use it

  • ✓When you are about to ask a subagent to research or write code for you.
  • ✓When a delegated task came back shallow or generic and you want a better prompt.
  • ✓When you need to decide what details a subagent needs to work on its own.

Skill link

https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/agent-delegation/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/agent-delegation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Before you hand this research to a helper agent, help me write a clear brief that explains what I need back.”

5 new skills a week. 1 minute to read.

How it works

The skill explains what a good brief contains, such as the goal, what has already been ruled out, and the expected output. It also warns against vague prompts that push the thinking back onto the helper.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Delegation prompt reference

Everything below is about writing the prompt. Whether to delegate at all, how a background agent reports back, and the rules for running agents concurrently stay in the Agent tool's description — this reference does not repeat them.

Writing the prompt

Brief the agent like a smart colleague: make the delegated task, boundaries, and expected output explicit. Regular subagents have not seen this conversation; forks inherit all or the selected recent window.

  • Explain what you're trying to accomplish and why.
  • Describe what you've already learned or ruled out.
  • Give enough context about the surrounding problem that the agent can make judgment calls rather than just following a narrow instruction.
  • If you need a short response, say so explicitly.
  • For lookups, provide the exact target. For investigations, provide the actual question rather than an over-prescribed sequence of steps.
  • Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need.
  • Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent.

Terse command-style prompts produce shallow, generic work.

Never delegate understanding. Do not write prompts like "based on your findings, fix the bug" or "based on the research, implement it." Those phrases push synthesis onto the agent instead of doing it yourself. Write prompts that prove you understood the task: include relevant file paths, constraints, what specifically needs to be learned or changed, and what is out of scope.

A custom subagent's own definition outranks your prompt. When subagent_type names a subagent someone defined, that definition already fixes its scope, its tools and its output contract; your prompt adds task context, not a new contract. Asking one confined to a single file to search the repository does not widen it — the dispatch simply cannot succeed. If the contract is too narrow for what you need, the definition is what has to change, not the prompt.

Writing a fork prompt

With the default full history, the prompt is a directive — what to do, not what the situation is. When fork_turns limits history, include any older context the fork still needs. Be specific about scope: what's in, what's out, what another agent is handling.

Worked example

<example_agent_descriptions> "test-runner": use this agent after you are done writing code to run tests </example_agent_descriptions> <example> user: "Please write a function that checks if a number is prime" assistant: I'm going to use the Write tool to write the following code: <code> function isPrime(n) { if (n <= 1) return false for (let i = 2; i * i <= n; i++) { if (n % i === 0) return false } return true } </code> <commentary> Since a significant piece of code was written and the task was completed, now use the test-runner agent to run the tests </commentary> assistant: Uses the agent tool to launch the test-runner agent </example>
FAQ

What should a delegation prompt always include?

The goal and why it matters, what is already known, the boundaries of the task, and the output you expect.

Should I hand off the whole problem?

No. The skill warns against delegating understanding, such as telling a helper to fix the bug based on findings it has not been given.

Does it decide when to delegate?

No. It covers how to write the prompt, while the launch rules for subagents are described elsewhere.

Details

Original description by the author

Reference for briefing a subagent or a fork — what to put in the prompt, what not to delegate, and a worked example. Load before writing a delegation prompt; the Agent tool's own description carries the launch rules and the background-agent rules.

repo: QwenLM/qwen-code

Popularity

GitHub stars
29k
Ranking position
#9774
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills