---
name: setup-openstack
description: Configure which models open-stack uses per role. Detects your harness and available models, writes ~/.config/open-stack/models.md, and wires it into your harness's always-on rules. Use for /setup-openstack, "configure open-stack models", or changing open-stack's model choices.
---

# Setup open-stack

Write `~/.config/open-stack/models.md`, the per-role model config every routed skill reads. Skills fall back to the degradation defaults in the `openstack-harness` skill when a line, section, or the file is absent — this is an override layer, not a requirement.

## Steps

### 1. Detect harness and available models

Identify your harness (Claude Code, Codex CLI, or OpenCode) as described in the `openstack-harness` skill. Then enumerate the models this harness can actually give a subagent:

- **Claude Code**: the Agent tool accepts Anthropic models only — the aliases (`fable`, `opus`, `sonnet`, `haiku`) are always safe; full model ids also work.
- **Codex CLI**: OpenAI-family models available to the account; check `~/.codex/config.toml` and the model picker.
- **OpenCode**: any `provider/model` configured in `opencode.json` / connected providers — list them.

If you cannot detect the set, ask the user to paste the model names they have access to. Never write a model you have not confirmed available. The aliases `inherit` and `auto` are always valid (role runs on the parent chat model).

### 2. Load current state

If `~/.config/open-stack/models.md` exists, read it; the section for this harness holds the current choices. Otherwise start from `config/models.example.md` shipped with open-stack (its section for this harness), or from the degradation defaults in `openstack-harness`.

### 3. Map and confirm

Show every role with its current model, marking any model not in the detected set as needing a choice. Ask whether to accept as-is or change specific roles, offering the detected models plus `inherit` and `auto`. Prefer a structured question tool over free text where the harness has one. For panel roles (how critics, arena runners, architect runners, interrogate reviewers) the value is a list, and one subagent runs per entry, alias entries included, so the list length sets the count. `arena cross-judge pool` is also a list, but Arena selects one value from it whose model family differs from the parent's when possible (on single-vendor harnesses, differing tier or effort counts as differing family). `swarm workers` is the default model for every worker unless a race or comparison assigns another model per arm.

On single-vendor harnesses (Claude Code, Codex), remind the user that panels run at Tier 2 — diversity comes from model tiers and reviewer personas, not vendors (see `openstack-harness` §4).

### 4. Validate

Every real model written must be in the detected set; `inherit` and `auto` always pass. If a chosen model is not available, stop and ask again. A config pointing at a model the user cannot use breaks every delegation that reads it.

### 5. Write the config

Overwrite **only this harness's section** of `~/.config/open-stack/models.md` (create the file and directory if missing, keep other harness sections untouched) so re-runs stay idempotent. Shape:

```
# open-stack model configuration. One line per role. Delete a line to fall back to the skill default.
# `inherit` or `auto` as a value: the role runs on the parent chat model. Alias entries in a panel list still count toward its fan-out.

## claude-code
feature, refactoring: sonnet
bug-fix: opus
...

## opencode
feature, refactoring: xai/grok-4.6
...
```

Role labels are the ones stack-mode uses: `feature, refactoring` / `bug-fix` / `perf-issue` / `hillclimb` / `judgment and prose` / `hardest tasks` / `how explorer` / `how explainer` / `how critics` / `why investigators` / `why synthesizer` / `reflect tooling` / `reflect judgment, divergent, synthesizer` / `arena runners` / `arena cross-judge pool` / `swarm workers` / `architect runners` / `interrogate reviewers`.

### 6. Wire the always-on pointer

So skills see the config without being told, add a pointer in the harness's always-on rules (skip if already present):

- **Claude Code**: append `@~/.config/open-stack/models.md` on its own line to `~/.claude/CLAUDE.md`.
- **Codex CLI**: append to `~/.codex/AGENTS.md`: `open-stack model roles are configured in ~/.config/open-stack/models.md — read it before spawning subagents for open-stack skills.`
- **OpenCode**: add the file's absolute path to the `instructions` array in `~/.config/opencode/opencode.json` (create the array if needed).

This wiring is an optimization; skills also read the file directly, so nothing breaks if the user declines.

### 7. Confirm

Tell the user the config was written, which section, and that it applies to new sessions. Re-running this skill updates it. Optionally verify with one cheap spawn: launch a subagent for the `feature, refactoring` role and confirm the model resolves.

### 8. Offer a verification skill (optional)

Check whether the project has a way to drive the real app for proof (a `verify-*` skill, or an existing test harness). If not, offer once: "want a project-local verification skill, so agents can drive the app the way a user does and prove changes work? I can generate one with /create-verification-skill." On yes, invoke `/create-verification-skill` (resolves wherever open-stack is installed — workspace, user, or plugin). On no, move on without pushing.
