Agent skill

Agent Delegation Prompts

by QwenLM in QwenLM/qwen-code

Reference for writing briefs to a subagent or a fork: what context to include, what never to delegate, and how a custom subagent's definition limits the prompt.

Apache-2.0Auto-check passedAgent Workflows

Install Agent Delegation Prompts

skills CLI
$ npx skills add QwenLM/qwen-code --skill agent-delegation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install QwenLM/qwen-code agent-delegation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/QwenLM/qwen-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/core/src/skills/bundled/agent-delegation .claude/skills/agent-delegation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agent-delegation
GitHub stars
28k
Token cost
~847 tokens
SKILL.md length
481 words
Files
2
Skills in repo
41
Repo updated
First seen
Licence
Apache-2.0

At a glance

Reference for writing briefs to a subagent or a fork: what context to include, what never to delegate, and how a custom subagent's definition limits the prompt.

  • Writing a prompt for a subagent that has not seen the conversation
  • SKILL.md covers Writing the prompt, Writing a fork prompt and Worked example
  • Runs TypeScript scripts from its folder
  • Briefing a fork with limited history

What it does

The skill covers prompt writing only. Whether to delegate, how background agents report back and the rules for concurrent agents stay in the Agent tool's own description. The advice is to brief the agent like a capable colleague: explain the goal and why, say what is already known or ruled out, give enough surrounding context for judgment calls, state when a short answer is wanted, give exact targets for lookups and real questions for investigations, and say whether code should be written or only research done. Terse command-style prompts produce shallow work.

Two rules stand out. Never delegate understanding, so a prompt like fix the bug based on your findings gets replaced with file paths, constraints and scope. And a custom subagent's own definition outranks the prompt, so a prompt cannot widen its scope or tools. Fork prompts act as directives when full history is inherited and need older context added when history is limited. A worked example appears further into the skill.

When your agent uses it

  • Writing a prompt for a subagent that has not seen the conversation
  • Briefing a fork with limited history
  • Deciding what context and boundaries a delegated task needs
  • Fixing delegation prompts that produce shallow results

Example prompts

  • “Write a delegation prompt for a subagent that should find every caller of the legacy auth helper, research only.”
  • “Rewrite the prompt that says to fix the bug based on the findings into one that proves I understood the task.”
  • “Draft a fork prompt that covers the parser module and leaves the lexer to another agent.”
  • “My subagent ignored the repository search I asked for, so check its definition against my prompt.”

Requirements

  • An agent runtime with subagent or fork support

What it can do on your machine

Read from SKILL.md and the folder at commit d9c6f8c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agent Delegation Prompts loads about 847 tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 481 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~847

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from QwenLM/qwen-code at commit d9c6f8c, republished under its Apache-2.0 licence (© QwenLM). 481 words, ~847 tokens.

Download SKILL.mdSave it as .claude/skills/agent-delegation/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
agent-delegation
description
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.

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.

Show full SKILL.md (150 more words)Show less

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>

© QwenLM, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in packages/core/src/skills/bundled/agent-delegation of QwenLM/qwen-code.

  • SKILL.md
  • SKILL.test.ts

Open the folder on GitHubat commit d9c6f8c

Compare with similar skills

Agent Delegation Prompts next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agent Delegation Prompts compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agent Delegation Prompts this skillQwenLM/qwen-code28k—~847Automated safety check: PassApache-2.0
Harness Agent Team Designerrevfactory/harness9.1k—~4.5kAutomated safety check: PassApache-2.0
Paseo Advisor Second Opiniongetpaseo/paseo20k1 repos~756Automated safety check: PassCustom licence
Task Observerrebelytics/one-skill-to-rule-them-all3.2k1 repos~11kAutomated safety check: PassCC-BY-4.0
O2 Review Loopopenobserve/openobserve22k—~3.7kAutomated safety check: PassAGPL-3.0
ClawTeam Multi-Agent Swarmwin4r/ClawTeam-OpenClaw1.5k1 repos~2.9kAutomated safety check: PassMIT

Similar skills

  • Harness Agent Team Designer

    revfactory/harness

    Designs a project-specific agent harness: defines specialist agents, writes the skills they follow, picks an execution mode and model for each, and keeps the setup maintained.

    9.1k GitHub stars~4.5k tokensUpdated 13 days ago
    Agent WorkflowsAuto-check passed
  • Launches one separate agent through Paseo to give a second opinion on the current task, with a self-contained briefing and no permission to edit files.

    20k GitHub starsUsed in 1 repo~756 tokens
    Agent WorkflowsAuto-check passed
  • Task Observer

    rebelytics/one-skill-to-rule-them-all

    Monitors task execution for skill improvement opportunities.

    3.2k GitHub starsUsed in 1 repo~11k tokens
    Agent WorkflowsAuto-check passed
  • O2 Review Loop

    openobserve/openobserve

    Splits a change into planner, coder and independent reviewer roles: you confirm a spec, a subagent implements it, and a separate reviewer checks each round's local WIP commit.

    22k GitHub stars~3.7k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • ClawTeam Multi-Agent Swarm

    win4r/ClawTeam-OpenClaw

    Launches a swarm of specialist Hermes agents in git-worktree-isolated tmux windows with a kanban board and file-based inboxes, using built-in templates like hedge-fund and code-review.

    1.5k GitHub starsUsed in 1 repo~2.9k tokens
    Agent WorkflowsAuto-check passed
  • Collects feedback on how an agent harness performed, generalizes it, and updates the harness agents, skills and orchestrator along with a change-history table.

    9.1k GitHub stars~855 tokensUpdated 13 days ago
    Agent WorkflowsAuto-check passed

More from QwenLM/qwen-code

All 41 skills in this repo
  • Reproduces a feature from Codex or Claude Code in Qwen Code by running the reference agent under capture, reading the traces, then implementing matching behavior.

    28k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Qwen Code E2E Testing

    QwenLM/qwen-code

    Guides end-to-end testing of the Qwen Code CLI in headless mode with real model calls, MCP test servers and inspection of raw API traffic.

    28k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Scheduled CI skill that scans a repository for small, certain docs, test and code hygiene issues and fixes them on one branch with a commit per finding.

    28k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Builds a rebranded Qwen Code desktop package from the Tauri shell using only a brand id and a logo, with sensible derived defaults.

    28k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Walks through capturing and comparing V8 heap snapshots to find memory leaks in the Qwen Code Node.js CLI, using tmux and the chrome-devtools CLI.

    28k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • tmux Real User Testing

    QwenLM/qwen-code

    Drives Qwen Code in a real tmux session the way a user would and saves a readable step-by-step transcript of each screen for maintainers to review.

    28k GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Agent Delegation Prompts

What does Agent Delegation Prompts do?

Reference for writing briefs to a subagent or a fork: what context to include, what never to delegate, and how a custom subagent's definition limits the prompt. The skill covers prompt writing only. Whether to delegate, how background agents report back and the rules for concurrent agents stay in the Agent tool's own description.

When should I use Agent Delegation Prompts?

Agent Delegation Prompts fits situations like: writing a prompt for a subagent that has not seen the conversation; briefing a fork with limited history; deciding what context and boundaries a delegated task needs; fixing delegation prompts that produce shallow results.

How do I install Agent Delegation Prompts in Claude Code?

Run `npx skills add QwenLM/qwen-code --skill agent-delegation -a claude-code`. Or copy the skill folder (packages/core/src/skills/bundled/agent-delegation in QwenLM/qwen-code) into .claude/skills/agent-delegation in your project. Claude Code loads it when a task matches its description.

How do I install Agent Delegation Prompts in Codex?

Run `npx skills add QwenLM/qwen-code --skill agent-delegation -a codex`. Or copy the skill folder (packages/core/src/skills/bundled/agent-delegation in QwenLM/qwen-code) into .agents/skills/agent-delegation in your project. Codex loads it when a task matches its description.

Can I use Agent Delegation Prompts in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add QwenLM/qwen-code --skill agent-delegation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agent-delegation, .gemini/skills/agent-delegation, .github/skills/agent-delegation and .opencode/skills/agent-delegation in your project.

What does Agent Delegation Prompts need to run?

Going by SKILL.md and its folder, Agent Delegation Prompts needs TypeScript for the scripts in its folder. Our summary lists: An agent runtime with subagent or fork support.

Does Agent Delegation Prompts access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Agent Delegation Prompts safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Agent Delegation Prompts use?

Agent Delegation Prompts is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agent Delegation Prompts use?

About 847 tokens (SKILL.md is roughly 3.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Agent Delegation Prompts?

Skills that share tags, products or a category with Agent Delegation Prompts: Harness Agent Team Designer (revfactory/harness, 9.1k stars), Paseo Advisor Second Opinion (getpaseo/paseo, 20k stars), Task Observer (rebelytics/one-skill-to-rule-them-all, 3.2k stars) and O2 Review Loop (openobserve/openobserve, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agent Delegation Prompts?

QwenLM (a GitHub organization) maintains it in QwenLM/qwen-code, which has 28,410 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on October 11, 2026.

Source: QwenLM/qwen-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.