agent-delegation
它能做什么
它是一份参考资料,说明当一个 AI 智能体把工作交给另一个智能体时,如何编写好的提示词。适合构建或运行多智能体系统、并希望委派工作有实际价值的人。
适用场景
- ✓当你即将让子智能体为你做调研或编写代码时。
- ✓当委派的任务返回的结果很浅或很笼统,你想要更好的提示词时。
- ✓当你需要决定子智能体独立工作所需的细节时。
技能链接
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/agent-delegation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在你把这项调研交给辅助智能体之前,请帮我写一份清晰的简报,说明我需要它返回什么。”
每周 5 个新技能,1 分钟读完。
工作原理
技能解释一份好的简报应包含什么,例如目标、已经排除的内容以及预期的输出。它也提醒避免模糊的提示词,因为那样会把思考的负担推回给辅助智能体。
技术内容(原始 SKILL.md)
作者在 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>常见问题
委派提示词应始终包含什么?
目标及其重要性、已知的情况、任务的边界,以及你期望的输出。
我应该把整个问题都交出去吗?
不应该。技能提醒避免委派理解本身,例如让辅助智能体根据它没有拿到的发现去修复错误。
它决定何时委派吗?
不决定。它讲的是如何编写提示词,而子智能体的启动规则在别处说明。
详情
作者的原始描述
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
热度
- GitHub 星标
- 29k
- 排名
- #9774
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
codegraph
29k帮你的智能体通过调用图、依赖关系、无用代码、热点和语义搜索来分析已建立索引的代码库。
qwen-code-claw
29k帮你的智能体把编程任务交给 Qwen Code,例如理解代码库、修复缺陷、重构代码或生成新项目。
structured-debugging
29k教你的智能体用一步一步的方法调试疑难缺陷:先提出假设,再添加有针对性的检查,验证后找出真正的原因,然后才修复。
tmux-real-user-testing
29k帮你的智能体在 tmux 中像真实用户一样测试终端应用,并为每一步操作保存带屏幕截图的可读步骤日志。