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

codebase-audit

Skill0 starsChanged 9 days agoMITView on GitHub

Performs a comprehensive, read-only audit of an existing codebase and produces a prioritized list of the significant problems that should be fixed before development continues, each with its location, why it matters, and a recommended fix. Covers correctness, reliability, security and privacy, architecture, tests, build and dependencies, diagnosability, performance, and maintainability, and verifies every finding before reporting it. Use when the user asks for a codebase audit, health check, technical review, or readiness assessment of a project, asks what must be fixed before the next stage, release, or feature, or wants a prioritized technical-debt list. Changes no code. Do not use for reviewing a specific diff or pull request, for fixing a known bug, or for architecture-only analysis or restructuring (modular-architecture-refactor covers that).

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

9 rules. 0 are common, 7 are distinctive, and 2 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.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not edit, create, or delete project files.

    line 20
  2. Distinctive:

    Requested scope: If the user named an area (a path, module, or subsystem) or a goal ("before the release", "before adding PDF export"), …

    line 26
  3. Very specific:

    Project instructions: Read AGENTS.md, CLAUDE.md, README, CONTRIBUTING, docs/, ADRs, and agent or editor rule files.

    line 27
  4. Distinctive:

    Run the available tests, linters, type checks, and build.

    line 40
  5. Distinctive:

    Before a problem goes into the report:

    line 60
  6. Distinctive:

    read the surrounding code and trace the calls, to make sure it is not handled elsewhere.

    line 62
  7. Distinctive:

    Leave out style and naming, matters of taste, micro-optimizations, hypothetical problems without a realistic scenario, and "rewrite it in …

    line 66
  8. Very specific:

    Write in the user's language.

    line 81
  9. Distinctive:

    If no significant problems were found, say so.

    line 90

“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

Find the significant problems that remain in a codebase and must be addressed before development continues, then turn them into a prioritized plan of action.

The value of the audit is accuracy and prioritization, not volume. Ten verified, important findings are worth more than fifty mixed remarks.

Analysis only

Change nothing at this stage.

  • Do not edit, create, or delete project files. Do not commit, install or upgrade dependencies, or change configuration.
  • Allowed: reading and searching code, git status/log/diff/blame, and running the project's existing tests, linters, type checkers, and build, as long as they do not modify tracked files. Put any temporary file, such as a probe script, in a temporary directory outside the project.
  • Even an obvious one-line fix goes into the report, not into the code.

Scope and context

  1. Requested scope. If the user named an area (a path, module, or subsystem) or a goal ("before the release", "before adding PDF export"), focus on it and touch the rest only where it affects that area. Otherwise audit the whole project.
  2. Project instructions. Read AGENTS.md, CLAUDE.md, README, CONTRIBUTING, docs/, ADRs, and agent or editor rule files. Their principles and rules are audit criteria: violating a rule the project states is a finding.
  3. The next stage. Work out what will be developed next: from the user's words, recent commits, uncommitted changes, TODOs, issues, or a roadmap. If it is unclear, assess general readiness for further development. Judge each problem's significance relative to that stage.

Workflow

1. Orient

Identify the stack, entry points, module structure and dependency directions, build and packaging, tests, CI, and external integrations (APIs, SDKs, file formats, operating system features, hardware). Use git status and git log to see what changed recently and what is unfinished. Uncommitted changes are in scope; mark findings in them as such.

Match depth to size: a small tool needs a focused pass over its few critical paths, a large system needs a pass per subsystem, starting with the riskiest.

2. Run the baseline checks

Run the available tests, linters, type checks, and build. Record the results: failures and warnings are findings in their own right. If something cannot be run (missing environment, secrets, hardware, or too long), say so in the report rather than assuming it passes.

3. Sweep the dimensions

Spend effort by risk: critical paths and external boundaries thoroughly, auxiliary code briefly. Detailed questions and tool suggestions for each dimension: references/audit-checklist.md.

DimensionWhat to look for
CorrectnessLogic errors, edge cases, wrong error handling, races, resource leaks, inconsistent state
ReliabilityNetwork and timeouts, retries, cancellation of long operations, partial failures, loss or corruption of user data
Security and privacySecrets in code, logs, or history, injection, unsafe deserialization, token and session storage, permissions
ArchitectureHigh coupling, dependency cycles, god objects, UI mixed with logic and I/O, global mutable state, duplicated parallel implementations, violations of the project's own principles
TestsUntested critical paths, tests that assert nothing, flaky or environment-dependent tests
Build and dependenciesReproducibility, unpinned or vulnerable versions, platform differences, packaging and distribution
Diagnosability and error UXSwallowed exceptions, unhelpful messages to the user, missing logs where failures must be investigated
PerformanceOnly where it is noticeable: blocked UI, quadratic work on large inputs, redundant I/O
MaintainabilityDead code, accumulated TODO/FIXME, documentation that contradicts the code

4. Verify every finding

Before a problem goes into the report:

  • read the surrounding code and trace the calls, to make sure it is not handled elsewhere;
  • confirm it where possible: with an existing test, by running the code, or with a probe script in a temporary directory;
  • state the confidence: confirmed (reproduced, or follows unambiguously from the code) or likely (a plausible scenario that was not verified).

Leave out style and naming, matters of taste, micro-optimizations, hypothetical problems without a realistic scenario, and "rewrite it in another framework" without a concrete pain point.

5. Prioritize

PriorityCriterion
P0 — blockerBreaks a core function, loses or corrupts data, is a security vulnerability, or the build or tests fail. Fix before any new work
P1 — highGets in the way of the next stage of development, or is likely to hit users; an architectural obstacle to planned work
P2 — mediumA real risk or debt that grows more expensive over time but does not block
P3 — lowWorth doing when convenient. Keep this list short

Within a level, order by impact × likelihood relative to the cost of the fix, and respect dependencies: if fixing A simplifies or removes B, A comes first.

Report

Write in the user's language. Back every claim about the code with a path:line reference. Full template with an example: references/report-template.md.

  1. Overall state — two to four sentences: how ready the project is for further development and what matters most.
  2. Baseline checks — what was run and with what result; what could not be run.
  3. Summary table — ID | Priority | Problem | Location | Effort (S/M/L).
  4. Findings, from P0 to P3, each with: location, the problem, why it matters (a concrete consequence and its link to the next stage), the recommended fix (an approach, not a ready patch; alternatives when they differ materially), effort, and confidence.
  5. Recommended order of work — the sequence of fixes, respecting the dependencies between them; what can deliberately wait.
  6. Open questions — what cannot be decided without the user: unclear requirements, whether a behavior is intended.

If no significant problems were found, say so. Do not pad the list with trivia.

End by suggesting where to start fixing, and do not start without the user's explicit confirmation. When the main problems are architectural and call for restructuring, say so and suggest a dedicated, behavior-preserving refactoring pass as the next step.

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.