Model selection

From bradygaster/squad · View interactive version

Model selection is an AI agent skill from the GitHub repository bradygaster/squad. Per-agent model selection with 4-layer hierarchy and fallback chains

How to use this skill

Skill file

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):

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:

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 docs

Include 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

Example 2: User override

Example 3: Complex refactor

Example 4: Scribe logging

Anti-Patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.