delegate-with-context
Hand off a sub-task to a sub-agent with a tight, complete brief in the `prompt` — not the full conversation history. Apply the 4-part message envelope (Task…
от MiniMax-AI★ 30 звёзд на GitHub
Установить delegate-with-context в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Delegate with Context
When handing off work to a sub-agent, the agent has two extremes:
- Forward everything: the sub-agent sees the full parent history. Costs tokens, dilutes focus, may leak irrelevant detail.
- Forward nothing: the sub-agent gets a one-line "go do X". The brief is almost always incomplete, and the sub-agent re-derives incorrectly.
This Skill is about the middle ground: a tight, complete, structured brief that gives the sub-agent everything it needs and nothing it does not.
mcode 0.2.4 surface
The task tool on mcode 0.2.4:
task(
description: string, // 3-5 word label, required
prompt: string, // the brief, required
agent_name: "explore" | "worker" | "verifier", // required
run_in_background?: boolean // optional
)
The 4-part envelope is the design; on mcode it goes into the prompt
string verbatim. agent_name is the canonical spelling. agent_name= is
accepted as a runtime alias but the Skills prefer the canonical form.
mavis is the root agent (the calling session itself), not a sub-agent. It
has no agent.md manifest and cannot be used as agent_name.
When to use
Activate when any of these is true:
- You are about to call
taskto hand off a sub-task. - The full conversation history is too large to forward (cost / focus).
- A previous sub-agent failed because the brief was incomplete.
- You want the sub-agent's work to be auditable against a written contract.
When NOT to use
- The sub-task is so trivial a single
readwill do (no sub-agent needed). - You are about to do the work yourself.
- The user explicitly wants you (not a sub-agent) to do it.
Process
- Classify the sub-task (see
fork-context-decision):- Self-contained:
none(just the brief inprompt). - Needs prior context:
Norall→ inline the prior turns intopromptbefore the brief.
- Self-contained:
- Pick the sub-agent type from
{explore, worker, verifier}based on what the sub-task needs (read / write+run / run-only). - Write the 4-part envelope below. The envelope is the portable part of
the brief — host
tasktools all accept a brief string. - Choose context level (see
fork-context-decision) and inline the chosen context intopromptbefore the envelope (or skip ifnone). - Document the return path — how the sub-agent should hand the result back.
The 4-part envelope
Every sub-agent brief (the body of the prompt field) MUST have these 4 parts,
in order:
Task name: <one short line, e.g. "investigate-lint-flake">
Sender: <who is asking, e.g. "main agent (you)">
Task: <one sentence: what the sub-agent must do>
Payload: <the actual context, links, file paths, prior results>
Return: <where the result goes, in what format>
Each part is mandatory. Skipping any one is the difference between a working sub-task and a confused one.
Field-by-field
| Field | Purpose | Bad | Good |
|---|---|---|---|
| Task name | The handle you'll refer to later. | task1 |
investigate-lint-flake |
| Sender | Who is asking, so the sub-agent knows the audience. | (omitted) | main agent |
| Task | One-sentence scope. | fix the tests |
Investigate why test_lint.py flakes on Windows but not Linux. Produce a 1-paragraph root-cause analysis. |
| Payload | The actual content the sub-agent needs. | see above |
Links to the file, the prior turn's tool output, the user's exact request. |
| Return | Where the result goes, in what format. | (omitted) | Append a section to /notes/lint.md titled "## Windows flake root cause" with 1 paragraph. |
Common pitfalls
- Omitting the return path — the sub-agent finishes and has no idea what to do with the result. Always specify.
- Putting the brief in
Taskand the question inPayload— the sub-agent sees both, but the wrong field is the "one-sentence scope". KeepTaskshort. - Forwarding the full history when
nonewould do — costs tokens and dilutes focus. Decide first. - Using
agent_name="mavis"— mavis is the root agent, not a sub-agent. Useexplore/worker/verifier. - Writing the envelope in a separate
brief=field — mcode 0.2.4 does not expose abrieffield. Put it inprompt.
Example
The example below is MiniMax Code 0.2.4 task tool syntax. The envelope
is the prompt body; the call shape is the only one that exists on mcode 0.2.4.
> task(
description="Investigate lint flake",
agent_name="worker", // or "explore" if read-only
prompt="""
Task name: investigate-lint-flake
Sender: main agent
Task: Investigate why <project>/tests/test_lint.py flakes on
Windows but not Linux. Produce a 1-paragraph root-cause
analysis.
Payload: <project>/tests/test_lint.py (line 47 is the failure);
prior turn tool output (inlined above this prompt if
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл delegate-with-context?
Hand off a sub-task to a sub-agent with a tight, complete brief in the `prompt` — not the full conversation history. Apply the 4-part message envelope (Task name / Sender / Task / Payload + return path). USE WHEN: about to call `task()` to hand off a sub-task, the full conversation history is too large to forward, a minimal-context brief would do, the previous sub-agent failed because the brief was incomplete. TRIGGER PHRASES: "delegate", "hand off", "sub-agent", "delegate this", "delegate to", "派给", "委派", "让 sub-agent 干", "把 ... 交给 ...". SKIP WHEN: the sub-task is so trivial a `read` will do, you are about to do the work yourself, the user explicitly wants you (not a sub-agent) to do it.
Как установить скилл delegate-with-context?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл delegate-with-context запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…