agentleFS
liwuhouliwuhou/skills/codex-verify/SKILL.md

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

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
  1. Very specific:

    All verification runs go through scripts/codex-run.sh, which handles CLI flags, prompt selection, focus modifier, and timeout internally.

    line 108
  2. Distinctive:

    Use this template when summarizing findings:

    line 158
  3. Very specific:

    Not in git repo → script adds --skip-git-repo-check automatically

    line 203
  4. Distinctive:

    Only load reference files relevant to the current findings — progressive loading, not all at once.

    line 219

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

What this skill does

Calls Codex CLI (GPT-5.5) to independently verify code that Claude has written, with four verification phases:

  1. Defects — bugs, security vulnerabilities (OWASP top 10), race conditions, logic errors, edge cases
  2. Quality — architecture (SOLID), readability, maintainability, performance, testability — rated 1-5
  3. Architecture — deep SOLID principle analysis (SRP, OCP, LSP, ISP, DIP) + code smell identification
  4. 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

ParamDefaultDescription
scopediffWhat code to verify: diff (uncommitted changes), branch (compare against base), file (target specific files)
phasebothWhich verification to run: defects, quality, architecture, removal, or both (defects + quality)
--focusallLimit review depth: solid (SOLID focus), security (OWASP/race conditions), quality (readability/maintainability), all
--base—Base branch name (required for branch scope)
--langautoOutput 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 + --custom modifier — 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 ⛔
  • 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)
  • 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
  • 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
  • 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
  • Claude supplementary analysis (conditional: load reference files for deeper insight)
    • Ask yourself: Did Codex find SOLID violations? → Load references/solid-checklist.md for deeper refactor heuristics
    • Ask yourself: Did Codex find security issues? → Load references/security-checklist.md for detailed OWASP/race condition patterns
    • Ask yourself: Did Codex flag quality issues? → Load references/code-quality-checklist.md for error handling/performance/boundary patterns
    • Ask yourself: Did Codex find removal candidates? → Load references/removal-plan.md for safe deletion templates
    • Only load reference files relevant to the findings — not all at once
  • 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

SeverityMeaningAction
criticalSecurity vulnerability, data loss risk, correctness bugMust fix immediately
highLogic error, significant SOLID violation, performance regressionShould fix before merge
mediumCode smell, maintainability concern, minor SOLID violationFix or create follow-up
lowStyle, naming, minor suggestionOptional 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

ScopeScript invocationRequired args
diffscripts/codex-run.sh <phase> diff "$OUT"none (reviews uncommitted changes)
branchscripts/codex-run.sh <phase> branch "$OUT" --base "$BRANCH"--base with quoted branch name
filescripts/codex-run.sh <phase> file "$OUT" file1.ts file2.tsfile paths as positional args

Phase invocation

PhaseWhat it reviewsDefault scope
defectsBugs, security, race conditions, edge casesdiff
qualitySOLID, readability, maintainability, performance, testability (rated 1-5)diff
architectureDeep SOLID (SRP/OCP/LSP/ISP/DIP) + code smellsdiff
removalUnused, redundant, obsolete, dead codediff
bothdefects + 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 main

Dry-run preview:

scripts/codex-run.sh architecture file "$ARCH_OUT" src/auth.ts --dry-run

Presenting 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

  • codex not found → tell user to install: npm install -g @openai/codex
  • Auth error → suggest codex login or check ~/.codex/config.toml
  • Not in git repo → script adds --skip-git-repo-check automatically
  • 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

FilePurposeWhen to load
references/solid-checklist.mdSOLID smell prompts + refactor heuristicsWhen Codex finds SOLID violations or architecture issues
references/security-checklist.mdOWASP, race conditions, crypto, supply chainWhen Codex finds security vulnerabilities
references/code-quality-checklist.mdError handling, performance, boundary conditionsWhen Codex flags quality issues
references/removal-plan.mdSafe vs deferred deletion templatesWhen Codex finds removal candidates
references/codex-cmds.mdCodex CLI options and fallback strategiesWhen debugging Codex CLI invocation issues
references/prompts.mdPrompt 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.