[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6R77498YT7FB6GFPHZ7E4E2":3,"skill-same:01M6R77498YT7FB6GFPHZ7E4E2":44},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":14,"categories":15,"keywords":16,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":12,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M6R77498YT7FB6GFPHZ7E4E2","model-selection",null,"barichter\u002Fsquad","barichter","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F96797186?v=4","01M6R712K8ESMDF089BFENBR16","01M6R712R74BSQQSG2GTXBWR8P",0,"MIT","https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad\u002Fblob\u002Fdev\u002F.squad\u002Fskills\u002Fmodel-selection\u002FSKILL.md",[],[17,18,19],"model selection","model","selection","2026-11-10 10:12:30",false,"# Model Selection\n\n> Determines which LLM model to use for each agent spawn.\n\n## SCOPE\n\n✅ THIS SKILL PRODUCES:\n- A resolved `model` parameter for every `task` tool call\n- Persistent model preferences in `.squad\u002Fconfig.json`\n- Spawn acknowledgments that include the resolved model\n\n❌ THIS SKILL DOES NOT PRODUCE:\n- Code, tests, or documentation\n- Model performance benchmarks\n- Cost reports or billing artifacts\n\n## Context\n\nSquad supports 18+ models across three tiers (premium, standard, fast). The coordinator must select the right model for each agent spawn. Users can set persistent preferences that survive across sessions.\n\n## 5-Layer Model Resolution Hierarchy\n\nResolution is **first-match-wins** — the highest layer with a value wins.\n\n| Layer | Name | Source | Persistence |\n|-------|------|--------|-------------|\n| **0a** | Per-Agent Config | `.squad\u002Fconfig.json` → `agentModelOverrides.{name}` | Persistent (survives sessions) |\n| **0b** | Global Config | `.squad\u002Fconfig.json` → `defaultModel` | Persistent (survives sessions) |\n| **1** | Session Directive | User said \"use X\" in current session | Session-only |\n| **2** | Charter Preference | Agent's `charter.md` → `## Model` section | Persistent (in charter) |\n| **3** | Task-Aware Auto | Code → sonnet, docs → haiku, visual → opus | Computed per-spawn |\n| **4** | Default | `claude-haiku-4.5` | Hardcoded fallback |\n\n**Key principle:** Layer 0 (persistent config) beats everything. If the user said \"always use opus\" and it was saved to config.json, every agent gets opus regardless of role or task type. This is intentional — the user explicitly chose quality over cost.\n\n## AGENT WORKFLOW\n\n### On Session Start\n\n1. READ `.squad\u002Fconfig.json`\n2. CHECK for `defaultModel` field — if present, this is the Layer 0 override for all spawns\n3. CHECK for `agentModelOverrides` field — if present, these are per-agent Layer 0a overrides\n4. STORE both values in session context for the duration\n\n### On Every Agent Spawn\n\n1. CHECK Layer 0a: Is there an `agentModelOverrides.{agentName}` in config.json? → Use it.\n2. CHECK Layer 0b: Is there a `defaultModel` in config.json? → Use it.\n3. CHECK Layer 1: Did the user give a session directive? → Use it.\n4. CHECK Layer 2: Does the agent's charter have a `## Model` section? → Use it.\n5. CHECK Layer 3: Determine task type:\n   - Code (implementation, tests, refactoring, bug fixes) → `claude-sonnet-4.6`\n   - Prompts, agent designs → `claude-sonnet-4.6`\n   - Visual\u002Fdesign with image analysis → `claude-opus-4.6`\n   - Non-code (docs, planning, triage, changelogs) → `claude-haiku-4.5`\n6. FALLBACK Layer 4: `claude-haiku-4.5`\n7. INCLUDE model in spawn acknowledgment: `? {Name} ({resolved_model}) — {task}`\n\n### When User Sets a Preference\n\n**Trigger phrases:** \"always use X\", \"use X for everything\", \"switch to X\", \"default to X\"\n\n1. VALIDATE the model ID against the catalog (18+ models)\n2. WRITE `defaultModel` to `.squad\u002Fconfig.json` (merge, don't overwrite)\n3. ACKNOWLEDGE: `✅ Model preference saved: {model} — all future sessions will use this until changed.`\n\n**Per-agent trigger:** \"use X for {agent}\"\n\n1. VALIDATE model ID\n2. WRITE to `agentModelOverrides.{agent}` in `.squad\u002Fconfig.json`\n3. ACKNOWLEDGE: `✅ {Agent} will always use {model} — saved to config.`\n\n### When User Clears a Preference\n\n**Trigger phrases:** \"switch back to automatic\", \"clear model preference\", \"use default models\"\n\n1. REMOVE `defaultModel` from `.squad\u002Fconfig.json`\n2. ACKNOWLEDGE: `✅ Model preference cleared — returning to automatic selection.`\n\n### STOP\n\nAfter resolving the model and including it in the spawn template, this skill is done. Do NOT:\n- Generate model comparison reports\n- Run benchmarks or speed tests\n- Create new config files (only modify existing `.squad\u002Fconfig.json`)\n- Change the model after spawn (fallback chains handle runtime failures)\n\n## Config Schema\n\n`.squad\u002Fconfig.json` model-related fields:\n\n```json\n{\n  \"version\": 1,\n  \"defaultModel\": \"claude-opus-4.6\",\n  \"agentModelOverrides\": {\n    \"fenster\": \"claude-sonnet-4.6\",\n    \"mcmanus\": \"claude-haiku-4.5\"\n  }\n}\n```\n\n- `defaultModel` — applies to ALL agents unless overridden by `agentModelOverrides`\n- `agentModelOverrides` — per-agent overrides that take priority over `defaultModel`\n- Both fields are optional. When absent, Layers 1-4 apply normally.\n\n## Fallback Chains\n\nIf a model is unavailable (rate limit, plan restriction), retry within the same tier:\n\n```\nPremium:  claude-opus-4.6 → claude-opus-4.6-fast → claude-opus-4.5 → claude-sonnet-4.6\nStandard: claude-sonnet-4.6 → gpt-5.4 → claude-sonnet-4.5 → gpt-5.3-codex → claude-sonnet-4\nFast:     claude-haiku-4.5 → gpt-5.1-codex-mini → gpt-4.1 → gpt-5-mini\n```\n\n**Never fall UP in tier.** A fast task won't land on a premium model via fallback.\n",{},"dev","ec19f5e92325e634e3c6eff500e3cefa56131cc9",".squad\u002Fskills\u002Fmodel-selection","https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad","https:\u002F\u002Fgithub.com\u002Fbarichter","2026-04-13 22:53:46",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add barichter\u002Fsquad --skill model-selection",{"tool":36,"command":37},"bunx","bunx skills add barichter\u002Fsquad --skill model-selection",{"tool":39,"command":40},"pnpm","pnpm dlx skills add barichter\u002Fsquad --skill model-selection","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad\u002Fblob\u002Fdev\u002F.squad\u002Fskills\u002Fmodel-selection\u002FSKILL.md",true,[],[45,61,69,86,109,115],{"skillNo":46,"name":47,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":55,"publishedAt":20},"01M6R7VE8SZD1E37WWJN4ZFPWB","My Skill","https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad\u002Fblob\u002Fdev\u002Ftest-fixtures\u002Fskills-test-abb30454\u002Fmy-skill\u002FSKILL.md",[50],{"categoryNo":51,"categoryName":52,"taxonomyType":53,"taxonomyTypeDesc":54},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[56,57,58,59,60],"my","my skill","tester","vitest","testing",{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":20},"01M6R7VD19M4TMAA74XGD6QSZX","bad-skill","https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad\u002Fblob\u002Fdev\u002Ftest-fixtures\u002Fskills-test-abb30454\u002Fbad-skill\u002FSKILL.md",[],[67,68],"bad skill","bad",{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":20},"01M6R7V9TYTX6Z621V6RWA51G6","squad-conventions","Core conventions and patterns used in the Squad codebase","https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad\u002Fblob\u002Fdev\u002Ftemplates\u002Fskills\u002Fsquad-conventions\u002FSKILL.md",[],[76,77,78,79,80,81,82,83,84,85],"squad conventions","squad","conventions","project-conventions","core","patterns","project","manual","high","codebase",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":20},"01M6R7TTF0ABMGSVWASVYF6D51","rework-rate","Measure and interpret PR rework rate — the emerging 5th DORA metric","https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad\u002Fblob\u002Fdev\u002Ftemplates\u002Fskills\u002Frework-rate\u002FSKILL.md",[],[93,94,95,96,97,98,99,100,101,84,77,102,103,104,105,106,107,108,83],"rate","rework rate","metric","efficiency","prs","when","pr","review","code quality","code","code-review","metrics","health","team","analyze","quality",{"skillNo":110,"name":111,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":20},"01M6R7TRZPET44JRCSQF08EEA8","nap","https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad\u002Fblob\u002Fdev\u002Ftemplates\u002Fskills\u002Fnap\u002FSKILL.md",[],[111],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":122,"publishedAt":20},"01M6R7TK10WCT77A52E27GR5R3","{skill-name}","{what this skill teaches agents}","https:\u002F\u002Fgithub.com\u002Fbarichter\u002Fsquad\u002Fblob\u002Fdev\u002Ftemplates\u002Fskill.md",[121],{"categoryNo":51,"categoryName":52,"taxonomyType":53,"taxonomyTypeDesc":54},[123,124,125,126,127,128,129,130,131,132,83,84,60],"{skill name}","skill name","name","design","api","how","error-handling","learned","error","api-design"]