model-selection
Skill3.4k starsChanged 2 months agoMITView on GitHub
Per-agent model selection with 4-layer hierarchy and fallback chains
16 other projects use a version of this.
Adopted by
Most recently taken up by
- Walsworth-Group/physkittheir own version, first seen Nov 8, 2026
- agentstation/skillstheir own version, first seen Nov 1, 2026
- microsoft/github-vteam-industry-demostheir own version, first seen Oct 25, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- awslabs/agent-pluginstheir own version, first seen Oct 13, 2026
- maxatwork/skillstheir own version, first seen Oct 13, 2026
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- github/gh-aw★ 5.6ksame name
- leookun/cursor-byok★ 3.2ksame name
- awslabs/agent-plugins★ 918same name
- Resgrid/Core★ 238same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- Azure/apiops-cli★ 32same name
- han69611/math-modeling-skills★ 10same name
- yuanhao667/Skills★ 10same name
- tstapler/dotfiles★ 8same name
- Walsworth-Group/physkit★ 7same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository247 other files it gives its agents.
- .github/agents.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- packages/squad-cli/templates/copilot-instructions.mdCopilot instructions
- packages/squad-sdk/templates/copilot-instructions.mdCopilot instructions
- .squad-templates/copilot-instructions.mdCopilot instructions
- .squad/templates/copilot-instructions.mdCopilot instructions
- templates/copilot-instructions.mdCopilot instructions
- action-skill-contractsSkill
- agent-collaborationSkill
- agent-conductSkill
- architectural-proposalsSkill
- architectural-reviewSkill
- archival-integritySkill
- ci-validation-gatesSkill
- client-compatibilitySkill
- cli-wiringSkill
- content-scopeSkill
- distributed-meshSkill
- documentation-maintenanceSkill
- github-multi-accountSkill
- git-workflowSkill
- history-hygieneSkill
- init-modeSkill
- pr-lifecycleSkill
- protected-filesSkill
- release-processSkill
- reskillSkill
- reviewer-protocolSkill
- secret-handlingSkill
- security-reviewSkill
- squad-conventionsSkill
- test-disciplineSkill
- windows-compatibilitySkill
- agentic-workflow-designerSkill
- gh-aw-reliabilitySkill
- iterative-retrievalSkill
- reflectSkill
- {skill-name}Skill
- agent-collaborationSkill
- agent-conductSkill
- architectural-proposalsSkill
- ci-validation-gatesSkill
- client-compatibilitySkill
- cli-wiringSkill
- coordinator-init-modeSkill
- coordinator-response-modeSkill
- coordinator-source-of-truthSkill
- cross-machine-coordinationSkill
- cross-squad-communicationSkill
- cross-squadSkill
- distributed-meshSkill
- docs-standardsSkill
- e2e-template-testingSkill
- economy-modeSkill
- error-recoverySkill
- external-commsSkill
- fact-checkingSkill
- gh-auth-isolationSkill
- gh-aw-enlistmentSkill
- github-multi-accountSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Before spawning an agent, the coordinator determines which model to use.
- Distinctive: line 17
Check these layers in order — first match wins:
- Distinctive: line 23
Layer 3 — Task-Aware Auto-Selection: Use the governing principle: cost first, unless code is being written.
- Very specific: line 52
Layer 4 — Default: If nothing else matched, use gpt-5.6-luna.
- Distinctive: line 67
If the user specified a provider ("use Claude"), fall back within that provider only before using the platform default fallback
- Distinctive: line 68
Never fall back UP in tier — a fast/cheap task should not land on a premium model
- Very specific: line 84
Only set model when it differs from the platform default (claude-sonnet-4.6).
- Very specific: line 86
If you've exhausted the fallback chain and reached the platform default fallback, omit the model parameter entirely.
- Distinctive: line 90
When spawning, include the model in your acknowledgment:
- Very specific: line 119
All spawns use claude-haiku-4.5 regardless of role or task
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context
Before spawning an agent, the coordinator determines which model to use. This skill codifies the 4-layer hierarchy, role-to-model mappings, task complexity adjustments, and fallback chains. Applies to all agent spawns in Team Mode.
Patterns
4-Layer Hierarchy
Check these layers in order — first match wins:
Layer 1 — User Override: Did the user specify a model? ("use opus", "save costs", "use gpt-5.3-codex for this"). If yes, use that model. Session-wide directives ("always use haiku") persist until contradicted.
Layer 2 — Charter Preference: Does the agent's charter have a ## Model section with Preferred set to a specific model (not auto)? If yes, use that model.
Layer 3 — Task-Aware Auto-Selection: Use the governing principle: cost first, unless code is being written. Match the agent's task to determine output type, then select accordingly:
| Task Output | Model | Tier | Rule |
| Writing code (implementation, refactoring, test code, bug fixes) | gpt-5.6-terra | Standard | Quality and accuracy matter for code. Use standard tier. |
| Writing prompts or agent designs (structured text that functions like code) | gpt-5.6-terra | Standard | Prompts are executable — treat like code. |
| NOT writing code (docs, planning, triage, logs, changelogs, mechanical ops) | gpt-5.6-luna | Fast | Cost first. Luna handles non-code tasks by default. |
| Visual/design work requiring image analysis | gpt-5.6-sol | Premium | Vision capability required. Overrides cost rule. |
Role-to-model mapping (applying cost-first principle):
| Role | Default Model | Why | Override When |
| Core Dev / Backend / Frontend | gpt-5.6-terra | Writes code — quality first | Heavy code gen → gpt-5.3-codex |
| Tester / QA | gpt-5.6-terra | Writes test code — quality first | Simple test scaffolding → claude-haiku-4.5 |
| Lead / Architect | auto (per-task) | Mixed: code review needs quality, planning needs cost | Architecture proposals → premium; triage/planning → luna |
| Prompt Engineer | auto (per-task) | Mixed: prompt design is like code, research is not | Prompt architecture → gpt-5.6-terra; research/analysis → haiku |
| Copilot SDK Expert | gpt-5.6-terra | Technical analysis that often touches code | Pure research → claude-haiku-4.5 |
| Designer / Visual | gpt-5.6-sol | Vision-capable model required | — (never downgrade — vision is non-negotiable) |
| DevRel / Writer | gpt-5.6-luna | Docs and writing — not code | — |
| Scribe / Logger | gpt-5.6-luna | Mechanical file ops — cheapest possible | — (never bump Scribe) |
| Git / Release | gpt-5.6-luna | Mechanical ops — changelogs, tags, version bumps | — (never bump mechanical ops) |
Task complexity adjustments (apply at most ONE — no cascading):
- Bump UP to premium: architecture proposals, reviewer gates, security audits, multi-agent coordination (output feeds 3+ agents)
- Bump DOWN to fast/cheap: typo fixes, renames, boilerplate, scaffolding, changelogs, version bumps
- Switch to code specialist (
gpt-5.3-codex): large multi-file refactors, complex implementation from spec, heavy code generation (500+ lines) - Switch to analytical diversity (
gemini-3.1-pro): code reviews where a second perspective helps, security reviews, architecture reviews after a rejection
Layer 4 — Default: If nothing else matched, use gpt-5.6-luna. Cost wins when in doubt, unless code is being produced.
Fallback Chains
If a spawn fails because the selected model is unavailable (plan restriction, org policy, rate limit, deprecation, or any other reason), silently retry with the next model in the chain. Do NOT tell the user about fallback attempts. Maximum 3 retries before using the platform default fallback.
Premium: gpt-5.6-sol → claude-opus-5 → claude-opus-4.8 → claude-opus-4.7 → claude-opus-4.6 → claude-sonnet-4.6 → (omit model param)
Standard: gpt-5.6-terra → claude-sonnet-5 → claude-sonnet-4.6 → gpt-5.5 → gpt-5.4 → gpt-5.3-codex → claude-sonnet-4.5 → gemini-3.1-pro → (omit model param)
Fast: gpt-5.6-luna → claude-haiku-4.5 → gpt-5.4-mini → gpt-5-mini → (omit model param)(omit model param) = call the task tool WITHOUT the model parameter. The platform uses its built-in default. This is the platform default fallback — it lets the platform choose the model.
Fallback rules:
- If the user specified a provider ("use Claude"), fall back within that provider only before using the platform default fallback
- Never fall back UP in tier — a fast/cheap task should not land on a premium model
- Log fallbacks to the orchestration log for debugging, but never surface to the user unless asked
Passing the Model to Spawns
Pass the resolved model as the model parameter on every task tool call:
agent_type: "general-purpose"
model: "{resolved_model}"
mode: "background"
description: "{emoji} {Name}: {brief task summary}"
prompt: |
...Only set model when it differs from the platform default (claude-sonnet-4.6). If the resolved model IS claude-sonnet-4.6, you MAY omit the model parameter — the platform uses it as default.
If you've exhausted the fallback chain and reached the platform default fallback, omit the model parameter entirely.
Spawn Output Format
When spawning, include the model in your acknowledgment:
🔧 Agent Alpha (claude-sonnet-5) — refactoring auth module
🎨 Agent Beta (gpt-5.6-sol · vision) — designing color system
📋 Scribe (gpt-5.6-luna · fast) — logging session
⚡ Agent Gamma (gpt-5.6-sol · bumped for architecture) — reviewing proposal
📝 Agent Delta (gpt-5.6-luna · fast) — updating docsInclude tier annotation only when the model was bumped or a specialist was chosen. Default-tier spawns just show the model name.
Valid Models
Premium: gpt-5.6-sol, claude-opus-5, claude-opus-4.8, claude-opus-4.7, claude-opus-4.6
Standard: gpt-5.6-terra, claude-sonnet-5, claude-sonnet-4.6, claude-sonnet-4.5, gpt-5.5, gpt-5.4, gpt-5.3-codex, gemini-3.1-pro
Fast/Cheap: gpt-5.6-luna, claude-haiku-4.5, gpt-5.4-mini, gpt-5-mini
Examples
Example 1: Backend dev writing API endpoints
- Role: Backend Dev
- Task: "implement REST endpoints for user management"
- Layer 3 decision: writing code →
gpt-5.6-terra(standard tier) - Spawn:
🔧 Agent Alpha (gpt-5.6-terra) — implementing user API endpoints
Example 2: User override
- User says: "use haiku for everything this session"
- Layer 1 overrides all other layers
- All spawns use
claude-haiku-4.5regardless of role or task
Example 3: Complex refactor
- Role: Backend Dev
- Task: "refactor 15 auth-related files to use new token system"
- Layer 3 base:
gpt-5.6-terra - Task complexity: heavy multi-file refactor → switch to
gpt-5.3-codex - Spawn:
🔧 Agent Alpha (gpt-5.3-codex · code specialist) — refactoring auth to new token system
Example 4: Scribe logging
- Role: Scribe
- Task: "log session to decisions.md"
- Layer 3: NOT writing code →
gpt-5.6-luna - Role mapping: Scribe always luna, never bump
- Spawn:
📋 Scribe (gpt-5.6-luna · fast) — logging session
Anti-Patterns
- ❌ Falling back UP in tier (fast task landing on premium model)
- ❌ Telling the user about fallback attempts ("Opus failed, trying Sonnet")
- ❌ Bumping Scribe or mechanical ops agents to higher tiers
- ❌ Using premium models for documentation or planning tasks
- ❌ Applying multiple complexity adjustments (cascading bumps)
- ❌ Forgetting to include model in spawn acknowledgment
- ❌ Downgrading vision-required tasks from the premium visual model
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.

