From wp-labs-standards
Audit an entire repository (not a diff) across three lenses — over-engineering, correctness, and security — producing a confidence-scored report in change-review's format, with file:line on every finding so a later fix pass can act. Report-only — never edits or commits. Fans out one agent per module/slice and synthesizes. Trigger when the user asks to audit the whole codebase, review the entire repo, find bloat/bugs/vulns across all code, or otherwise review the tree rather than a diff/PR.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wp-labs-standards:codebase-audit [path] [--effort low|medium|high|max][path] [--effort low|medium|high|max]opusThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Whole-repo counterpart to `change-review`. Where `change-review` reviews a changeset, this audits
Whole-repo counterpart to change-review. Where change-review reviews a changeset, this audits
the entire tree across three lenses in one pass. Report-only — it never edits, fixes, or
commits. Every finding carries file:line so a later /code-review --fix, change-review --fix,
or manual pass can act on it.
Built-in /code-review and /security-review are change-scoped (they operate on the branch
diff), so this skill does NOT call them — it reuses their lenses and finding format, applied by
fan-out agents over slices of the repo. /ponytail-audit is the exception: it is already
whole-repo scoped, so the over-engineering lens is delegated to it rather than reimplemented
inline, and its findings are folded into the Over-engineering section.
path — audit only that subtree (default: repo root).--effort low|medium|high|max — depth of each slice agent's review. Defaults to the reviewer's
own default tier.List in-scope files with git ls-files (respects .gitignore); if a path is given, scope to
it. Exclude mechanical/generated content: lockfiles (package-lock.json, yarn.lock,
poetry.lock, Cargo.lock), build output (dist/, build/, *.min.*), vendored dirs
(node_modules/, vendor/), and generated files (snapshots, codegen, *.generated.*).
Count files and total lines in scope, then print an approximate cost estimate before the fan-out, e.g.:
Auditing 214 files (~38k lines) across ~12 slices → ~12 agents. Full-repo pass, may be token-intensive. Proceeding.
There is no size cap — full coverage — so the estimate is the guardrail. For a very large tree, say so plainly so the user can interrupt.
Group in-scope files into size-bounded slices, one per coherent module/directory:
Run /ponytail-audit once over the in-scope tree (forward the path argument when given; it is
report-only and takes no effort flag). It self-slices the whole repo, so do not also fan out
over-engineering per slice. Map each of its ranked findings (<tag> <what to cut>. <replacement>. [path]) into the common finding shape below with category: over-engineering, and keep its
net: -<N> lines, -<M> deps line for the section footer.
Dispatch one Agent per slice (batch to a sane concurrency — don't launch hundreds at once). Give each agent the slice's file list and instruct it to apply both lenses below in a single read and return findings as JSON.
Correctness (/code-review lens): real defects with a concrete failure scenario
(null/undefined, off-by-one, wrong error handling, race, resource leak), plus reuse/efficiency
issues.
Security (vuln taxonomy): injection (SQL/command/template), SSRF, path traversal,
insecure deserialization, missing authn/authz, secrets in code, unsafe crypto. /security-review
is change-scoped, so this taxonomy is the lens.
Each finding: { file, line, category (over-engineering|correctness|security), severity (high|med|low), confidence (0-100), summary, detail, suggestion }.
Same scale as change-review:
Report all findings; do not drop by score.
Collect the correctness/security findings from the slice agents plus the over-engineering findings
from /ponytail-audit. Dedup issues that span slice boundaries (same root cause reported twice).
Rank: security and correctness by severity × confidence; over-engineering biggest-cut first.
Assign every finding a unique, stable ID by lens, numbered in report order: OE-1, OE-2, …
(over-engineering), CO-1, … (correctness), SE-1, … (security). The ID is how a finding is
referenced in the Verdict and by any later fix pass (change-review --fix, /code-review --fix),
so keep it stable and never reuse a number within one report. Produce the report below.
## Codebase audit — <path or repo>, <N> files / ~<L> lines, <S> slices
### Over-engineering
- **OE-1** <file:line> — <tag> <what to cut> → <replacement> (confidence N) (or: Lean already)
_net: -<N> lines / -<M> deps possible_
### Correctness
- **CO-1** [HIGH/MED/LOW] <file:line> — <bug + failure scenario> → <fix> (confidence N) (or: No obvious defects)
### Security
- **SE-1** [HIGH/MED/LOW] <file:line> — <vuln> → <remediation> (confidence N) (or: No issues found)
### Verdict
**Must fix:**
- <finding ID + one-line, high-severity/high-confidence, ordered> (or: None)
**Worth doing:**
- <finding ID + one-line, med/low items> (or: None)
<one line: overall health + the single highest-value action (by ID)>
Every finding leads with its ID (§6) so the Verdict and any later fix pass can reference it.
Report-only. Do not edit, fix, or commit — the file:line anchors are the seam for a separate fix
pass.
change-review and the deep passes: see
../change-review/review-skills-map.md (§ "Whole-repo vs diff").npx claudepluginhub cssherry-wp/wp-labs-starter --plugin wp-labs-standardsCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.