agent-delegation
Skill này làm gì
Đây là tài liệu tham khảo về cách viết prompt tốt khi một agent AI giao việc cho agent khác. Dành cho người xây dựng hoặc vận hành các thiết lập nhiều agent và muốn công việc được giao có ích.
Khi nào nên dùng
- ✓Khi bạn sắp nhờ một subagent nghiên cứu hoặc viết code cho bạn.
- ✓Khi một việc được giao trả về nông cạn hoặc chung chung và bạn muốn prompt tốt hơn.
- ✓Khi bạn cần quyết định subagent cần những chi tiết nào để làm việc độc lập.
Liên kết skill
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/agent-delegation/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Trước khi giao nghiên cứu này cho một agent trợ giúp, hãy giúp tôi viết một bản hướng dẫn rõ ràng để giải thích tôi cần nhận lại điều gì.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill giải thích một bản hướng dẫn tốt gồm những gì, như mục tiêu, những gì đã được loại trừ và đầu ra mong đợi. Nó cũng cảnh báo về các prompt mơ hồ, vì chúng đẩy việc suy nghĩ trở lại cho agent trợ giúp.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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>Câu hỏi thường gặp
Một prompt giao việc luôn nên có gì?
Mục tiêu và lý do nó quan trọng, những gì đã biết, ranh giới của công việc và đầu ra bạn mong đợi.
Tôi có nên giao toàn bộ vấn đề không?
Không. Skill cảnh báo không nên giao phần hiểu biết, chẳng hạn bảo một agent trợ giúp sửa lỗi dựa trên những phát hiện mà nó chưa được cung cấp.
Nó có quyết định khi nào nên giao việc không?
Không. Nó bao quát cách viết prompt, còn các quy tắc khởi chạy subagent được mô tả ở nơi khác.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9774
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
codegraph
29kGiúp agent của bạn phân tích một codebase đã lập chỉ mục qua đồ thị gọi, phụ thuộc, mã chết, điểm nóng và tìm kiếm theo ngữ nghĩa.
qwen-code-claw
29kGiúp agent của bạn giao các tác vụ lập trình cho Qwen Code, như tìm hiểu codebase, sửa lỗi, tái cấu trúc mã hoặc tạo một dự án mới.
structured-debugging
29kDạy agent của bạn cách gỡ lỗi khó theo từng bước: đặt giả thuyết, thêm kiểm tra có mục tiêu, kiểm thử và tìm nguyên nhân thật trước khi sửa.
tmux-real-user-testing
29kGiúp agent của bạn kiểm thử một ứng dụng terminal như người dùng thật trong tmux, lưu nhật ký từng bước dễ đọc kèm ảnh chụp màn hình của mỗi hành động.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.