---
name: openstack-harness
description: Capability adapter every routed open-stack skill reads before spawning subagents. Maps roles to models via ~/.config/open-stack/models.md, gives per-harness spawn recipes (Claude Code, Codex CLI, OpenCode), and defines the panel degradation tiers when a harness cannot run multi-vendor review panels.
---

# open-stack harness adapter

open-stack skills describe work in terms of **roles** (bug-fix, judgment and prose, interrogate reviewers, ...) and **capabilities** (spawn a subagent, run it in the background, pick its model). This skill is the single place where roles and capabilities resolve to what your harness can actually do. Routed skills (`stack-mode`, `how`, `why`, `arena`, `swarm`, `architect`, `interrogate`, `reflect`) tell you to read this file; do that once per session and apply it everywhere.

## 1. Detect your harness

You already know which harness you are: Claude Code (Agent tool, `CLAUDE.md`), Codex CLI (`codex`, `AGENTS.md`, `~/.codex/`), or OpenCode (Task tool with `provider/model` agents, `opencode.json`). If genuinely ambiguous, check which config paths exist. Everything below is keyed on that answer. On any other harness, use the row that most closely matches its capabilities, or fall back to Tier 3 panels and inline execution.

## 2. Resolve roles to models

Read `~/.config/open-stack/models.md` if it exists. It is sectioned by harness (`## claude-code`, `## codex`, `## opencode`); use only your section. One line per role: `role: model` (or a comma list for panel roles — one subagent per entry). A missing file, missing section, or missing role line means: use the degradation defaults in §4 below. The aliases `inherit` and `auto` mean "run this role on the parent chat model" — omit the model parameter when spawning.

Never invent a model slug. If a configured slug is rejected when you spawn, use the closest available equivalent (prefer the highest-reasoning tier of the same family), continue the work, and tell the user their config needs updating. Do not block on it.

## 3. Capability table

| Capability | Claude Code | Codex CLI | OpenCode |
|---|---|---|---|
| Spawn subagent | `Agent` tool, `subagent_type: "stack-agent"` (or `general-purpose`) | subagent threads; delegate to the `stack_agent` custom agent | `Task` tool / `@stack-agent` mention |
| Per-subagent model | Anthropic models only (aliases like `sonnet`/`opus`/`haiku`, or full ids) | OpenAI-family models only | any configured `provider/model` — full multi-vendor |
| Background / parallel | `run_in_background: true` on Agent calls; parallel calls in one message | subagent threads run concurrently; inspect with `/agent` | parallel Task calls |
| Multi-vendor panel | NO → Tier 2 | NO → Tier 2 | YES → Tier 1 |
| Read-only subagent | omit Edit/Write in the agent's tools, or use a read-only subagent type | sandbox_mode = "read-only" on the agent TOML | permission: {edit: deny} in agent frontmatter |
| Session transcripts | `~/.claude/projects/<project-slug>/*.jsonl` | `~/.codex/sessions/YYYY/MM/DD/*.jsonl` (date-nested; layout is community-documented, not official — prefer the `OPEN_STACK_TRANSCRIPTS` override when in doubt) | `~/.local/share/opencode/project/<project-slug>/storage/` (global sessions under `project/global/storage/`) |
| Always-on rules file | `~/.claude/CLAUDE.md` (supports `@path` imports) | `~/.codex/AGENTS.md` | `AGENTS.md` + `opencode.json` `instructions` |
| Project-local skills dir | `.claude/skills/` | `.agents/skills/` | `.opencode/skills/` (also reads `.claude/skills/`, `.agents/skills/`) |

When a skill says "spawn X in the background", use the background mechanism above; if your session has it disabled, run foreground and sequentially — never skip the step.

On Claude Code **plugin** installs, skills and agents are namespaced `open-stack:<name>` (e.g. `/open-stack:stack-mode`, `subagent_type: "open-stack:stack-agent"`). Bare names apply to hand-placed installs and other harnesses.

## 4. Panel tiers (review/critique fan-outs)

open-stack's core trick is multi-model review panels: several reviewers whose *models* differ, so their blind spots differ. Run every panel at the **highest tier your harness supports**:

**Tier 1 — multi-vendor panel (OpenCode).** Spawn N parallel reviewers, one per entry in the configured panel list, each on a different vendor's model. This is the original behavior, preserved.

**Tier 2 — multi-perspective single-vendor panel (Claude Code, Codex CLI).** Same N-way parallel fan-out, but diversity comes from two levers instead of vendors: (a) distinct model tiers within your vendor (e.g. opus / sonnet / haiku, or high / medium reasoning effort), and (b) a **mandatory distinct persona per reviewer** so prompts do not converge:

- **Correctness sicko** — hunts logic errors, race conditions, unhandled states; assumes the code is wrong until proven otherwise.
- **Simplicity zealot** — hunts unnecessary abstraction, dead flexibility, code that should be deleted.
- **Operational pessimist** — hunts failure at 3am: bad logs, silent retries, migrations that strand data, rollback hazards.
- **API archaeologist** — hunts contract breaks: callers, versioning, serialized shapes, docs that now lie.

Assign one persona per reviewer (cycle if N > 4). Panel defaults when no config exists: Claude Code → `opus, sonnet, haiku, opus`; Codex → three lanes of your strongest model at descending reasoning effort.

**Tier 3 — sequential inline panel (no subagents available).** Run at most 3 persona passes yourself, sequentially, in the main thread. Each pass re-reads the artifact fresh and must not reference earlier passes' findings; merge findings only in a final step. Slower and weaker — say so in your summary.

Non-panel single-subagent roles (bug-fix, feature, explorer, synthesizer) degrade simply: use the configured model if your harness can, else the strongest model you can spawn, else do the work inline.

## 5. Writing state the next session can find

Skills that persist config or generated skills need per-harness target paths:

| Artifact | Claude Code | Codex CLI | OpenCode |
|---|---|---|---|
| Generated project skill (verification skills, `<name>-mode`) | `.claude/skills/<name>/SKILL.md` | `.agents/skills/<name>/SKILL.md` | `.opencode/skills/<name>/SKILL.md` |
| Personal (user-wide) skill | `~/.claude/skills/` | `~/.agents/skills/` | `~/.config/opencode/skills/` |
| Model config | `~/.config/open-stack/models.md` (all harnesses, same file) | same | same |

Scripts that need transcripts read the `OPEN_STACK_TRANSCRIPTS` environment variable first, then fall back to the per-harness transcript path in §3.

The `disable-model-invocation` frontmatter key is honored by Claude Code only. On Codex and OpenCode, treat any skill whose description says "use only on explicit request" as if that key were set: apply it only when the user invokes it by name.
