config/claude/skills/codex-loop/SKILL.md
Iteratively review and refine a plan file OR a PR/branch diff using OpenAI Codex CLI until no blocking issues remain. Use when the user says "/codex-loop" (with or without an argument) or asks to loop Codex review. Auto-detects plan-loop vs PR-loop mode from the argument and conversation context. Each round, Codex reviews as lead architect, Claude addresses blockers, then re-submits — until Codex signals ready or max iterations hit.
npx skillsauth add cryptofish7/dotfiles codex-loopInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run Codex as a lead-architect reviewer in a convergence loop: Codex flags blockers, Claude fixes them, repeat until the target is approved or the loop stops.
Two modes:
/codex-loop # infer target from context (plan file OR current branch diff)
/codex-loop <filepath.md> # plan-loop on a specific plan file
/codex-loop <PR#> # PR-loop by number (e.g. /codex-loop 123 or /codex-loop #123)
/codex-loop pr # PR-loop on the current branch vs main
.md file → plan mode#<num>, pr, or pr <num> → PR modemain → PR mode on the branch diff.Never invent a target. Never run the loop against a file or branch you just created for this purpose.
Stop the loop when any of these are true:
APPROVED, or the only remaining BLOCKER: items are ones you've deliberately dismissed with reasoning.On any stop condition other than #1, surface the reason to the user and ask whether to continue manually.
Each round, regardless of mode:
cat <<'PROMPT' | codex exec -
<prompt body>
PROMPT
BLOCKER: items. Ignore SUGGESTION: and NIT: in the loop (but keep them for the final summary).If no filepath is given and no plan is in conversation context, find one in this order — stop at the first match:
plan.md, PLAN.md, plans/*.md, docs/plan*.md, .plans/*.md in the cwd. If exactly one match, use it. If multiple, ask.plans/ or docs/plans/: offer the newest as the likely target.CLAUDE.md if present.Edit the plan file to fix each accepted BLOCKER. Don't rewrite structure, don't address suggestions/nits. Don't edit code — plan mode refines the plan, not the implementation.
You are the LEAD ARCHITECT of this project, reviewing an implementation plan before work begins. You own the technical direction and have veto authority over what ships.
Your job: find issues that will cause the implementation to fail, waste time, or produce the wrong thing. Be direct. Assume the author is a competent engineer who wants real feedback, not reassurance.
## The Plan
<INSERT PLAN CONTENTS>
## Codebase Context
<INSERT RELEVANT FILE CONTENTS AND CLAUDE.MD CONVENTIONS>
## Prior Review History (for context — do not re-raise resolved or dismissed issues)
<INSERT SHORT SUMMARY OF PRIOR ROUNDS' BLOCKERS (resolved) AND DISMISSED BLOCKERS WITH THE AUTHOR'S RATIONALE, OR "none — this is round 1">
If you still believe a dismissed blocker matters, say so once with a stronger argument — don't re-raise it verbatim.
## Review Dimensions
1. **Missing steps** — migrations, config, deps, build, rollback
2. **Wrong assumptions** — files/functions/APIs that don't exist or behave differently
3. **Ordering** — steps that depend on later steps
4. **Side effects** — tests, types, schemas, env vars, docs, callers
5. **Integration** — interface mismatches, missing wiring
6. **Edge cases** — failure modes the plan ignores
7. **Scope** — too much in one pass, or missing work that blocks completion
8. **Verification** — how will we know it worked?
9. **Architectural fit** — does this match the project's existing patterns and conventions? Would you, as lead architect, approve this direction?
## Severity tags (REQUIRED)
- `BLOCKER:` — the plan will fail, produce wrong behavior, or violate architectural standards if this isn't fixed.
- `SUGGESTION:` — the plan works as-is, but there's a clearly better approach.
- `NIT:` — minor polish; safe to ignore.
If you can't decide between BLOCKER and SUGGESTION, it's a SUGGESTION.
## Output Format
Line 1 — verdict, exactly one of:
- `APPROVED`
- `CHANGES REQUIRED`
Then, grouped by severity:
BLOCKER: <one-line summary> Where: <file/section of plan> Problem: <what's wrong> Fix: <concrete change to make>
SUGGESTION: ... NIT: ...
Skip any severity with zero items. Do not pad with "this looks fine." If the plan is ready, output `APPROVED` on line 1 and stop.
/codex-loop 123 or /codex-loop #123):
gh pr view <#> --json title,body,baseRefName,headRefName
gh pr diff <#>
If the PR is on a remote branch that isn't checked out locally, stop and ask the user to check it out first — you'll need to edit files between rounds./codex-loop pr or inferred: use the current branch against its base.
git log --oneline main..HEAD
git diff main...HEAD
If the base isn't main, detect via gh pr view --json baseRefName or ask.CLAUDE.md if present.Edit the working tree to fix each accepted BLOCKER. Commit each round's fixes as a separate commit on the current branch with a message like fix: address codex-loop round N blockers. This keeps the loop auditable and lets the user revert a round if they disagree with your fixes. Do not force-push or amend prior commits.
Don't act on SUGGESTIONs or NITs in the loop. Don't refactor beyond what blockers require.
You are the LEAD ARCHITECT of this project, reviewing a pull request before it merges. You own the technical direction and have veto authority over what ships.
Your job: find issues that will cause bugs, regressions, security problems, or merge of wrong behavior. Be direct. Assume the author is a competent engineer who wants real feedback, not reassurance.
## PR Description
<INSERT PR TITLE AND BODY, OR "Local branch, no PR description" IF NONE>
## Diff (current state — reflects any fixes from prior rounds)
<INSERT CURRENT DIFF>
## Relevant File Contents
<INSERT FULL CONTENTS OF HEAVILY-CHANGED OR CONTEXT-CRITICAL FILES>
## Project Conventions
<INSERT CLAUDE.MD CONTENTS IF PRESENT>
## Prior Review History (for context — do not re-raise resolved or dismissed issues)
<INSERT SHORT SUMMARY OF PRIOR ROUNDS' BLOCKERS (resolved) AND DISMISSED BLOCKERS WITH THE AUTHOR'S RATIONALE, OR "none — this is round 1">
If you still believe a dismissed blocker matters, say so once with a stronger argument — don't re-raise it verbatim.
## Review Dimensions
1. **Correctness / bugs** — logic errors, off-by-one, null handling, wrong operators, race conditions, incorrect async
2. **Regressions** — breaks existing callers, tests, or behavior; removed code that was still in use
3. **Security** — input validation, injection, auth/authz, secrets, unsafe deserialization, SSRF, path traversal
4. **Error handling** — swallowed exceptions, ignored returns, wrong error types, missing cleanup
5. **API / interface correctness** — breaking changes to public APIs, typos, mismatched types across module boundaries
6. **Missing tests** — new behavior without coverage, or tests that don't exercise the change
7. **Performance red flags** — N+1 queries, unbounded loops, sync work in hot paths, O(n²)
8. **Convention violations** — contradicts CLAUDE.md or established patterns in surrounding code
9. **Dead / suspicious code** — unused imports, commented-out blocks, stale TODOs, AI-slop comments
10. **Architectural fit** — does this match the project's direction? Would you, as lead architect, approve merge?
## Severity tags (REQUIRED)
- `BLOCKER:` — merging this causes bugs, regressions, security issues, or violates architectural standards. Must be fixed before merge.
- `SUGGESTION:` — works as-is, but there's a clearly better approach.
- `NIT:` — minor polish; safe to ignore.
If you can't decide between BLOCKER and SUGGESTION, it's a SUGGESTION.
## Output Format
Line 1 — verdict, exactly one of:
- `APPROVED`
- `CHANGES REQUIRED`
Then, grouped by severity:
BLOCKER: <one-line summary> Where: file:line Problem: <what's wrong> Fix: <concrete change to make>
SUGGESTION: ... NIT: ...
Skip any severity with zero items. Do not pad with "this looks fine." If the PR is ready, output `APPROVED` on line 1 and stop.
codex or gh is not installed or a command fails, stop and tell the user.testing
Generate and maintain a local deploy script (scripts/deploy.sh). Discovers project services, deploys them locally, and health-checks each one. Use when the user asks to "smoke test", "deploy locally", "test local deploy", "update deploy script", "run deploy", or "run smoke test".
testing
Audit installed skills and agents for bloat, overlap, and improvement opportunities. Use when the user wants to review, audit, list, or improve their skills and agents. Triggers on "review skills", "audit skills", "list skills", "skill review", "improve skills".
development
Set up the autonomous post-task workflow for a project. Injects the standard development pipeline into AGENTS.md and installs all required skills and agents (docs-consolidator, ci-cd-pipeline, smoke-test, bug-bash-update, code-reviewer, debugger). Use at the start of a new project. Triggers on "setup workflow", "init workflow", "add workflow", or "set up project workflow".
tools
Analyze the current conversation for learnings and persist approved insights. Triggers on "reflect", "retrospective", "session review", "what did we learn", "conversation review".