A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Two-pass code audit skill for Claude Code: adversarial Opus deep review + Codex second opinion
A Claude Code skill that runs an adversarial Opus deep review followed by an independent Codex second opinion on recent code changes.
Designed as a pre-commit safety net for vibe-coded features, multi-file bug fixes, and any change where "looks right" isn't good enough. Pass 1 assumes the code is broken until proven otherwise; Pass 2 verifies that a standard review also thinks the final state is clean.
SKILL.md — the skill definition: frontmatter, workflow, and the full Opus agent prompt templateREADME.md — this filemodel: opus (family alias — always resolves to the current Opus release) with effort: xhigh. Both are fixed by design; see Customization.CLAUDE.md documenting invariants — the audit checklist cross-references it.The skill depends on the Codex plugin for Pass 2. Install both, in this order.
This skill uses openai/codex-plugin-cc for /codex:review (Pass 2) and optionally /codex:adversarial-review (security-critical escalation).
Inside Claude Code, run:
/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins
/codex:setup
/codex:setup checks whether Codex is installed and authenticated. If the Codex CLI is missing and npm is available, it offers to install it for you. To install manually:
npm install -g @openai/codex
If Codex is installed but not signed in, run inside Claude Code:
!codex login
After install, verify:
/codex:review and /codex:adversarial-review appear in the slash-command listcodex:codex-rescue appears in /agentsFull plugin docs and troubleshooting: https://github.com/openai/codex-plugin-cc
Clone or download this repository, then copy SKILL.md into your Claude Code skills directory:
mkdir -p ~/.claude/skills/audit
cp SKILL.md ~/.claude/skills/audit/SKILL.md
Start a new Claude Code session in any project and run /audit. Claude will auto-scope to recent changes (uncommitted edits or unpushed commits) or report there's nothing to audit if the repo is clean. Either response confirms the install.
With arguments — scope the audit to specific files or paths:
/audit src/routes/admin.ts src/lib/auth.ts
Without arguments — audits the most recent feature or fix from the current session:
/audit
The skill identifies the change automatically — git diff and git status for uncommitted edits, falling back to git log origin/HEAD..HEAD for unpushed commits if the tree is clean. If multiple unrelated changes are in flight, it asks which one to audit.
Heads-up: Live Verification needs a running dev server. Pass 1, section 8 ("Live verification") calls your endpoints on
http://localhost:*. Start your dev server before running/auditif you want those checks to actually run — otherwise the live tests fail and only the static portion of the audit produces findings.
/audit only runs when invoked manually unless you tell Claude otherwise. To make Claude self-trigger the audit on qualifying changes — without you having to remember — paste the snippet below into your project's CLAUDE.md (or your team's Definition of Done / pre-commit checklist).
The MANDATORY framing and blocker language are intentional. Softer phrasing ("consider running /audit") tends to get skipped under task pressure; the strong wording is what makes the rule actually fire.
**Audit Skill (MANDATORY)** — after completing any of the following, **you MUST run
`/audit`** before committing:
- A new feature that adds a public surface (new endpoint, command, exported function, or UI flow)
- A fix that touches 3+ source files (excluding tests and config), or rewrites more than ~30 lines in a single function
- Any change to authentication, authorization, or access control
- Any change to database schema, migrations, or data persistence
- Refactors that move or rename code across multiple modules
- Public API contract changes (request/response shapes, status codes, error formats)
- Pagination, filtering, sorting, or aggregation logic
- Code that combines results from multiple upstream sources (different services, tables, or APIs)
- Any change to security-sensitive flows (credentials, tokens, webhooks, payments)
**Audit is NOT required for:** docs-only changes, comment-only changes, formatting / linting passes, dependency bumps that don't include accompanying code changes, or revert commits.
The `/audit` skill runs a two-pass code audit: an adversarial Opus deep review followed by a standard Codex second opinion (`/codex:review`). Do NOT skip it — treat audit findings as blockers that must be fixed before the commit. If the audit caps without approval (max 2 Opus passes, max 3 Codex iterations), escalate to the user — do not push past it.
Adapt the trigger list to your project's risk surface — add domain-specific patterns (e.g. "any change to billing logic", "any change to RLS policies", "any change to webhook signature verification") or remove items that don't apply.
Pass 1 — Opus deep audit (adversarial). A general-purpose subagent running on Opus reads the change, runs verification commands (live endpoint calls, type checks, grep sweeps), and produces a structured report covering:
as casts, any, ! assertions)The agent does not edit code — it reads and reports.
Pass 2 — Codex independent review. After Pass 1's findings are fixed, /codex:review runs a standard PR-review-style second opinion on the final state. The two passes serve different purposes:
| Pass 1 (Opus) | Pass 2 (Codex) | |
|---|---|---|
| Lens | Adversarial — assume broken | Standard PR review |
| Output | Structured findings table | verdict: approve / change requests |
| When | On the original change | On the post-fix state |
Adversarial Codex escalation. /codex:adversarial-review replaces the standard Pass 2 only for security-critical changes — auth/crypto enforcement code or when the user explicitly flags the change as security-sensitive. See SKILL.md for the exact triggers; reaching for it by default produces noise and leaves no escalation path when something truly warrants it.
Iteration caps. Opus max 2 passes, Codex max 3 iterations. If either caps without verdict: approve, the skill escalates to the user with a diagnosis instead of looping further. Commit only after Codex returns verdict: approve.
The skill ships configured for a Bun + TypeScript project. Adapt for your stack by editing the allowed-tools line in SKILL.md:
| Stack | Replace Bun flags with |
|---|---|
| npm | Bash(npm test *) Bash(npm run *) Bash(npx tsc *) |
| pnpm | Bash(pnpm test *) Bash(pnpm run *) Bash(pnpm tsc *) |
| Yarn | Bash(yarn test *) Bash(yarn run *) Bash(yarn tsc *) |
| Python | Bash(pytest *) Bash(python -m *) Bash(uv run *) |
| Go | Bash(go test *) Bash(go vet *) Bash(go build *) |
| Rust | Bash(cargo test *) Bash(cargo check *) Bash(cargo clippy *) |
The audit checklist itself is also stack-opinionated. It assumes TypeScript types, HTTP endpoints, and a frontend↔backend split — sections like Type Safety (as casts, ! assertions) and Live Verification (curl to localhost) won't map cleanly to Python data pipelines, Rust CLIs, Go services, or libraries without a web surface. For those stacks, edit the agent prompt template in SKILL.md (between the === BEGIN OPUS AGENT PROMPT === markers) — drop or rewrite the sections that don't fit, add stack-specific checks (e.g., "Pydantic model validation", "trait bounds and lifetimes", "FFI safety", "context cancellation"), tighten the report format, or swap in your team's severity definitions.
Don't tune model: or effort:. This skill is intentionally pinned to the latest Opus on xhigh effort. Audit quality drops sharply on smaller models or lower effort, and the opus alias already auto-tracks new releases, so there's nothing to maintain.
The one frontmatter dial worth tweaking is description: — it controls when Claude auto-suggests the skill. Tighten or loosen the trigger phrasing if it fires too often or not often enough.
Free to use, modify, and share.
A Claude Code skill by Hao (駱君昊) that learns your Facebook voice and auto-posts to FB / IG / Threads / X with a 14-day c
1000+ skills curated from Anthropic, Vercel, Stripe, and other engineering teams
Claude Code skill for YouTube creators — channel audits, video SEO, retention scripts, thumbnails, content strategy, Sho
AI image generation skill for Claude Code -- Creative Director powered by Gemini