agentleFS
velonxvelonx/agent-skills/skills/codebase-audit/SKILL.md

codebase-audit

Skill1 starsChanged 48 days agoMITView on GitHub

Audit a whole codebase across five dimensions — code quality, security, efficiency, accessibility and testing — and return a scored report with prioritised, file-referenced findings and a fix plan. Use when the user asks to audit, health-check or assess a repository or project, asks "how good is this codebase", wants a pre-launch, handover or due-diligence review, or wants to know what to fix first. For reviewing a single diff or pull request, use a code-review skill instead.

28 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use cloud-api-recipe-authoring, codebuddy-ide-mcp-upgrade and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • TencentCloudBaseSkill

    cloud-api-recipe-authoring

    Author or revise a cloud-api-operations recipe (config/source/skills/cloud-api-operations/references/recipes/). Encodes why the long tail of control-plane capabilities is deliberately NOT wrapped as MCP/CLI tools, the API-first admission test for whether a capability deserves a recipe, the negative and positive lists, the fixed recipe structure, the writing rules distilled from writing-for-agents, the user-facing copy red lines, and the product regeneration/verification pipeline. Also routes contributors (and their agents) to the contribution flow and the pre-PR self-test protocol in references/contributing.md. Use when adding a recipe, judging whether a scenario belongs in the recipe set, updating the recipes index, re-checking existing recipes against the admission test, or onboarding someone who wants to submit one.

    Also in 3 projects that use this

  • TencentCloudBaseSkill

    codebuddy-ide-mcp-upgrade

    升级 CodeBuddy IDE(genie 扩展)内置的 CloudBase MCP,以及 MCP 发版时同步 IDE 侧白名单。当用户提到「更新 IDE 里的 MCP」「内置 MCP 版本太老」「IDE 集成的 CloudBase 功能不足」「改工具白名单 toolWhiteList」「把新 bundle 打进 CodeBuddy」「白名单漂移」「MCP 发版要同步什么」时使用。覆盖:解包定位内置 bundle 与内嵌配置、重新构建 mcp bundle、生成新的工具白名单与系统提示词、安全注入 IDE 并备份、用 MCP 协议验证工具清单、人工端到端验收、一键回滚。

    Also in 3 projects that use this

  • frostneySkill

    native-nostalgia-stack

    Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.

    Also in 3 projects that use this

  • frostneySkill

    software-engineering-excellence

    Applies the user's engineering standards during substantial technical work: preserve scope, use current evidence, delegate independent parts, and complete authorized outcomes. Use during substantial implementation, debugging, refactoring, or multi-part delivery work.

    Also in 3 projects that use this

  • withpiperSkill

    roadmap-review

    Audit roadmap health — issues, dependency order, spec coverage, doc freshness. Use when speccing a new initiative. Use when /phase-plan output looks suspicious. Use before /roadmap-create reruns.

    Also in 3 projects that use this

  • zaxbysauceSkill

    pr-review-fix

    Codex adapter for addressing pull request review feedback in opencode-swarm. Use when the user asks to fix PR review comments, requested changes, reviewer findings, CI-review notes, or a pasted review summary with low false-positive tolerance.

    Also in 3 projects that use this

  • +6 more from TencentCloudBase

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 28 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before a launch, a handover, an acquisition or open-sourcing.

    line 26
  2. Distinctive:

    When the user names any of the five dimensions for a whole project ("security audit of this app", "is our test coverage OK?").

    line 27
  3. Very specific:

    Do not use for a single diff or PR (use code-review), for fixing issues (audit first, fix only when asked), or for penetration testing of …

    line 29
  4. Distinctive:

    Read-only by default: Do not modify, reformat or commit code during the audit.

    line 35
  5. Distinctive:

    No new installs or external uploads without asking: Run linters, type-checkers, tests and scanners the project already declares.

    line 36
  6. Very specific:

    Never print secrets: If you find one, report its file and line with the value redacted (sk_live_), and recommend rotation.

    line 38
  7. Very specific:

    Evidence or it didn't happen: Every finding cites path:line (or a command and its output).

    line 39
  8. Distinctive:

    Run what the project already has and record command, exit status and a summary of output:

    line 50
  9. Distinctive:

    If something fails to run, that is a finding (testing or quality), not a reason to stop.

    line 56
  10. Distinctive:

    Use the format in examples/audit-report.md:

    line 74

“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codebase Audit

Overview

A repeatable, evidence-based audit of an entire repository. The agent maps the project, runs the tools the project already has, reads the code that matters most, and scores five dimensions — code quality, security, efficiency, accessibility and testing — then delivers a report that says what is wrong, where, why it matters, and what to fix first.

When to Use

  • "Audit my codebase / repo / project", "do a health check", "how good is this code?", "what should we fix first?"
  • Before a launch, a handover, an acquisition or open-sourcing; when inheriting an unfamiliar project.
  • When the user names any of the five dimensions for a whole project ("security audit of this app", "is our test coverage OK?").

Do not use for a single diff or PR (use code-review), for fixing issues (audit first, fix only when asked), or for penetration testing of live systems.

Usage

Hard rules:

  • Read-only by default. Do not modify, reformat or commit code during the audit. Fix only when the user asks, after the report.
  • No new installs or external uploads without asking. Run linters, type-checkers, tests and scanners the project already declares. Ask before installing tools or running anything that sends code or dependency data to a third-party service.
  • Never run destructive or production-touching commands (migrations, deploys, seed scripts against real databases, scripts that send email or payments).
  • Never print secrets. If you find one, report its file and line with the value redacted (sk_live_****), and recommend rotation.
  • Evidence or it didn't happen. Every finding cites path:line (or a command and its output). Mark anything unverified as suspected.

1. Scope and map

  1. Confirm scope: whole repo or specific packages; which dimensions (default: all five); depth (quick ≈ top issues only, standard, deep).
  2. Map the project: languages, frameworks, entry points, package manifests, build/test/lint config, CI workflows, deployment files. Use git ls-files, manifest files and the README.
  3. Get size and hotspots: lines of code by language, largest files, most-changed files (git log --format= --name-only | sort | uniq -c | sort -rn | head -20). Hotspots — large and frequently changed — get the deepest reading.
  4. Note what does not apply (e.g. accessibility for a backend-only library) and say so in the report rather than scoring it.

2. Run existing tooling

Run what the project already has and record command, exit status and a summary of output:

  • Lint / format check, type-check, build.
  • Tests, with coverage if configured.
  • Dependency audit using the ecosystem's own tool (npm audit, pip-audit, cargo audit, govulncheck, bundle audit…) — ask first if it is not installed or needs network access the user hasn't approved.

If something fails to run, that is a finding (testing or quality), not a reason to stop.

3. Audit each dimension

Work through the checklists in reference/checklists.md, reading code rather than guessing from file names. Focus order: entry points and request handlers → auth and data access → hotspots → shared utilities → UI.

  1. Code quality — structure, duplication, complexity, naming, error handling, dead code, typing, consistency, documentation, dependency health.
  2. Security — injection, authn/authz, secrets, input validation, unsafe deserialisation, SSRF, path traversal, crypto, dependency CVEs, security headers, logging of sensitive data. Use OWASP Top 10 as the frame.
  3. Efficiency — N+1 queries, missing indexes or pagination, work in loops, blocking I/O on hot paths, memory growth, bundle size, caching, unnecessary re-renders.
  4. Accessibility (if there is a UI) — semantic HTML, labels, keyboard access, focus, contrast, alt text, ARIA misuse, reduced motion. Target WCAG 2.2 AA.
  5. Testing — does the suite run and pass, what is covered, are critical paths and failure cases tested, test quality (assertions, flakiness, mocking), CI enforcement.

4. Score

Score each applicable dimension 0–10 using the rubric in reference/scoring.md. The overall score is the average of applicable dimensions, but cap the overall at 4 if any critical security finding is open. Always show the evidence behind each score.

5. Report

Use the format in examples/audit-report.md:

  1. Summary — one-line verdict, overall score, scorecard table, top 5 actions by impact ÷ effort.
  2. Findings by dimension, each as: [severity] path/to/file.ext:line — problem → impact (concrete scenario) → fix (effort: S/M/L) Severity: critical, high, medium, low. Group repeated issues into one finding with a count and representative locations.
  3. Strengths — what is done well (keep it short and specific).
  4. Fix plan — Now (criticals, this week), Next (highs, this sprint), Later (the rest).
  5. Method and limits — commands run, what was not checked and why.

Save the report as AUDIT.md (or the name the user wants) only if the user asks for a file; otherwise reply inline. After the report, offer to fix the Now items.

Examples

Prompt: "Audit this repo before we launch next week."

The agent confirms all five dimensions at standard depth, maps a Next.js + Postgres app, runs npm run lint, npm test -- --coverage and npm audit, reads the API routes and auth middleware first, and finds a SQL query built with string concatenation, an admin route without a role check, an N+1 query on the dashboard and unlabelled form inputs. It returns a 5.1/10 report capped at 4 for the open critical, with a Now / Next / Later plan.

Prompt: "Just check security and testing on the payments package."

The agent narrows scope, skips the other three dimensions (marked not assessed), and reports only those two scores.

See examples/audit-report.md for a full report.

Limitations

  • Static reading plus the project's own tools; it does not replace a penetration test, load test or manual screen-reader testing.
  • Large repositories are sampled: hotspots and critical paths get full reads, the rest is spot-checked — the report says which.
  • Scores are a structured judgement, comparable over time for the same project, not across unrelated projects.
  • Cannot see production configuration, infrastructure or runtime data unless it is in the repository.

Changelog

  • 1.0.0 — Initial release: five-dimension audit, scoring rubric, severity-ranked findings, fix plan.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.