/eng:codebase-audit [phase] [path]from Engineering Skills
Manually invoked. Broad repo-health triage that routes to the deep audits and covers the hygiene no other audit owns — tech debt, dead code, TypeScript strictness and the options TypeScript 6 deprecates, error handling, tests (boundary-only mocks, determinism, no skipped or flaky tests), CI hygiene, branch protection, releases and deploys, and git hygiene. Verifies each finding and writes a prioritized report with an overall health score.
Ships in Engineering Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Run this only when the user asks for it by name. It writes a report and changes no code; fixing a finding is a separate request.
A manually-invoked, red-team codebase audit of an app or a specific diff/PR. It is self-contained — every check is spelled out inline, so it runs a full review with zero other skills installed — and each finding is verified against the real code before it lands in a phase-aware, scored report at _reports/codebase-audit.md.
Self-contained — this checklist is comprehensive on its own and needs no other skill installed. Where the house skills
typescript,testing,naminganddevopsare installed, they are the fix target for what this finds.
Before applying this skill, read the project's root AGENTS.md, the AGENTS.md closest to the files in question, and any doc they link for this skill's topic. Names, values and choices — budgets, tiers, tokens, voice, paths — come from those files, never from this skill.
[phase] — development | production; sets the action-item tiers. Omitted → the audit phase the project's AGENTS.md records, else production (assume the app is live until told otherwise).[path] — a file, directory, or PR/diff to scope the audit to; omitted → the whole repo.Mindset — reviewer/attacker first. Don't assume code is fine because it looks careful; find the sequence that breaks it. Report only findings you can justify as real, each verified before it lands.
AGENTS.md; else production, so a CRITICAL finding gets Fix-Now urgency instead of a pre-launch discount._reports/codebase-audit.md exists, read it, but still run every check against the source. Use it only to keep the ID of each finding still present (status UNRESOLVED), carry its WON'T FIX findings forward unchanged — never re-raised as new findings — drop its FIXED findings and any no longer present, continue ID numbering from its highest ID, and take its scores for the score-change row. First run → mark all NEW.file:line evidence.AGENTS.md or a doc it links._reports/codebase-audit.md — overwriting the whole file, so no resolved history accumulates — and post the chat summary (see Output). Recommend fixes in the report; never modify code. Never commit or push without explicit approval.Findings are ordered worst-first in the report.
Write to _reports/codebase-audit.md in the format in references/report-format.md: the header line, the score change with its one Overall row, the findings table with its status legend and one section per finding, the scorecard, "Deep audits to run next" and phase-tiered action items.
Every run produces two things:
_reports/codebase-audit.md, in the format above, overwriting the prior run.<X>/10 (with Δ vs last run), a severity count (Critical / High / Medium / Low, i.e. C / H / M / L), the top findings worst-first (id · severity · one-line · file:line), and the report path. Note any "needs confirmation" items.Report-only — this audit recommends fixes in the report; it never modifies code.
This map keeps codebase-audit shallow: when the sweep surfaces a smell in a domain another audit owns, don't investigate it here — record a one-line signal in the report's "Deep audits to run next" table. The handoff is not a hard dependency. For each row:
X-audit") and leave the depth to it.| Smell you spot | If installed, hand off to | Otherwise flag for manual review |
|---|---|---|
| XSS sink, weak/missing Content Security Policy (CSP), secret in bundle, injection, Server-Side Request Forgery (SSRF), fail-open catch | security-audit | Focused security review |
| Route/action with no role check, "logged-in ≠ authorized", IDOR, tenant leak | access-control-audit | Focused authorization review |
| Route handler missing Zod validation, rate limit, pagination, typed errors, response builder | api-audit | Focused API-layer review |
| Dependency drift, unused/duplicate deps, stale lockfile, known vulnerability, unpinned actions, no scanners | dependency-audit | Focused dependency review |
Missing .env.example, unvalidated env at boot, NEXT_PUBLIC_ misuse, a committed env file or secret | env-audit | Focused env/secrets review |
| Missing labels/alt/focus, poor contrast, keyboard traps, ARIA misuse | accessibility-audit | Focused accessibility review |
| Waterfalls, missing code-split, oversized bundle, unoptimised images | performance-audit | Focused performance review |
| N+1 reads, unbounded queries, missing indexes, counter drift | firestore-audit | Focused data-access review |
| Redis keys without TTL or builder, unstated failure direction | redis-audit | Focused Redis review |
| Generic/library-default UI, inconsistent tokens | frontend-audit | Focused frontend/UI review |
| Naming, structure or routing drift; duplicated helpers; oversized files; magic values | conventions-audit | Focused conventions review |
| Missing page metadata, no sitemap or robots, absent structured data, AI crawlers blocked | seo-aeo-geo-audit | Focused search-visibility review |
| Components without stories, stories without keyboard or axe checks | storybook-audit | Focused Storybook review |
This is what codebase-audit investigates itself, and it stands alone: every check states its criterion inline, so the sweep runs in full even with no other skill installed. Standards references (→ skill) are optional pointers to the fuller rule, not prerequisites. Keep it broad and generic; anything domain-specific routes above.
TODO / FIXME / HACK / XXX / @deprecated markers; flag old or business-critical ones — a FIXME on an auth or payment path is HIGH, a stray TODO is LOW.conventions-audit's — route them.TODO on transitional code names what ends it; one with no end state is debt with no owner._ is unused on purpose and not a finding (→ naming; the lint rule is devops').return/throw, conditions that can't be true, disabled feature paths, dead feature flags never toggled on.strict (and its family — noImplicitAny, strictNullChecks, noUncheckedIndexedAccess where the house uses it) is on in tsconfig; flag strict: false or the family disabled (→ typescript).baseUrl, moduleResolution node/node10/classic, esModuleInterop or allowSyntheticDefaultImports set to false, target: "es5", downlevelIteration, outFile, module amd/umd/system/none, alwaysStrict: false, and the syntax: module Foo {} namespaces, import asserts, /// <reference no-default-lib> — plus ignoreDeprecations hiding them. A workspace that reads globals (process) lists them in types, now [] by default..js on relative imports); a package that emits sets rootDir: "./src" beside outDir; noUncheckedSideEffectImports isn't switched off. A dist/ package emits declaration and declarationMap with isolatedDeclarations, puts types first in its exports, and aliases with #/* subpath imports rather than paths.strictTypeChecked with projectService; a Next.js app checks with next typegen && tsc --noEmit; exported functions annotate their return types; type over interface except for merging or implements.enum, value namespace, parameter properties or import = where erasableSyntaxOnly is the standard; type-only imports marked under verbatimModuleSyntax. A package built to dist/ emits declarations.any (explicit or implicit on params/returns), no unsafe as casts (especially as unknown as, as any), no non-null ! used to paper over nullability, no @ts-ignore / @ts-expect-error silencing real errors.process.env is env-audit's).catch {} that only console.logs and continues on a critical path.no-floating-promises) catches these where it's on.catch (error) treats the error as unknown and narrows before use.Criteria from testing:
Request; shared generic helpers have type tests (*.test-d.ts).next/navigation, next/headers, next/cache, server-only, fetch, timers, a hosted Redis client — and a project function only when it does I/O itself (the project's client module, swapped for an in-memory fake). A spec that mocks the project's own schemas, utilities or hooks, or a pure dependency, tests the stub.server-only; a mocked module a dependency imports is inlined (test.server.deps.inline); manual mocks are typed Mock<typeof fn>; fixtures and fakes live in src/testing/, and one two workspaces use moves to the shared testing package; node and jsdom run as separate projects, with every test file in exactly one.Math.random; tests pass in shuffled order..skip, .only, xit, a deleted or loosened assertion) and no unit or integration retries hiding a flaky test — a flaky test is fixed, never quarantined. No empty or assertion-free tests.Criteria from devops (action SHAs, scanners and advisories are dependency-audit's):
eslint --max-warnings 0); no-console allows only info, warn, error and debug; hooks are husky with lint-staged formatting staged files and commitlint on the message — nothing slow in pre-commit.permissions: {} and each job grants only what it uses; checkouts that don't push set persist-credentials: false.${{ github.event.* }} text inside a run: (passed through env: instead), and no pull_request_target or workflow_run workflow that checks out or runs PR code.timeout-minutes, and every workflow a concurrency group that cancels superseded runs.proseWrap: "preserve" and ESLint loads eslint-config-prettier; flat configs come from one shared preset package, each workspace re-exporting one preset; turbo/no-undeclared-env-vars is on.Criteria from devops. Repository settings are read with gh api where it's available (repos/{owner}/{repo}/rulesets, rules/branches/{branch}); what can't be read is "needs confirmation", never a guess.
HIGH.main publishes a release and tag through release-drafter, with a labelling workflow mapping commit types to labels and marking promotion PRs so the notes skip them; changesets only where a package is published to a registry.HIGH — and gates on a post-deploy health check.dist/, build/, .next/, coverage, node_modules/) tracked — verify with git ls-files before flagging. Committed secrets and .env* files are env-audit's — route them..gitignore covers build output, dependency folders and OS and editor files.console.log, debugger, print, verbose dumps) in shipped/non-test code.<<<<<<<, =======, >>>>>>>) left in tracked files.Fixing is a separate request, after the report is written, and covers only the findings the owner chose. Then update the report in place — never re-run the audit to update it: a re-run re-checks the whole codebase, costs a full audit and raises new findings mid-fix. Mark each fixed finding FIXED with its commit and a one-line note of what changed, mark a finding the owner rules out WON'T FIX with their reason, and leave everything else as it stands. Recompute the scorecard categories the fixes touched and the Overall, and rewrite the one score-change row (previous → current) — never add a second row.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub timonwa/engineering-skills --plugin eng20 skills in this plugin
/agents-mdWrites or updates a project's AGENTS.md and the short AGENTS.md notes in each app and package — what an agent can't work out from the code: commands, structure, conventions that differ from the defaults, workflow, recorded deviations from the house standards and hard constraints, under 200 lines. Use when starting a project, setting up AGENTS.md or CLAUDE.md, or bringing a project's agent instructions up to date./audit-allManually invoked. Runs the house audit suite across the eng, fe and be sets — detects what the repo has, runs every installed audit that applies (codebase, conventions, dependencies, env, security, accessibility, frontend, performance, SEO/AEO/GEO, Storybook, content, API, access control, Firestore, Redis), and rolls their reports into one health report with an overall score and cross-cutting priorities. Each audit still writes its own report./Other plugins' skills for the same job