Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/agents/squad.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Squad
description: "Your AI team. Describe what you're building, get a team of specialists that live in your repo."
---

<!-- version: 0.8.25-build.5 -->
<!-- version: 0.8.25-build.10 -->

You are **Squad (Coordinator)** — the orchestrator for this project's AI team.

### Coordinator Identity

- **Name:** Squad (Coordinator)
- **Version:** 0.8.25-build.5 (see HTML comment above — this value is stamped during install/upgrade). Include it as `Squad v0.8.25-build.5` in your first response of each session (e.g., in the acknowledgment or greeting).
- **Version:** 0.8.25-build.10 (see HTML comment above — this value is stamped during install/upgrade). Include it as `Squad v0.8.25-build.5` in your first response of each session (e.g., in the acknowledgment or greeting).
- **Role:** Agent orchestration, handoff enforcement, reviewer gating
- **Inputs:** User request, repository state, `.squad/decisions.md`
- **Outputs owned:** Final assembled artifacts, orchestration log (via Scribe)
Expand Down Expand Up @@ -292,9 +292,9 @@ For read-only queries, use the explore agent: `agent_type: "explore"` with `"You
**Core rules (always loaded):**
- 4-layer hierarchy: User Override → Charter Preference → Task-Aware Auto → Default (haiku)
- Governing principle: **cost first, unless code is being written**
- Code tasks → `claude-sonnet-4.5` (standard), non-code → `claude-haiku-4.5` (fast)
- Code tasks → `claude-sonnet-4.6` (standard), non-code → `claude-haiku-4.5` (fast)
- Fallback chains: silently retry within tier, never fall UP, log but don't surface to user
- Always include model in spawn acknowledgment: `🔧 Fenster (claude-sonnet-4.5) — task`
- Always include model in spawn acknowledgment: `🔧 Fenster (claude-sonnet-4.6) — task`

### Client Compatibility

Expand Down
30 changes: 15 additions & 15 deletions .squad/skills/model-selection/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ Check these layers in order — first match wins:

| Task Output | Model | Tier | Rule |
|-------------|-------|------|------|
| Writing code (implementation, refactoring, test code, bug fixes) | `claude-sonnet-4.5` | Standard | Quality and accuracy matter for code. Use standard tier. |
| Writing prompts or agent designs (structured text that functions like code) | `claude-sonnet-4.5` | Standard | Prompts are executable — treat like code. |
| Writing code (implementation, refactoring, test code, bug fixes) | `claude-sonnet-4.6` | Standard | Quality and accuracy matter for code. Use standard tier. |
| Writing prompts or agent designs (structured text that functions like code) | `claude-sonnet-4.6` | Standard | Prompts are executable — treat like code. |
| NOT writing code (docs, planning, triage, logs, changelogs, mechanical ops) | `claude-haiku-4.5` | Fast | Cost first. Haiku handles non-code tasks. |
| Visual/design work requiring image analysis | `claude-opus-4.5` | 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 | `claude-sonnet-4.5` | Writes code — quality first | Heavy code gen → `gpt-5.2-codex` |
| Tester / QA | `claude-sonnet-4.5` | Writes test code — quality first | Simple test scaffolding → `claude-haiku-4.5` |
| Core Dev / Backend / Frontend | `claude-sonnet-4.6` | Writes code — quality first | Heavy code gen → `gpt-5.3-codex` |
| Tester / QA | `claude-sonnet-4.6` | 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 → haiku |
| Prompt Engineer | auto (per-task) | Mixed: prompt design is like code, research is not | Prompt architecture → sonnet; research/analysis → haiku |
| Copilot SDK Expert | `claude-sonnet-4.5` | Technical analysis that often touches code | Pure research → `claude-haiku-4.5` |
| Designer / Visual | `claude-opus-4.5` | Vision-capable model required | — (never downgrade — vision is non-negotiable) |
| Copilot SDK Expert | `claude-sonnet-4.6` | Technical analysis that often touches code | Pure research → `claude-haiku-4.5` |
| Designer / Visual | `claude-opus-4.6` | Vision-capable model required | — (never downgrade — vision is non-negotiable) |
| DevRel / Writer | `claude-haiku-4.5` | Docs and writing — not code | — |
| Scribe / Logger | `claude-haiku-4.5` | Mechanical file ops — cheapest possible | — (never bump Scribe) |
| Git / Release | `claude-haiku-4.5` | 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.2-codex`):** large multi-file refactors, complex implementation from spec, heavy code generation (500+ lines)
- **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-pro-preview`):** code reviews where a second perspective helps, security reviews, architecture reviews after a rejection

**Layer 4 — Default:** If nothing else matched, use `claude-haiku-4.5`. Cost wins when in doubt, unless code is being produced.
Expand All @@ -56,8 +56,8 @@ Check these layers in order — first match wins:
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 jumping to the nuclear fallback.

```
Premium: claude-opus-4.6 → claude-opus-4.6-fast → claude-opus-4.5 → claude-sonnet-4.5 → (omit model param)
Standard: claude-sonnet-4.5 → gpt-5.2-codex → claude-sonnet-4 → gpt-5.2 → (omit model param)
Premium: claude-opus-4.6 → claude-opus-4.6-fast → claude-opus-4.5 → claude-sonnet-4.6 → (omit model param)
Standard: claude-sonnet-4.6 → gpt-5.4 → claude-sonnet-4.5 → gpt-5.3-codex → claude-sonnet-4 → (omit model param)
Fast: claude-haiku-4.5 → gpt-5.1-codex-mini → gpt-4.1 → gpt-5-mini → (omit model param)
```

Expand All @@ -81,7 +81,7 @@ prompt: |
...
```

Only set `model` when it differs from the platform default (`claude-sonnet-4.5`). If the resolved model IS `claude-sonnet-4.5`, you MAY omit the `model` parameter — the platform uses it as default.
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 nuclear fallback, omit the `model` parameter entirely.

Expand All @@ -90,8 +90,8 @@ If you've exhausted the fallback chain and reached nuclear fallback, omit the `m
When spawning, include the model in your acknowledgment:

```
🔧 Fenster (claude-sonnet-4.5) — refactoring auth module
🎨 Redfoot (claude-opus-4.5 · vision) — designing color system
🔧 Fenster (claude-sonnet-4.6) — refactoring auth module
🎨 Redfoot (claude-opus-4.6 · vision) — designing color system
📋 Scribe (claude-haiku-4.5 · fast) — logging session
⚡ Keaton (claude-opus-4.6 · bumped for architecture) — reviewing proposal
📝 McManus (claude-haiku-4.5 · fast) — updating docs
Expand All @@ -102,16 +102,16 @@ Include tier annotation only when the model was bumped or a specialist was chose
### Valid Models

**Premium:** `claude-opus-4.6`, `claude-opus-4.6-fast`, `claude-opus-4.5`
**Standard:** `claude-sonnet-4.5`, `claude-sonnet-4`, `gpt-5.2-codex`, `gpt-5.2`, `gpt-5.1-codex-max`, `gpt-5.1-codex`, `gpt-5.1`, `gpt-5`, `gemini-3-pro-preview`
**Standard:** `claude-sonnet-4.6`, `claude-sonnet-4.5`, `claude-sonnet-4`, `gpt-5.4`, `gpt-5.3-codex`, `gpt-5.2-codex`, `gpt-5.2`, `gpt-5.1-codex-max`, `gpt-5.1-codex`, `gpt-5.1`, `gpt-5`, `gemini-3-pro-preview`
**Fast/Cheap:** `claude-haiku-4.5`, `gpt-5.1-codex-mini`, `gpt-5-mini`, `gpt-4.1`

## Examples

**Example 1: Backend dev writing API endpoints**
- Role: Backend Dev
- Task: "implement REST endpoints for user management"
- Layer 3 decision: writing code → `claude-sonnet-4.5` (standard tier)
- Spawn: `🔧 Fenster (claude-sonnet-4.5) — implementing user API endpoints`
- Layer 3 decision: writing code → `claude-sonnet-4.6` (standard tier)
- Spawn: `🔧 Fenster (claude-sonnet-4.6) — implementing user API endpoints`

**Example 2: User override**
- User says: "use haiku for everything this session"
Expand Down
6 changes: 3 additions & 3 deletions packages/squad-sdk/src/agents/model-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,23 @@ function selectModelForTask(taskType: TaskType): ResolvedModel | undefined {
switch (taskType) {
case 'code':
return {
model: 'claude-sonnet-4.5',
model: 'claude-sonnet-4.6',
tier: 'standard',
source: 'task-auto',
fallbackChain: [...MODELS.FALLBACK_CHAINS.standard],
};

case 'prompt':
return {
model: 'claude-sonnet-4.5',
model: 'claude-sonnet-4.6',
tier: 'standard',
source: 'task-auto',
fallbackChain: [...MODELS.FALLBACK_CHAINS.standard],
};

case 'visual':
return {
model: 'claude-opus-4.5',
model: 'claude-opus-4.6',
tier: 'premium',
source: 'task-auto',
fallbackChain: [...MODELS.FALLBACK_CHAINS.premium],
Expand Down
32 changes: 30 additions & 2 deletions packages/squad-sdk/src/config/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ export const MODEL_CATALOG: ModelInfo[] = [
},

// Standard tier - balanced quality, speed, cost
{
id: 'claude-sonnet-4.6',
tier: 'standard',
provider: 'anthropic',
family: 'claude',
vision: true,
useCases: ['code generation', 'test writing', 'refactoring', 'prompt engineering'],
cost: 5,
speed: 7
},
{
id: 'claude-sonnet-4.5',
tier: 'standard',
Expand All @@ -94,6 +104,24 @@ export const MODEL_CATALOG: ModelInfo[] = [
cost: 4,
speed: 7
},
{
id: 'gpt-5.4',
tier: 'standard',
provider: 'openai',
family: 'gpt',
useCases: ['general purpose', 'code generation', 'analysis'],
cost: 6,
speed: 7
},
{
id: 'gpt-5.3-codex',
tier: 'standard',
provider: 'openai',
family: 'gpt',
useCases: ['heavy code generation', 'multi-file refactors'],
cost: 5,
speed: 6
},
{
id: 'gpt-5.2-codex',
tier: 'standard',
Expand Down Expand Up @@ -201,8 +229,8 @@ export const MODEL_CATALOG: ModelInfo[] = [
* Default fallback chains per tier from squad.agent.md.
*/
export const DEFAULT_FALLBACK_CHAINS: Record<ModelTier, ModelId[]> = {
premium: ['claude-opus-4.6', 'claude-opus-4.6-fast', 'claude-opus-4.5', 'claude-sonnet-4.5'],
standard: ['claude-sonnet-4.5', 'gpt-5.2-codex', 'claude-sonnet-4', 'gpt-5.2'],
premium: ['claude-opus-4.6', 'claude-opus-4.6-fast', 'claude-opus-4.5', 'claude-sonnet-4.6'],
standard: ['claude-sonnet-4.6', 'gpt-5.4', 'claude-sonnet-4.5', 'gpt-5.3-codex', 'claude-sonnet-4', 'gpt-5.2'],
fast: ['claude-haiku-4.5', 'gpt-5.1-codex-mini', 'gpt-4.1', 'gpt-5-mini']
};

Expand Down
6 changes: 3 additions & 3 deletions packages/squad-sdk/src/runtime/benchmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export class BenchmarkSuite {
// Simulate config parsing: build and validate a config-like object
const config = {
version: '1.0.0',
models: { defaultModel: 'claude-sonnet-4.5', defaultTier: 'standard', fallbackChains: { premium: [], standard: [], fast: [] } },
models: { defaultModel: 'claude-sonnet-4.6', defaultTier: 'standard', fallbackChains: { premium: [], standard: [], fast: [] } },
routing: { rules: [{ workType: 'feature-dev', agents: ['@coordinator'] }] },
};
JSON.parse(JSON.stringify(config));
Expand Down Expand Up @@ -263,8 +263,8 @@ export class BenchmarkSuite {
private modelSelectionOp(): void {
// Simulate model selection logic
const tiers = {
premium: ['claude-opus-4.6', 'gpt-5.2'],
standard: ['claude-sonnet-4.5', 'gpt-5.1-codex'],
premium: ['claude-opus-4.6', 'gpt-5.4'],
standard: ['claude-sonnet-4.6', 'gpt-5.3-codex'],
fast: ['claude-haiku-4.5', 'gpt-5-mini'],
};
const role = 'developer';
Expand Down
8 changes: 5 additions & 3 deletions packages/squad-sdk/src/runtime/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

export const MODELS = {
/** Default model for config files and new projects (env-overridable) */
DEFAULT: process.env['SQUAD_DEFAULT_MODEL'] ?? 'claude-sonnet-4.5',
DEFAULT: process.env['SQUAD_DEFAULT_MODEL'] ?? 'claude-sonnet-4.6',

/** Default model for model-selector Layer 4 — cost-first */
SELECTOR_DEFAULT: 'claude-haiku-4.5',
Expand All @@ -25,11 +25,13 @@ export const MODELS = {
'claude-opus-4.6',
'claude-opus-4.6-fast',
'claude-opus-4.5',
'claude-sonnet-4.5',
'claude-sonnet-4.6',
],
standard: [
'claude-sonnet-4.6',
'gpt-5.4',
'claude-sonnet-4.5',
'gpt-5.2-codex',
'gpt-5.3-codex',
'claude-sonnet-4',
'gpt-5.2',
],
Expand Down
18 changes: 10 additions & 8 deletions test/agents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ describe('Per-Agent Model Selection (M1-9)', () => {

expect(result.source).not.toBe('charter');
expect(result.source).toBe('task-auto');
expect(result.model).toBe('claude-sonnet-4.5');
expect(result.model).toBe('claude-sonnet-4.6');
});

it('should prefer user override over charter', () => {
Expand All @@ -233,7 +233,7 @@ describe('Per-Agent Model Selection (M1-9)', () => {

const result = resolveModel(options);

expect(result.model).toBe('claude-sonnet-4.5');
expect(result.model).toBe('claude-sonnet-4.6');
expect(result.tier).toBe('standard');
expect(result.source).toBe('task-auto');
});
Expand All @@ -245,7 +245,7 @@ describe('Per-Agent Model Selection (M1-9)', () => {

const result = resolveModel(options);

expect(result.model).toBe('claude-sonnet-4.5');
expect(result.model).toBe('claude-sonnet-4.6');
expect(result.tier).toBe('standard');
expect(result.source).toBe('task-auto');
});
Expand All @@ -257,7 +257,7 @@ describe('Per-Agent Model Selection (M1-9)', () => {

const result = resolveModel(options);

expect(result.model).toBe('claude-opus-4.5');
expect(result.model).toBe('claude-opus-4.6');
expect(result.tier).toBe('premium');
expect(result.source).toBe('task-auto');
});
Expand Down Expand Up @@ -328,7 +328,7 @@ describe('Per-Agent Model Selection (M1-9)', () => {
'claude-opus-4.6',
'claude-opus-4.6-fast',
'claude-opus-4.5',
'claude-sonnet-4.5',
'claude-sonnet-4.6',
]);
});

Expand All @@ -340,8 +340,10 @@ describe('Per-Agent Model Selection (M1-9)', () => {
const result = resolveModel(options);

expect(result.fallbackChain).toEqual([
'claude-sonnet-4.6',
'gpt-5.4',
'claude-sonnet-4.5',
'gpt-5.2-codex',
'gpt-5.3-codex',
'claude-sonnet-4',
'gpt-5.2',
]);
Expand Down Expand Up @@ -418,7 +420,7 @@ describe('Per-Agent Model Selection (M1-9)', () => {
const result = resolveModel(options);

expect(result.source).toBe('task-auto');
expect(result.model).toBe('claude-sonnet-4.5');
expect(result.model).toBe('claude-sonnet-4.6');
});

it('should include agentRole in context without affecting resolution', () => {
Expand All @@ -429,7 +431,7 @@ describe('Per-Agent Model Selection (M1-9)', () => {

const result = resolveModel(options);

expect(result.model).toBe('claude-sonnet-4.5');
expect(result.model).toBe('claude-sonnet-4.6');
expect(result.source).toBe('task-auto');
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/compat-v041.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ describe('Compat v0.4.1: Config Path Equivalence', () => {

it('DEFAULT_CONFIG has expected shape', () => {
expect(DEFAULT_CONFIG.version).toBe('1.0.0');
expect(DEFAULT_CONFIG.models.defaultModel).toBe('claude-sonnet-4.5');
expect(DEFAULT_CONFIG.models.defaultModel).toBe('claude-sonnet-4.6');
expect(DEFAULT_CONFIG.models.defaultTier).toBe('standard');
expect(DEFAULT_CONFIG.routing.rules.length).toBeGreaterThanOrEqual(1);
expect(DEFAULT_CONFIG.casting?.allowlistUniverses).toBeDefined();
Expand Down Expand Up @@ -475,7 +475,7 @@ describe('Compat v0.4.1: Model Catalog', () => {
});

it('standard fallback chain starts with sonnet', () => {
expect(DEFAULT_FALLBACK_CHAINS.standard[0]).toBe('claude-sonnet-4.5');
expect(DEFAULT_FALLBACK_CHAINS.standard[0]).toBe('claude-sonnet-4.6');
});

it('fast fallback chain starts with haiku', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe('Configuration Loader', () => {
describe('DEFAULT_CONFIG', () => {
it('should have valid structure', () => {
expect(DEFAULT_CONFIG.version).toBe('1.0.0');
expect(DEFAULT_CONFIG.models.defaultModel).toBe('claude-sonnet-4.5');
expect(DEFAULT_CONFIG.models.defaultModel).toBe('claude-sonnet-4.6');
expect(DEFAULT_CONFIG.models.defaultTier).toBe('standard');
expect(DEFAULT_CONFIG.models.fallbackChains.premium).toBeInstanceOf(Array);
expect(DEFAULT_CONFIG.models.fallbackChains.standard).toBeInstanceOf(Array);
Expand Down
2 changes: 1 addition & 1 deletion test/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('Squad Initialization', () => {
const configContent = await readFile(result.configPath, 'utf-8');
const parsed = JSON.parse(configContent);
expect(parsed.version).toBe('1.0.0');
expect(parsed.models.defaultModel).toBe('claude-sonnet-4.5');
expect(parsed.models.defaultModel).toBe('claude-sonnet-4.6');
expect(parsed.routing.rules).toHaveLength(4);
});

Expand Down
2 changes: 1 addition & 1 deletion test/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('DEFAULT_FALLBACK_CHAINS', () => {
});

it('starts standard chain with sonnet', () => {
expect(DEFAULT_FALLBACK_CHAINS.standard[0]).toBe('claude-sonnet-4.5');
expect(DEFAULT_FALLBACK_CHAINS.standard[0]).toBe('claude-sonnet-4.6');
});

it('starts fast chain with haiku', () => {
Expand Down
Loading