delegate
它能做什么
这个技能讲解何时把较大工作的一部分交给同时运行的子智能体。适合用 AI 进行多步骤编码、研究或检查任务的人。
适用场景
- ✓当一个大任务可以拆分为可同时运行的独立部分的时候。
- ✓当你希望由助手对一组有界的文件进行只读审阅的时候。
- ✓当机械性的编辑或测试运行可以在明确边界下交给他人处理的时候。
技能链接
https://github.com/codewhale-hq/Codewhale/blob/main/crates/skills/assets/skills/delegate/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这次迁移拆分成几部分,让助手负责扫描文件,而你负责设计?”
每周 5 个新技能,1 分钟读完。
工作原理
主智能体保留决策权和最终审核,为每个助手给出明确的结果和验收标准,并让独立的助手一起运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Delegate
Use sub-agents when they can do focused work in parallel while the parent keeps architectural judgment, integration, and final verification.
Keep vs Delegate
Keep in the parent:
- Understanding the user's actual request and constraints
- Architecture, security, product, and release-risk decisions
- Cross-module integration
- Final review, test interpretation, and user-facing summary
Delegate to sub-agents:
- Read-only exploration over a bounded file set
- Mechanical edits with a clear file ownership boundary
- Focused test or lint runs
- Boilerplate generation from an explicit spec
- Independent checks that can run while parent work continues
Do not delegate tiny one-step tasks, ambiguous product decisions, destructive operations without a clear acceptance criterion, or final verification.
Launch Focused Work
Use agent for a focused child run. Launch independent children together so they can run in parallel.
Give each child a concrete outcome and acceptance criteria. Let it continue until the work is complete or it needs input. Do not invent time, turn or token budgets, or tell it to stop early because a percentage of a budget has elapsed. The runtime carries any limits explicitly configured by the owner.
Prefer provider-neutral model_strength over hardcoded model ids. Children inherit the active model by default (model_strength: "same"), including type: "explore", so pass model_strength: "faster" explicitly to get the cheaper same-family sibling for read-only exploration:
{
"name": "config_audit",
"prompt": "Inspect crates/tui/src/config.rs and crates/tui/src/settings.rs for duplicate model-default logic. Return file/line findings only; do not edit files.",
"type": "explore",
"model_strength": "faster",
"cwd": "."
}
For code changes, give the child a precise write boundary and tell it not to revert unrelated edits. Keep implementation children capable with model_strength: "same":
{
"name": "docs_patch",
"prompt": "Update only docs/configuration.md to document the new [statusline] keys. Match the surrounding style. Do not edit other files.",
"type": "implement",
"model_strength": "same",
"cwd": "."
}
Use fork_context: true only when the child genuinely needs the current conversation prefix. Leave it omitted for fresh, narrower context.
Route the Work
Choose the route per child from agent(action:"roster") (no provider request), not from memory. It lists each role's resolved route and the models you may pick.
thinkingoverrides a saved tier on any role. Dial:off low medium high xhigh max ultra, plusinherit(role default, then session effort) andauto.modelandmodel_strengthapply to unpinned routes only. A pinned profile refuses a conflicting model; to choose a model, start an unpinned role such asgeneral.model_strength: "faster"is the same-family faster sibling,"same"the session model.- Read the receipt, not your request:
child_routeshows the provider, model and route source, andrequested_reasoningvseffective_reasoningshows what the route actually ran. - Route by stakes. Mechanical work: the cheapest sufficient route with
thinking: "off"or"low". Implementation: a capable route atmediumor above. Review and verification: a strong route athigh, on a different route than the author when independence matters.
Evaluate and Verify
Sub-agent outputs are self-reports. Re-check material claims before relying on them:
- Read changed files directly.
- Run the relevant tests locally.
- Inspect unexpected diffs before committing.
- Verify externally visible or destructive claims against source data.
Prompt Shape
A good delegation prompt includes:
- The exact task
- Files or modules owned by the child
- Files or behavior the child must not touch
- Expected output format
- Acceptance criteria
Weak prompt:
Fix the settings bug.
Strong prompt:
Own only crates/tui/src/settings.rs and its tests. Preserve existing config key names. Verify with the existing checks that provider-specific API key changes do not restart provider onboarding. Return the changed paths and test command output.
常见问题
哪些工作由主 AI 负责?
理解你的请求、架构和安全决策、跨模块整合以及最终审核,都由主智能体负责。
哪些工作不应委派?
非常简单的单步任务、含糊的产品决策、缺乏明确标准的破坏性操作,以及最终验证。
我能控制助手使用的模型吗?
可以。技能优先使用与提供方无关的模型强度设置,助手默认继承当前模型。
详情
作者的原始描述
Strategic delegation for multi-step coding, research, or verification work. Use when a task can be split into parent reasoning plus focused sub-agent execution through the agent tool.
repo: codewhale-hq/Codewhale
热度
- GitHub 星标
- 41k
- 排名
- #6523
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …