# Subagent Model Router

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-kilimiaosix-agent-skills-subagent-model-router`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [KilimiaoSix](https://agentstack.voostack.com/s/kilimiaosix)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [KilimiaoSix](https://github.com/KilimiaoSix)
- **Source:** https://github.com/KilimiaoSix/agent-skills/tree/main/skills/subagent-model-router

## Install

```sh
agentstack add skill-kilimiaosix-agent-skills-subagent-model-router
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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`）：

```js
const hits = await agent('grep 所有调用点并列出 文件:行号', {model: 'haiku', effort: 'low'})
const verdict = await agent(`对抗性验证该结论是否成立: ${claim}`, {model: 'fable'})
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [KilimiaoSix](https://github.com/KilimiaoSix)
- **Source:** [KilimiaoSix/agent-skills](https://github.com/KilimiaoSix/agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-kilimiaosix-agent-skills-subagent-model-router
- Seller: https://agentstack.voostack.com/s/kilimiaosix
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
