# Codex Loop

Fix Elixir/Phoenix code until Codex CLI review comes back clean, bounded review, fix...

- Repository: https://github.com/oliver-kriska/claude-elixir-phoenix (572 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add oliver-kriska/claude-elixir-phoenix --skill codex-loop -g -a claude-code -y`
Codex: `npx skills add oliver-kriska/claude-elixir-phoenix --skill codex-loop -g -a codex -y`
Cursor: `npx skills add oliver-kriska/claude-elixir-phoenix --skill codex-loop -g -a cursor -y`
Gemini CLI: `npx skills add oliver-kriska/claude-elixir-phoenix --skill codex-loop -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add oliver-kriska/claude-elixir-phoenix`

## Description

Fix Elixir/Phoenix code until Codex CLI review comes back clean, bounded review, fix, verify loop before opening a PR. Use when codex is installed and you want an external cross-model critic on your changes before pushing.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Codex Loop (fix until clean)

Critic→Refiner loop with the Codex CLI as external critic: review → fix
approved findings → verify → re-review, until codex is clean or rounds run
out. Codex reviews; Claude fixes. Complements `/phx:review` (Claude panel), run either or both before a PR.

## Usage

```
/phx:codex-loop                    # diff vs default branch, interactive
/phx:codex-loop --uncommitted      # staged + unstaged + untracked
/phx:codex-loop --base develop     # explicit base branch
/phx:codex-loop --auto             # auto-approve P0/P1/P2, skip P3
/phx:codex-loop --max-rounds 2     # default 3
```

## Iron Laws

1. **BOUNDED rounds, never exceed --max-rounds (default 3)**, each round
   costs codex quota; report remaining findings instead of looping on
2. **Verify BEFORE re-review**, `mix compile --warnings-as-errors` + tests
   must pass before burning a codex round on broken code
3. **NEVER commit or push**, leave git to the user
4. **Codex findings get Iron Law scrutiny**, decline suggestions that
   violate an Iron Law, with explanation in the round report
5. **Skipped findings are reported, never dropped**, every finding ends as
   fixed, declined (with reason), or deferred-by-user
6. **Missing CLI stops the skill with an install hint**, suggest
   `/phx:review` as the codex-free alternative; never crash

## Workflow

### Step 1: Preflight

Run `command -v codex`. If missing: STOP.
Show the install hint (`brew install codex` or `npm i -g @openai/codex`,
then `codex login`; `codex doctor` to diagnose) and suggest `/phx:review`.

Then two cheap checks that save review rounds:

The rest: https://github.com/oliver-kriska/claude-elixir-phoenix/blob/HEAD/plugins/elixir-phoenix/skills/codex-loop/SKILL.md
