From claudex
Turn an approved spec into a merged-ready PR with Codex doing the writing. Claude conducts; Codex writes the plan and the implementation; a Codex reviewer and a Claude reviewer independently attack each artifact; a fresh Codex agent reconciles them into one verdict (go / fix-go / fix-review). Use when the user runs /claudex:build, or asks to build/implement an existing spec with Codex as the builder and an adversarial review loop.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claudex:buildThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are the **conductor**. **Codex does the writing** — both the implementation
You are the conductor. Codex does the writing — both the implementation plan and the real implementation. You sequence the phases, integrate parallel outputs, resolve conflicts, and decide verdict handling. You never hand-write the plan or the implementation yourself; you dispatch that to Codex and review its work.
Invoke this after a spec exists (e.g. from /claudex:think). The spec is an
input. The terminal state is an opened PR — never a direct push to
main.
docs/superpowers/specs/, or the user points you at one).codex-companion runtime + /codex:status//codex:result//codex:cancel) and superpowers.If Codex isn't available, see Tool failure below — core steps (builder, reconciler) hard-stop and ask the user; only a redundant review leg degrades.
EnterWorktree, or the using-git-worktrees
skill / git worktree fallback). Do all work there.COMPANION=$(ls -t ~/.claude/plugins/cache/openai-codex/codex/*/scripts/codex-companion.mjs 2>/dev/null | head -1)
| Need | Mechanism | Mode |
|---|---|---|
| Build / fix (write the plan or implementation, or apply fixes) | node "$COMPANION" task --write --background "<builder prompt>" — run yourself, from the conductor session, inside the worktree | write-capable, tracked |
| Codex adversarial review of an implementation diff | node "$COMPANION" adversarial-review --wait --scope working-tree "<focus>" | read-only |
| Codex review of a plan doc (no diff yet) | node "$COMPANION" task --fresh --effort <e> "<adversarial plan-review prompt>" | read-only (no --write) |
| Reconcile two reviews → one verdict | node "$COMPANION" task --fresh --effort <e> "<reconcile prompt>" | read-only (no --write) |
Dispatch the builder yourself — do not route it through the codex:rescue
subagent. The companion buckets its job store by git rev-parse --show-toplevel
and filters /codex:status to the current CODEX_COMPANION_SESSION_ID. The
codex:rescue subagent (and the /codex:rescue command, which only wraps that
subagent) runs the companion from a different cwd and session, so the job
lands in another bucket and never appears in your /codex:status. Calling
node "$COMPANION" task ... directly from the conductor session keeps the job in
this worktree's bucket under this session — so it is trackable. --background
returns a job id immediately; poll it with /codex:status <job-id> (or
--wait), pull output with /codex:result <job-id>, and stop it with
/codex:cancel <job-id>.
Tracking caveat —
/codex:statusis worktree-scoped. Because jobs are bucketed by worktree toplevel,/codex:statusonly lists jobs created in the same worktree it is run from. Run it (and surface job ids to the user) from the build worktree. From elsewhere, query by explicit job id.
For parallel builders, fire several task --write --background calls in one
batch — each prints its own job id; track them with /codex:status <job-id>
(see dispatching-parallel-agents essence).
Routing fixes back to the builder — do not trust --resume. --resume
resolves to --resume-last (the latest tracked Codex thread), not a named
builder. After parallel builders, a review, or a reconcile, the latest thread is
almost certainly the wrong one. So:
--resume for fixes in a single-builder phase with no intervening
Codex task (no parallel builders, no Codex-side review/reconcile in between).--resume-last after parallel
builders.Phase 0 — Spec readiness gate
Phase 1 — Plan ── unified verdict loop, target = plan doc
Phase 2 — Build ── unified verdict loop, target = implementation diff
Phase 3 — Integrate → branch + PR (human merge gate)
Run one Codex read-only review of the spec for actionability only —
scope, ambiguity, acceptance criteria, risks, missing constraints. (It is not a
redesign.) Use a task prompt that asks Codex to list blocking gaps that would
stop a plan from being written.
The same control flow runs for the plan (Phase 1) and the build (Phase 2).
Step 1 — BUILD (Codex writes the artifact).
writing-plans — staged tasks, acceptance criteria,
test strategy). Save under docs/superpowers/plans/.task --write
builders for genuinely independent units (you integrate the outputs and resolve
conflicts); a single builder for tightly-coupled work — shared files,
migrations, fragile test suites. No parallelism for coupled work.Step 2 — DUAL ADVERSARIAL REVIEW (independent, in parallel).
adversarial-review on the diff (build phase) or a read-only
task plan-review (plan phase)./code-review skill on the diff.Step 3 — RECONCILE (a fresh Codex agent → one verdict).
Hand both reviews (verbatim) to a new read-only Codex task. Ask it to
dedupe/weigh them and return exactly one verdict:
| Verdict | Meaning | Action |
|---|---|---|
| go | no fixes needed | phase complete |
| fix-go | low-risk/mechanical fixes only | original builder applies fixes; then a post-fix check (see below); phase complete |
| fix-review | consequential fixes | original builder applies fixes; loop back to Step 2 on the fixed artifact |
Report the reconciler's verdict + rationale back in the main session before acting.
fix-go post-fix check. After the builder applies a fix-go, inspect the
resulting diff/scope. If the change turns out non-mechanical (touches logic,
interfaces, behavior, or new files beyond the stated fix), upgrade it to
fix-review — re-review it and count it against the loop guard. fix-go only
ends a phase when its fixes were genuinely mechanical.
Step 4 — LOOP GUARD.
Count fix-review verdicts (including upgraded fix-gos and Phase 3 red-test
returns, below) per phase. The first triggers one re-review. If a re-review
returns fix-review again (the second attempt), STOP and ask the user —
do not loop further. A material scope change at any point also pauses for the
user.
fix-review attempt under the
Phase 2 loop guard — a second one stops and asks the user rather than looping
forever.main directly.failClosed.go from a failed reconcile.failClosed: true in ~/.claude/claudex/config.json turns even the
single-leg degrade into a halt.~/.claude/claudex/config.json — effort, failClosed,
timeoutMs.This skill is model-driven — there is no hook forcing the loop. The verdict
loop is the control structure; follow it as written. (Contrast /claudex:think,
which is hook-enforced.)
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub willinvest/claudex --plugin claudex