name: model-router description: Use when the user explicitly asks to choose, compare, route, or switch AI models; when model fit is material to a high-risk task; when moving between major phases such as architecture, implementation, debugging, or review; or when available models, /model, model selector, speed, cost, long-context, coding, reasoning, or vision tradeoffs are central to the request.
Model Router
Purpose
Route a Codex task to the most appropriate available model before work starts, and re-check the choice at major task boundaries. Default to Chinese outputs and references/zh-CN/ unless the user asks for English.
This skill must first choose from exact available model names when the host exposes them. If exact names are not available, it must choose a model class and use slash-command discovery, tool metadata, or user-provided lists to resolve the exact model. It must never claim a model was switched unless a real tool, slash-command result, or UI confirmation proves it.
Core Rule
Make the routing decision before expensive work.
Do not:
- Pretend that a model switch happened when no switching capability exists.
- Interrupt an active command or file edit just to switch models.
- Install plugins, change account settings, or modify secrets to enable model switching.
- Use a weaker model for high-risk architecture, security, privacy, legal, financial, or irreversible operations just to save cost.
- Emit
/modelas ordinary prose and treat it as executed when the host only accepts slash commands from the user.
Allowed:
- Recommend the right model class when exact model names are unavailable.
- Use an explicit model-switching tool or executable slash-command interface if it is already available.
- Use
/modelor equivalent host-native model controls to list and select models when the host permits agent-issued slash commands. - Ask the user to switch manually when the current model is materially mismatched.
- Proceed without switching when the current model is adequate and switching would block a low-risk task.
Capability Detection
Before deciding that switching is impossible, check for model controls in this order:
- Tool metadata or runtime APIs that expose current model, available models, or a model-switching function.
- Host-native slash commands such as
/model, if the environment allows the agent to execute them. - Visible model selector state, system context, or user-provided model lists.
- Known model labels from the current session.
If /model exists but opens a user-only picker, output the exact recommended selection or command and pause only when the current model is materially wrong for the task.
Cross-Platform Use
In Codex, install this folder as a skill and invoke $model-router. See integrations/codex/install.md from the repository root for install steps.
In Cursor, use integrations/cursor/model-router.mdc as a Project Rule. In Antigravity, use integrations/antigravity/rules/model-router.md or package the plugin described by integrations/antigravity/plugin/plugin.json.
In Claude, ChatGPT, Windsurf, Roo Code, Cline, or other AI tools, provide this SKILL.md as the routing workflow. Use references/zh-CN/routing-guide.md by default, or references/en/routing-guide.md for English projects.
Workflow
Identify task phase Classify the request as planning, architecture, implementation, debugging, review, UI/frontend, data, high-risk reasoning, or simple operation.
Discover candidates Build the candidate list from available exact model names whenever possible. If the host supports
/model, use it to list or open available models before choosing. If candidate names are unavailable, continue with model classes and ask for a model list only when exact automatic switching is required.Score candidates Score each candidate for reasoning strength, coding strength, long-context reliability, tool/vision support, speed, cost, and risk fit. Use the strongest reasoning model for planning, architecture, ambiguous product decisions, high-risk analysis, or model-routing itself. Use the coding-optimized model for multi-file implementation, debugging, refactors, tests, and repo navigation. Use a faster or cheaper model only for simple edits, formatting, summaries, or low-risk local operations.
Select exact model Prefer the best exact available model. If multiple candidates tie, keep the current model when it is adequate; otherwise prefer the model with better task-specific fit over generic strength.
Switch or recommend If a model-switching tool or executable slash-command interface exists, switch at a safe checkpoint and report the result. If no such interface exists, recommend the exact target model and ask the user to switch only when the mismatch matters. Otherwise, proceed and note the routing decision.
Re-check at phase boundaries Re-run routing when moving from architecture to coding, coding to review, debugging to implementation, or when the task becomes higher-risk than originally assumed.
Read references/zh-CN/routing-guide.md by default for the full routing matrix. Use references/en/routing-guide.md only when English output is requested.
Routing Defaults
- Planning, architecture, PRD, data model, API contract, security review: strongest reasoning model available.
- Coding, tests, refactors, debugging, repo-wide edits: strongest coding-agent model available.
- Frontend implementation with visual verification: coding-agent model with strong tool use; add vision/browser capability when screenshots or images matter.
- Short answers, simple file edits, formatting, command output summaries: fast/efficient model if accuracy risk is low.
- Large repository or long documents: model with the most reliable long-context handling, then optimize for reasoning or coding based on the phase.
- High-risk or irreversible actions: strongest reasoning model plus explicit verification; do not downgrade for speed.
Switching Modes
- Automatic mode: If the host exposes a model-switching tool or lets the agent execute
/model, select the best exact model and switch before continuing. - Assisted mode: If
/modelis available but user-only, output the exact model choice or command for the user and wait only when the current model is materially mismatched. - Advisory mode: If exact model names are unavailable, recommend the model class and continue when the current model is adequate.
Output Style
At each routing checkpoint, report briefly:
- Selected exact model, if known
- Recommended model class
- Reason
- Switch status: switched, slash command unavailable/user-only, cannot switch from skill, or no switch needed
- Next action
For routine low-risk tasks, keep this to one or two sentences.
Safety
Treat model switching as an operational boundary. Changing models can affect context handling, code style, and risk tolerance. Before switching during an active task, summarize current state, unresolved assumptions, touched files, and the next intended action so the next model can continue cleanly.