| name | claudex-quality-loop |
| description | Run /quality-loop under claudex with quota-aware Claude-spine and Codex-spine profiles. The selected family coordinates and implements while the other family supplies a persistent design advisor and fresh Correctness-vs-Design reviewer. Use for a substantial autonomous system build that needs cross-family scrutiny, explicit session boundaries, and resumable handoffs. |
Claudex Quality Loop
Compose /quality-loop, /atelier, /agent-orchestration, /model-orchestration, and
/quota-axi. /quality-loop owns the Issue, Atelier gates, semantic Chapters, Ledger,
implementation, review semantics, and delivery. This skill chooses which model family owns the
spine and binds the opposite family to the existing advisor and Correctness-review dimensions.
Routing profiles
The profile selects family ownership. The fresh session scope selects lead effort:
| Scope | Claude-spine lead | Codex-spine lead |
|---|
| Design | claude-fable-5, high | gpt-5.6-sol, high |
| Chapter Driver | claude-fable-5, high | gpt-5.6-sol, high |
| System Story | claude-fable-5, high | gpt-5.6-sol, high |
| Delivery | claude-fable-5, low | gpt-5.6-sol, low |
Role bindings are fixed within a profile:
| Role | claude-spine | codex-spine |
|---|
| Bulk implementation and craft — judgment tier | Opus, medium | GPT Sol, medium |
| Bulk implementation and craft — prescribed tier | Sonnet, medium | GPT Sol, medium |
| Chapter scout | Opus | Opus |
| Persistent design advisor | GPT Sol, high | Fable, medium |
| Correctness vs Design | GPT Terra, high | Opus, high |
| Test Adversary | Fable, high | GPT Terra, high |
| Security, when escalated | Opus, high | Fable, high |
The Atelier Builder is always one claude-sonnet-5 agent at medium effort. The profile swaps
ownership; it does not add review calls. Keep expensive opposite-family work bounded. In
particular, Opus reviews a Chapter diff and approved context, never the whole repository.
Start or resume
-
Before every fresh session, run
<skill-dir>/scripts/profile.mjs recommend --scope <design|chapter|story|delivery>. It reads /quota-axi and prints the complete
profile contract. If quota is stale, it refuses to choose. The human may explicitly override
that gate with CLAUDEX_PROFILE=claude-spine|codex-spine.
The repository launcher performs the same selection with
claudex.sh --profile <claude-spine|codex-spine|auto> --scope <scope>.
-
Start claudex with the printed LEAD_MODEL, set the printed LEAD_EFFORT, and keep
CLAUDE_CODE_SUBAGENT_MODEL=inherit so each shipped agent's model binding wins.
-
Invoke /claudex-quality-loop <outcome-or-run-dir>, then run
<quality-loop-dir>/scripts/next.sh [<run-dir>] exactly as /quality-loop requires.
-
Bind the fresh session and then its routing profile before doing scoped work:
QL_SESSION_ID=<launcher-provided-id> <quality-loop-dir>/scripts/ledger.sh session bind \
<expected-scope> <actor> claudex
<quality-loop-dir>/scripts/ledger.sh routing bind \
<profile> "$QL_SESSION_ID" <expected-scope> <actor>
Use the EXPECTED_SCOPE printed by next.sh. The Ledger accepts design, chapter:<id>,
story, or delivery. It rejects changing either the profile or scope while retaining the same
session id. A session already bound in base mode cannot activate claudex; start a fresh
session instead.
-
When next.sh prints SESSION_BOUNDARY=fresh-required, stop the current session. Run its exact
LAUNCH command, invoke its concise RESUME handoff, and bind the new session id and expected
scope. LAUNCH retains the Ledger-pinned profile and chooses effort from EXPECTED_SCOPE.
Design/Atelier, every Chapter, System Story, and delivery are separate session scopes. A completed
Atelier therefore hands durable artifacts and the Run Record to a clean Chapter session rather
than carrying its transcript. A material deviation similarly returns through a fresh design
scope.
Chapter execution slices
Claude Code subagents cannot spawn other subagents. Keep the claudex main session as the Chapter
execution coordinator and have it chain the bounded implementation slices defined by
/quality-loop. Never ask a Chapter implementer to delegate its remaining work.
The coordinator makes /quality-loop's step-2 dispatch choice and journals it. When it authors the
Chapter implementation workflow, it composes both families inside: fresh opposite-family advisor-
and reviewer-pattern consultations placed at the Chapter's unresolved decisions and unverified
claims, resolved through the installed agentType bindings. These in-loop consultations are
advisory, distinct from the persistent design advisor, and never count as board lenses; writers
keep the profile's implementer binding. Workflows run from the main session, so the coordinator
constraint holds. Authoring the workflow is judgment work — the human may explicitly raise the lead
effort for a Chapter session expected to author one.
A subagent cannot escalate to an advisor, so an implementer gets cross-family scrutiny only where
the coordinator stages it: in-loop through the workflow, or up front through the brief. Neither is
free, and the brief is often enough — a Chapter whose hard decisions are already resolved needs a
sound brief, not a consult round. Choose deliberately rather than by default, and record which.
Dispatch every Chapter scout as SCOUT_AGENT pinned to SCOUT_MODEL, and require the
verified/unverified marking /quality-loop defines. Scouts and implementers are the Run's only
un-reviewed inputs: nothing reads a scout's claims before they reach the brief, and nothing reads
the brief before the board. Spend capability on the roles that work unchecked, not only on the
lenses that check them.
BULK_MODEL is the judgment tier and the default; BULK_MODEL_PRESCRIBED is for a Chapter whose
brief is demonstrably complete. /quality-loop step 2 owns the choice and the journal entry. Pin
the selected model explicitly on the implementer, fixer, and craft dispatches — an unpinned agent
resolves to its own frontmatter, which is not the profile's binding and not this Run's decision.
Start a fresh successor before the active implementer reaches its slice cap. Give the successor the
validated checkpoint, Chapter contract, current branch and commit, and remaining bounded outcome.
Do not resume an implementer whose context is near exhaustion: resumption retains its tool history
and recreates the same failure risk. A successor within the same chapter:<id> routing scope does
not require a new claudex session; the Chapter-to-Chapter boundary still does.
Preconditions
Confirm the selected profile's implementer, advisor, correctness reviewer, test adversary,
security reviewer, verifier, and Atelier Builder are installed and resolve to the exact models and
efforts in the contract. If a model fails to resolve, explain that the selected composition is
unavailable. Do not claim that family participated. Offer another explicit profile or the base
/quality-loop; never silently substitute a model.
Persistent design advisor
Start the profile's advisor while preparing the Design Atelier. Give it a distilled system brief,
concept and architecture keys, constraints, decisions, risks, proposed Chapters, and only the
bounded evidence needed to verify its challenges.
Bind its harness id and durable checkpoint with
<quality-loop-dir>/scripts/ledger.sh collaborator bind quality-advisor <agent-id> <checkpoint>.
Advance the checkpoint after every advisor round. A checkpoint identifies the Design revision,
open deviations, and journal position from which a replacement rebuilds bounded context.
Use compact semantic deltas to have the advisor:
- audit the Design and any AFK decision envelope before human sign-off;
- audit every material deviation and proposed resolution;
- challenge Decision Inbox classification, recommendation, and blocked-Chapter coverage;
- audit accumulated decisions and provisional ADRs before the System Story;
- audit the completed semantic trace for architecture drift and unsupported claims.
The advisor never writes files or addresses the human. The active Coordinator owns synthesis and
presents one coherent voice through Atelier. Record material advice and its disposition in the Run
journal. At a session boundary, start a replacement advisor from the durable checkpoint and update
the binding; never claim process persistence.
Cross-family correctness review
The base skill runs a risk-adaptive board. The reviewer owning Correctness vs Design is exactly
the selected profile's fresh correctness reviewer. Its brief includes:
- approved
spec.md and design.md excerpts relevant to the Chapter;
- the Chapter, concept/architecture keys, and applicable project conventions;
- the bounded diff and relevant project rules;
- the forced
/quality-loop finding schema and security-relevant-change flag.
Keep this reviewer fresh for independent judgment. Do not continue it across Chapters or board
rounds, and do not add a duplicate reviewer. Dispatch the profile contract's Test Adversary and,
only when escalated, its Security reviewer. Use a fresh high-effort verifier from the opposite
family of the finding author. The profile's craft agent owns the apply-pass and fixes.
Model and quota boundary
Quota selects a profile only at a fresh session boundary. The Ledger-pinned profile is authoritative
inside that session. Never auto-switch on a stale report, replace a named role, or route wide raw-file
sweeps to a bounded cross-family specialist.