codex-verify
Skill1 starsChanged 6 months agoMITView on GitHub
Use OpenAI Codex CLI (GPT-5.5) to verify and review code written by Claude. Invoke this skill whenever you want a second opinion on code quality, need to cross-check for bugs or security issues, or want an independent model to validate your work. Use it after writing or modifying code, before committing changes, or when the user asks to verify, validate, review, double-check, or cross-validate code. Also triggers on phrases like "let codex check this", "run codex verification", "verify with gpt", "codex review", "second opinion on this code", "review this diff", "check for SOLID violations", "find security bugs", "audit code architecture", "identify dead code".
- Installs packages
In this repository2 other files it gives its agents.
- multi-agentSkill
- skill-reviewerSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 108
All verification runs go through scripts/codex-run.sh, which handles CLI flags, prompt selection, focus modifier, and timeout internally.
- Distinctive: line 158
Use this template when summarizing findings:
- Very specific: line 203
Not in git repo → script adds --skip-git-repo-check automatically
- Distinctive: line 219
Only load reference files relevant to the current findings — progressive loading, not all at once.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
What this skill does
Calls Codex CLI (GPT-5.5) to independently verify code that Claude has written, with four verification phases:
- Defects — bugs, security vulnerabilities (OWASP top 10), race conditions, logic errors, edge cases
- Quality — architecture (SOLID), readability, maintainability, performance, testability — rated 1-5
- Architecture — deep SOLID principle analysis (SRP, OCP, LSP, ISP, DIP) + code smell identification
- Removal — unused, redundant, obsolete, and dead code identification with safe deletion plans
Results come back into Claude's context so you can act on them — but only after user approval.
Parameters
| Param | Default | Description |
scope | diff | What code to verify: diff (uncommitted changes), branch (compare against base), file (target specific files) |
phase | both | Which verification to run: defects, quality, architecture, removal, or both (defects + quality) |
--focus | all | Limit review depth: solid (SOLID focus), security (OWASP/race conditions), quality (readability/maintainability), all |
--base | — | Base branch name (required for branch scope) |
--lang | auto | Output language — auto-detected from conversation, or specify zh-CN, ja, ko, etc. |
--custom | — | Add user-specified criteria to any scope (modifier, not standalone) |
Phase shortcut: both runs defects + quality only (the most common combo). For full coverage across all 4 phases, run each phase separately or request defects → quality → architecture → removal.
Terminology
- scope (diff/branch/file): what code to verify — always specifies a concrete review target
- phase (defects/quality/architecture/removal): which verification dimension to run
- --custom: a modifier that adds user-specified criteria to any scope, not a standalone scope
- --focus: narrows defects/quality prompts to a specific domain without changing the phase
Workflow Checklist
- Determine verification scope ⛔ BLOCKING — ask the user if scope is unclear
- Parse user arguments for
scope,phase,focus,base,files,custom,lang - Ask yourself: Has the user named specific files? → file scope
- Ask yourself: Did the user mention a branch comparison? → branch scope
- Ask yourself: Are there uncommitted git changes and no explicit scope? → diff scope (default)
- Ask yourself: Did the user give a custom instruction like "check for memory leaks"? → use appropriate scope +
--custommodifier — never use custom as a standalone scope - Ask yourself: Did the user ask specifically about SOLID/architecture? → phase=architecture, focus=solid
- Ask yourself: Did the user ask specifically about security? → phase=defects, focus=security
- Ask yourself: Did the user ask to find dead/unused code? → phase=removal
- If still unclear, ask the user before proceeding ⛔
- Parse user arguments for
- Determine output language — detect from user's conversation language
- User explicitly specifies → use that value
- Not specified → detect from conversation (Chinese →
--lang zh-CN, Japanese →--lang ja, Korean →--lang ko) - English conversation → omit
--lang(Codex defaults to English)
- Generate output paths per phase — only create temp files for phases that will actually run
# Example for phase=both: DEFECTS_OUT=$(mktemp) && QUALITY_OUT=$(mktemp) # Example for phase=architecture: ARCH_OUT=$(mktemp) # Example for full coverage: DEFECTS_OUT=$(mktemp) && QUALITY_OUT=$(mktemp) && ARCH_OUT=$(mktemp) && REMOVAL_OUT=$(mktemp) - Phase 1: Defect Detection (conditional: skip if phase=quality/architecture/removal)
- Run:
scripts/codex-run.sh defects <scope> "$DEFECTS_OUT" [--focus ...] [--custom ...] - Read output from
$DEFECTS_OUT - If output is empty or errors occurred → try fallback (see Error handling)
- Run:
- Phase 2: Quality Assessment (conditional: skip if phase=defects/architecture/removal)
- Run:
scripts/codex-run.sh quality <scope> "$QUALITY_OUT" [--focus ...] [--custom ...] - Read output from
$QUALITY_OUT - If output is empty → same fallback strategy
- Run:
- Phase 3: Architecture (SOLID) (conditional: skip if phase=defects/quality/removal)
- Run:
scripts/codex-run.sh architecture <scope> "$ARCH_OUT" - Read output from
$ARCH_OUT - If output is empty → same fallback strategy
- Run:
- Phase 4: Removal Candidates (conditional: skip if phase=defects/quality/architecture)
- Run:
scripts/codex-run.sh removal <scope> "$REMOVAL_OUT" - Read output from
$REMOVAL_OUT - If output is empty → same fallback strategy
- Run:
- Claude supplementary analysis (conditional: load reference files for deeper insight)
- Ask yourself: Did Codex find SOLID violations? → Load
references/solid-checklist.mdfor deeper refactor heuristics - Ask yourself: Did Codex find security issues? → Load
references/security-checklist.mdfor detailed OWASP/race condition patterns - Ask yourself: Did Codex flag quality issues? → Load
references/code-quality-checklist.mdfor error handling/performance/boundary patterns - Ask yourself: Did Codex find removal candidates? → Load
references/removal-plan.mdfor safe deletion templates - Only load reference files relevant to the findings — not all at once
- Ask yourself: Did Codex find SOLID violations? → Load
- Pre-delivery check ⛔ BLOCKING — verify output quality before presenting
- All changed files from scope were actually covered by the verification
- Each finding has severity level and follows definitions (critical/high/medium/low)
- Each finding has file:line reference and suggested fix
- Removal section is included if candidates were found (safe-now vs deferred)
- Critical defects have exploitability + impact assessment
- Quality ratings include specific improvement suggestions for dimensions below 4
- Present findings to user ⛔ BLOCKING — always show results before acting
- Ask user what to fix ⛔ BLOCKING — never auto-fix, even critical defects. Codex can be wrong.
- Apply only user-approved fixes
- Re-verify if user requests it (conditional)
Severity Definitions
| Severity | Meaning | Action |
| critical | Security vulnerability, data loss risk, correctness bug | Must fix immediately |
| high | Logic error, significant SOLID violation, performance regression | Should fix before merge |
| medium | Code smell, maintainability concern, minor SOLID violation | Fix or create follow-up |
| low | Style, naming, minor suggestion | Optional improvement |
Scope Commands
All verification runs go through scripts/codex-run.sh, which handles CLI flags, prompt selection, focus modifier, and timeout internally.
Scope invocation
| Scope | Script invocation | Required args |
| diff | scripts/codex-run.sh <phase> diff "$OUT" | none (reviews uncommitted changes) |
| branch | scripts/codex-run.sh <phase> branch "$OUT" --base "$BRANCH" | --base with quoted branch name |
| file | scripts/codex-run.sh <phase> file "$OUT" file1.ts file2.ts | file paths as positional args |
Phase invocation
| Phase | What it reviews | Default scope |
| defects | Bugs, security, race conditions, edge cases | diff |
| quality | SOLID, readability, maintainability, performance, testability (rated 1-5) | diff |
| architecture | Deep SOLID (SRP/OCP/LSP/ISP/DIP) + code smells | diff |
| removal | Unused, redundant, obsolete, dead code | diff |
| both | defects + quality (not all 4 phases) | diff |
Modifiers work with any scope:
# Focus on security
scripts/codex-run.sh defects diff "$DEFECTS_OUT" --focus security
# Focus on SOLID
scripts/codex-run.sh quality file "$QUALITY_OUT" src/auth.ts --focus solid
# Custom criteria
scripts/codex-run.sh defects file "$DEFECTS_OUT" src/auth.ts --custom "focus on memory leaks"
# Language
scripts/codex-run.sh defects file "$DEFECTS_OUT" src/auth.ts --lang zh-CN
# Architecture phase
scripts/codex-run.sh architecture diff "$ARCH_OUT"
# Removal phase
scripts/codex-run.sh removal branch "$REMOVAL_OUT" --base mainDry-run preview:
scripts/codex-run.sh architecture file "$ARCH_OUT" src/auth.ts --dry-runPresenting results to the user
Language rule: Present results in the same language the user is using in the current conversation. Technical identifiers (file paths, function names, variable names) stay in their original form, but all prose must match the user's language.
Use this template when summarizing findings:
## Codex Verification Results
### Phase 1: Defect Detection
| Severity | Location | Description |
|----------|----------|-------------|
| critical | file:line | ... |
| high | file:line | ... |
| medium | file:line | ... |
| low | file:line | ... |
Defects found: X (critical: Y, high: Z)
### Phase 2: Quality Assessment
| Dimension | Rating (1-5) | Notes |
|-----------|--------------|-------|
| Architecture | ... | ... |
| Readability | ... | ... |
| Maintainability | ... | ... |
| Performance | ... | ... |
| Testability | ... | ... |
Overall quality: X/5
### Phase 3: Architecture (SOLID)
| Principle | Severity | Location | Violation | Refactor suggestion |
|-----------|----------|----------|-----------|---------------------|
| ... | ... | ... | ... | ... |
### Phase 4: Removal Candidates
| Category | Priority | Location | Action |
|----------|----------|----------|--------|
| unused | safe-now | file:line | delete + remove tests |
| obsolete | deferred | file:line | needs migration plan |
### Recommended Actions
[List suggested fixes, marked by user approval status]Error handling
codexnot found → tell user to install:npm install -g @openai/codex- Auth error → suggest
codex loginor check~/.codex/config.toml - Not in git repo → script adds
--skip-git-repo-checkautomatically - Codex nonzero exit → script prints error code and fallback guidance
- Empty output → script prints warning and tries JSONL fallback
- Timeout → script auto-detects
timeout/gtimeout; Bash timeout serves as outer safety net
References
| File | Purpose | When to load |
references/solid-checklist.md | SOLID smell prompts + refactor heuristics | When Codex finds SOLID violations or architecture issues |
references/security-checklist.md | OWASP, race conditions, crypto, supply chain | When Codex finds security vulnerabilities |
references/code-quality-checklist.md | Error handling, performance, boundary conditions | When Codex flags quality issues |
references/removal-plan.md | Safe vs deferred deletion templates | When Codex finds removal candidates |
references/codex-cmds.md | Codex CLI options and fallback strategies | When debugging Codex CLI invocation issues |
references/prompts.md | Prompt templates mirror (read-only reference) | When customizing prompts via --custom |
Only load reference files relevant to the current findings — progressive loading, not all at once.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

