codex-loop

Runs a bounded Codex CLI review-and-fix loop on Elixir/Phoenix diffs until findings are clean.

537|38|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill codex-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codex-loop
Source: https://github.com/oliver-kriska/claude-elixir-phoenix/tree/main/plugins/elixir-phoenix/skills/codex-loop
Command: npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill codex-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Before opening a pull request, Elixir/Phoenix developers often want an external, cross-model code review to catch issues their own analysis missed. Manually invoking the Codex CLI, parsing its findings, fixing approved items, verifying with compile and tests, and re-reviewing is repetitive and error-prone, especially with quota costs per review round.

Core Features & Use Cases

  • Bounded critic-refiner loop: Runs Codex CLI review, triages findings by priority (P0-P3), applies approved fixes, verifies with mix compile --warnings-as-errors and tests, then re-reviews until clean or max rounds (default 3) are reached.
  • Flexible diff modes: Review against a base branch, uncommitted changes (staged, unstaged, untracked), or auto-detected default branch state.
  • Iron Law enforcement: Declines Codex suggestions that violate project Iron Laws, never commits or pushes, and reports every finding as fixed, declined, or deferred.
  • Use Case: After implementing a Phoenix feature, run the loop with --auto to auto-approve P0/P1/P2 fixes, get a clean external review verdict, and then open your PR with confidence.

Quick Start

Ask the assistant to run the codex-loop skill on your current branch diff so Codex reviews the changes and approved findings get fixed until the review comes back clean.

Frequently Asked Questions about codex-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a Codex CLI review on my Elixir code before a PR?

Invoke the codex-loop skill with a diff mode such as --base main or --uncommitted. It runs codex exec review, parses the findings, applies approved fixes, verifies with mix compile and tests, and re-reviews until clean or the round limit is reached.

How do I review uncommitted changes with Codex CLI?

Pass the --uncommitted flag so the review covers staged, unstaged, and untracked changes. Without flags, the skill auto-detects the mode: commits ahead of the default branch use --base, otherwise it falls back to --uncommitted.

What happens if the codex CLI is not installed?

The skill stops at preflight with an install hint (brew install codex or npm i -g @openai/codex, then codex login) and suggests the codex-free /phx:review alternative. It never crashes or continues without the CLI.

Why does codex review exit with code 0 even when it finds issues?

The Codex CLI returns exit code 0 even when findings exist, so the skill parses the output file for - [P{n}] bullets instead of checking the exit code. No priority bullets in the output means the review is clean.

Can I pass custom review instructions together with --base or --uncommitted?

No, the Codex CLI rejects custom prompts combined with diff-mode flags. Review priorities are steered through the AGENTS.md Review guidelines section, which the /phx:init command can install.

What are the limitations of the codex-loop review workflow?

Rounds are bounded by --max-rounds (default 3) because each round consumes codex quota, and the loop stops with a blocker report if verification fails three times. It never commits or pushes, leaving all git operations to the user.