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
Invokes Apple's macOS 27 fm command-line tool from a local Mac to use the on-device system model or Private Cloud Compute, including instructions, image prompts, schema-constrained JSON, and noninteractive automation. Use when the user asks to run Apple Foundation Models through fm, compare system versus pcc, generate structured output, or automate fm without Swift or an app.
development
Compile historical Codex sessions into governed counterfactual evidence, evaluate an existing owner-applied candidate through blinded paired HCTP trials, and fold observable evidence into RUN, OBSERVE, or STOP. Use for `$hylo`, CRF extraction, counterfactual replay, source-governed direct or historical trials, sealed evidence, paired baseline/candidate evaluation, causal frontiers, or evidence-governed improvement.
testing
Ensure a `ledger` command is available on PATH; materialize, validate, record, replay, and project requested Actuating artifacts without taking semantic or execution authority; coordinate the shared Learnings/Synesthesia/Negative Ledger lifecycle checkpoint and repo-local source-memory reconciliation; address Universalist plans and receipts; and perform pure artifact validation.
testing
Classify and quotient review findings, failing tests, incidents, bug reports, migration failures, and other witnessed falsifiers against accepted intent and the current Construction. Author counterexample-set/v1 without selecting repairs, counting review credit, or granting mutation.