subagent-model-router
Skill1 starsChanged 4 months agoMITView on GitHub
Claude Code 专用:派发子 agent(Agent 工具或 Workflow agent())前,按任务复杂度为每个子任务选择 model 参数。Use when about to spawn subagents, fan out parallel Explore/Plan/general-purpose agents, or write Workflow scripts — pick fable/opus/sonnet/haiku per task complexity, or omit model when uncertain.
In this repository14 other files it gives its agents.
- api-doc-writerSkill
- autonomous-multi-agent-developmentSkill
- design-doc-to-ui-feishu-docSkill
- design-doc-to-ui-figma-replicaSkill
- design-doc-to-ui-negative-caseSkill
- design-doc-to-uiSkill
- design-doc-to-ui-visual-auditSkill
- enforce-engineering-disciplineSkill
- feishu-block-surgerySkill
- frontend-design-codexSkill
- goal-prompt-builderSkill
- photo-review-workflowSkill
- smart-searchSkill
- svg-board-generatorSkill
The file
Files
Subagent Model Router
在 Claude Code 中派发子 agent 前,按下面的规则为每个子任务单独选择 model 参数。适用于:
- Agent 工具的
model参数(Explore、Plan、general-purpose、自定义 agent 类型均可传) - Workflow 脚本中的
agent(prompt, {model})
一次并行 fan-out 中的不同子任务分别评估,可以混用不同模型。
四档映射
| model | 档位 | 典型任务信号 |
fable | 高难·推理型 | 架构设计与方案权衡、跨模块疑难 debug、影响面/根因分析、安全审计、对抗性验证与裁决——多步推理、判断出错代价高 |
opus | 高难·实现型 | 大规模代码产出、大型重构/迁移的执行、复杂但方向已明确的实现 |
sonnet | 中等 | 常规功能实现、单模块 bug 修复、单一维度代码审查、常规文档撰写、中等规模调研汇总 |
haiku | 简单 | 文件/关键词搜索定位、清单式调研、机械性批量编辑、冒烟测试运行、格式检查——产出可被轻易验证 |
判断依据是任务本身的推理难度和出错代价,不是 prompt 的长度或涉及文件的数量。
默认与例外
- 复杂度介于两档之间、或拿不准 → 不传
model,继承主会话模型。不要为省成本强行降档。 - 用户显式指定了模型 → 以用户为准。
- 子 agent 的结论将直接决定不可逆操作(删除、部署、对外发布) → 宁可升一档。
传参示例
Agent 工具(同一次并行 fan-out 中混用模型):
- 简单搜索:
{subagent_type: "Explore", model: "haiku", prompt: "找出所有引用 X 的文件…"} - 深度分析:
{subagent_type: "general-purpose", model: "fable", prompt: "分析改动 Y 对模块 Z 的影响面…"} - 常规实现:
{subagent_type: "general-purpose", model: "sonnet", prompt: "按既有约定实现接口 W…"}
Workflow 脚本(机械型任务可同时降 effort):
const hits = await agent('grep 所有调用点并列出 文件:行号', {model: 'haiku', effort: 'low'})
const verdict = await agent(`对抗性验证该结论是否成立: ${claim}`, {model: 'fable'})Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

