Skip to content
Development
Skill

/model-routing-patterns

Capability-aware model routing for Codex, Copilot, Claude and provider APIs. Triggers: model routing, model selection, reasoning effort, approved fallback, cost, escalation.

From plugin
ai-toolkit
180117 skills44 agents

Claude Code

$ npx -y skills add softspark/ai-toolkit --skill model-routing-patterns --agent claude-code

SKILL.md

model-routing-patterns.SKILL.md
name: model-routing-patterns
description: "Capability-aware model routing for Codex, Copilot, Claude and provider APIs. Triggers: model routing, model selection, reasoning effort, approved fallback, cost, escalation."
effort: medium
user-invocable: false
allowed-tools: Read

Model Routing Patterns

Choose routes from measured quality, latency and cost under the user's approved model and spending policy. An explicit model choice overrides automatic routing. This skill never authorizes a model-tier, permission or budget change.

Apply the same policy across Codex, Copilot and Claude: retain the model selected by the native client. Provider API IDs, editor picker labels and agent aliases are separate namespaces; do not translate between them by resemblance. For a cross-provider application route, validate capabilities and availability on each provider, and obtain authorization before transferring data or changing spend. The project inventory is `kb/reference/model-compatibility.md`.

<!-- CLAUDE_CODE_ONLY_START -->

Claude Code: available executors and supervised routing

Apply this section only in Claude Code. Other clients use their native agents and keep their configured models and reasoning effort. Never call the Claude Codex plugin from Codex, Antigravity or another client.

Check availability before choosing an executor. The Codex route requires all three: the `codex@openai-codex` plugin is installed, effectively enabled for the current project, and `codex:codex-rescue` is callable through the current Agent tool. The toolkit SessionStart hint checks local metadata only; it does not prove runtime availability, authentication, model access or security access. An existing cache directory alone is insufficient. If the hint is absent, verify those conditions from the client's plugin status and agent catalog.

When unavailable or disabled, use installed native agents with their configured models and effort. Do not install or enable a plugin, force a Codex command, or change the current session's model to satisfy this policy. If delegation itself is unavailable, do the authorized work in the current session and report that limitation. Explicit user model choices always take precedence.

The toolkit's Claude defaults use these roles when available:

| Work | Executor | |------|----------| | Planning, coordination and acceptance | Native orchestrator, Opus `high` | | Bounded implementation, tests and routine fixes | Native implementation agent, Sonnet `high`, or the available Codex plugin | | Defensive source and configuration review | For an approved read-only review, use available Codex `gpt-6.2-astra` at `xhigh`, or the configured native security auditor | | Hard debugging | Available Codex at `xhigh`, or the native debugger, Opus `xhigh` |

Use Codex proactively for substantial independent implementation or diagnosis; do not require a failure first, and keep trivial edits with the current executor. Retain the native domain role, file ownership and review criteria when selecting the Codex executor. If the selected model is unavailable, report it. A native auditor can review the same source under the same scope when the approved routing policy permits it. An access denial or safety refusal ends that route.

Dispatch with `Agent(subagent_type="codex:codex-rescue", prompt="--fresh ...")`. Include the task, working directory, owned paths, relevant evidence, acceptance criteria and verification commands. For the approved defensive review, request read-only source inspection, mitigations and isolated regression-test suggestions. Pass `--model gpt-6.2-astra --effort xhigh` for that review, or `--effort xhigh` for hard debugging. Ordinary coding keeps the configured Codex model and effort unless the user chose otherwise. These flags control the Codex worker, not the Sonnet forwarding wrapper. Do not use the retired Spark alias or substitute a plugin command for the agent.

Request read-only work explicitly for audits or diagnosis; write access is appropriate only for an authorized implementation task. Codex's sandbox and approval restrictions still apply. Permission or authentication failures return to the supervisor; they do not authorize bypasses or a new account/provider. Keep the review within the auditor's defensive scope and existing permissions. Preserve the caller's restrictions and report any unavailable capability.

The supervisor owns lifecycle and verification. A background job identifier is not completion: collect the final result using the plugin's documented status and result controls, keyed to that job. Resume only the identified prior task; use a fresh task for independent work. Empty output, failed startup and partial results are failures to resolve, not successful delegation. Do not redispatch failed writes until their partial changes have been inspected. Verify the diff, tests and required review before acceptance, then finish or cancel owned work. The forwarding wrapper must only forward; do not ask it to inspect or monitor.

When creating agents, keep native Claude model fields valid. Codex is a separate executor, not a Claude `model:` value or an automatic Claude Team member. Reuse the installed plugin instead of generating another wrapper or editing its cache. <!-- CLAUDE_CODE_ONLY_END -->

Reviewed model reference (2026-11-18)

| Model | Claude API ID | API effort default | |-------|---------------|--------------------| | Claude Opus 5.5 | `claude-opus-5-5` | `medium` | | Claude Fable 5.2 | `claude-fable-5-2` | `high` | | Claude Sonnet 5.5 | `claude-sonnet-5-5` | `high` | | Claude Haiku 5.5 | `claude-haiku-5-5` | `medium` |

Codex lists `gpt-6.2-astra` for demanding work and `gpt-6.2-sol` for everyday coding. `gpt-6.1-terra` covers writing, visual understanding and computer use, and `gpt-6-luna` covers focused tasks. Earlier Astra and Sol models remain listed. Check the account's model picker for actual availability.

These are dated identifiers, not a runtim

Read more
@softspark
Ships withai-toolkit

AI coding toolkit with machine-enforced safety, 116 skills, 44 agents, lifecycle hooks, persona presets, opt-in plugin packs, and benchmark tooling.

180117 skills44 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
180
Star history of softspark/ai-toolkit on GitHub, a chart by star-history.com

Other skills on ai-toolkit.

ai-toolkit-rules

ai-toolkit-rules

Mandatory engineering, security, testing, git, performance, quality, and response rules. Claude MUST load this skill for every…

mem-search

mem-search

Searches past coding sessions for observations, decisions, context. Triggers: mem-search, recall session, past work, prior…

a11y-validate

a11y-validate

Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. Triggers: a11y, accessibility, WCAG, EAA, ARIA, contrast, keyboard, screen…

agent-creator

agent-creator

Creates new specialized agents with frontmatter, tools, delegation. Triggers: new agent, create agent, agent scaffold,…

analyze

analyze

Analyzes code quality, complexity, patterns across codebase. Triggers: quality report, hotspot scan, code analysis, architecture…

api-patterns

api-patterns

API design: naming, versioning, pagination, idempotency, OpenAPI, error contracts and safe retries. Triggers: API design, REST,…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills3w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc3w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2w252k
@facebook@facebookInstall Skill

Questions about model-routing-patterns.

Which coding agents can use model-routing-patterns?
model-routing-patterns installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.