codex/skills/codebase-audit/SKILL.md
Run Codex-native domain audits for security, UX/accessibility, performance, API design, copy, and CLI quality. Use for code audits, quality assessment, issue finding, pre-launch review, or explicit parallel Codex subagent audits.
npx skillsauth add tkersey/dotfiles codebase-auditInstall 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.
Audit a local codebase through a named domain lens and return an evidence-backed report. The audit is report-only unless the user explicitly asks for fixes.
Domains:
securityuxperformanceapicopycliThis skill is written for Codex only.
Task, Agent, subagent_type, or tool-call syntax..codex/agents/ or ~/.codex/agents/.../references/specialist-packet-contract.md; reject stale, wrong-scope, wrapper-leaking, acknowledgement-only, or no-evidence packets before synthesis.Resolve these from the user prompt and repository context:
domain: one of the domains above, or a list for a multi-domain sweep.scope: whole repo by default, or user-provided files/directories/features.depth: quick, standard, or deep. Default: standard.subagents: true only when the user explicitly asks for Codex subagents or parallel agents.If the domain is missing, choose the most likely domain from the prompt. For generic "audit this codebase" requests, use security, performance, and api for backend/service repos; use security, ux, and performance for frontend/product repos; use security, cli, and performance for CLI/tooling repos.
Inspect only enough to classify the project and identify audit surfaces:
AGENTS.md, README, docs, route/command entry points, testsPrefer rg, manifest reads, and targeted file inspection over broad exhaustive reads.
Use references/CHECKLISTS.md for domain-specific checks, references/TOOLS.md for commands, and references/EXAMPLES.md for report shape.
For a single-domain audit, go deep on that domain. For a multi-domain sweep, keep findings domain-separated and avoid spending the whole pass on one domain.
Use fast static discovery first:
Then verify each candidate by reading the surrounding source. Do not report a finding unless you can explain the root cause and cite a concrete location. Prefer exact file:line citations. If a line number is unavailable after reasonable effort, cite the smallest path/symbol scope and say so.
Assign severity by user impact and exploitability:
| Severity | Criteria | Examples | |---|---|---| | Critical | Directly exploitable now, data loss, privilege escalation, production outage risk | SQL injection, auth bypass, destructive command path | | High | Serious impact but needs conditions, scale, or uncommon access | missing CSRF on sensitive action, N+1 on hot path, broken pagination on core endpoint | | Medium | Real issue with bounded blast radius | missing validation, confusing flow, vague error that blocks recovery | | Low | Polish, best practice, maintainability, minor UX/copy/API friction | inconsistent naming, missing helper text, noisy CLI output |
Do not inflate severity. Do not count speculative risks as findings; list them under "Needs Verification" instead.
Return this shape for each domain:
# [Domain] Audit Report: [Project or Scope]
## Summary
- **Scope:** [repo/files/features inspected]
- **Mode:** [quick/standard/deep; single-agent or Codex subagents]
- **Total Findings:** N
- **Critical:** X | **High:** Y | **Medium:** Z | **Low:** W
## Critical Findings
### 1. [Finding title]
- **Location:** `path/to/file.ext:line`
- **Severity:** Critical
- **Issue:** [what is wrong]
- **Root Cause:** [why the code allows it]
- **Impact:** [user/security/performance/API/UX impact]
- **Recommended Fix:** [specific change]
- **Verification:** [test, command, repro, or manual check]
## High Findings
[Same format]
## Medium Findings
[Same format, terser]
## Low Findings
[Same format, terser]
## Needs Verification
- [Only plausible risks that need runtime access, credentials, production data, or user confirmation]
## Positive Signals
- [Important things the code is already doing correctly]
For quick multi-domain sweeps, return top 3 findings per domain and keep the total under 100 lines unless the user asks for more.
Use this section only when the user explicitly asks for Codex subagents, parallel agents, or one agent per domain.
security → audit_securityux → audit_uxperformance → audit_performanceapi → audit_apicopy → audit_copycli → audit_cliartifact_state_id, exact domain/scope, and required packet fields from the shared specialist packet contract.Needs Verification.explorer agents with the same domain-specific instructions, or run locally and state which fallback was used.Use this template when spawning a Codex subagent:
Run a read-only [DOMAIN] audit for [SCOPE] using the codebase-audit checklist.
Depth: [quick|standard|deep].
Do not edit files.
Return findings only when backed by concrete source evidence.
For each finding include title, severity, location, issue, root cause, impact, recommended fix, and verification.
Also return Needs Verification and Positive Signals.
End with exactly one specialist packet using ../references/specialist-packet-contract.md fields: artifact_state_id, artifact_state_label, scope, top_material_signals with evidence_ref, unresolved_signals, agreement_pressure, stale, and final_call.
Keep output concise; the parent agent will synthesize the final report.
references/CHECKLISTS.md — domain checklists and grep patternsreferences/TOOLS.md — tool suggestions by domainreferences/EXAMPLES.md — report examplesreferences/CODEX_SUBAGENTS.md — Codex-only subagent prompts and install notes../references/specialist-packet-contract.md — shared specialist packet validation, value receipts, and wait boundstools
Convert markdown plans into beads with dependencies using br CLI. Use when creating task graphs, polishing beads before implementation, or bridging planning to agent swarm execution.
development
Orchestrate Codex skill optimization during active sessions through $cas goal control, $shadow single-session evidence, $tune diagnosis/refinement briefs, and the skill-optimizer custom subagent. Trigger for $opt, skill optimization loops, session-driven skill tuning, meta-skill audits, or explicit validated skill edits. Do not use for general code optimization, product optimization, or performance tuning.
development
Run a targeted fresh-eyes blunder pass over code, specs, plans, adjudications, closure gates, skill edits, or negative-evidence ledgers. Trigger when asked to reread with fresh eyes, find obvious bugs, catch mistakes/oversights/omissions, check for embarrassing misses, or perform a second independent blunder pass before closure. Do not use as a substitute for implementation, adjudication, or verification; use it as the final falsification/check pass for those workflows.
development
Explicitly shadow, tail, watch, follow, monitor, supervise, or companion exactly one Codex session id/path through `$seq`, then apply a named target skill as an interpretation/reporting/proposal/action lens until the watched session stops.