agentleFS
Tom-the-BombTom-the-Bomb/skills/audit/SKILL.md

audit

Skill1 starsChanged 12 days agoMITView on GitHub

Multi-round codebase audit held to one fixed bar so rounds stop flip-flopping. Every round re-reads all code from scratch with fresh subagents and runs find, verify, fix and check as separate agents, backed by the stack's linters, type checkers, dead-code and vulnerability scanners and real-browser UI checks. Simplicity first, no overengineering, and it asks before adopting a library. Run with /audit.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use delight, teach-impeccable 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.
  • HK-hubSkill

    delight

    Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable.

    Also in 32 projects that use this

  • HK-hubSkill

    teach-impeccable

    One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.

    Also in 19 projects that use this

  • zwy123zwySkill

    normalize

    将用户随意输入的提示词规范化为结构清晰、便于大模型执行的标准化提示词。适用于需要整理、统一提示词格式时调用。

    Also in 19 projects that use this

  • SkillPilotCHSkill

    level-up

    Eine Automatisierung pro Woche finden, scopen, shippen. Output landet als proposed-Eintrag in cadence.md mit konkreten Implementations-Schritten.

    Also in 12 projects that use this

  • ww-w-aiSkill

    pm-discovery

    PM Agent Team - Automated product discovery, strategy, and PRD generation. Runs PM analysis workflow to produce comprehensive PRD before PDCA Plan phase.

    Also in 3 projects that use this

  • +7 more from HK-hub

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 13 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 176 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Inconsistency: When the bar drifts, one round adds code and the next removes it.

    line 12
  2. Very specific:

    Leave everything else out: no theories about what's wrong, no earlier rounds' findings, no hint of the result you expect.

    line 28
  3. Distinctive:

    Do this once per audit.

    line 32
  4. Distinctive:

    Find: Run one reviewer per slice (find.md), all in parallel.

    line 49
  5. Distinctive:

    Verify: Run one verifier per finding (verify.md), in parallel.

    line 51
  6. Distinctive:

    Ask: Put NEEDS OWNER items, the reviewers' "needs the owner" items and library proposals to the user with AskUserQuestion.

    line 52
  7. Distinctive:

    Use at most 4 questions per call.

    line 53
  8. Distinctive:

    Only three kinds of question go to the user: new dependencies, visible changes, and decisions with more than one reasonable answer, such as …

    line 54
  9. Distinctive:

    Check: Run one checker per fix group (check.md).

    line 58
  10. Distinctive:

    If it fails again, restore the group's files from its backup.

    line 60
  11. Distinctive:

    Record: Every finding goes into the ledger as fixed (with how the fix was verified), rejected (with the rule that rejects it), skipped, or …

    line 61
  12. Distinctive:

    Keep each entry to one line.

    line 66
  13. Distinctive:

    When the last round ends, tell the user:

    line 88
  14. Distinctive:

    Leave every change uncommitted.

    line 95

“Common” is measured: kept by at least 6 in 10 of the 176 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

Audit

Audit the codebase in rounds until a round finds nothing worth changing. This skill exists to prevent two failures:

  • Inconsistency. When the bar drifts, one round adds code and the next removes it. So every agent gets the same written bar, references/bar.md, and every decision goes into a ledger that later rounds respect.
  • Bias and shallow coverage. An agent that raised an issue tends to confirm it, and one that fixed it tends to pass it. So find, verify, fix and check are separate fresh agents. Every round re-reads every file, and tools cover all files rather than whatever a reviewer happens to open.

Simplicity matters most. Most good audit changes delete code, and a change that adds code has to fix a real bug.

Arguments: $ARGUMENTS. Paths narrow the scope (default: the whole repo). rounds=N sets the maximum number of rounds (default 3).

Your role

You orchestrate and the agents audit. Don't review, verify, fix or check code yourself: you carry this whole conversation, which is the bias the fresh agents are there to avoid. Your jobs are setup, launching agents, deduplicating, asking the user, keeping the ledger and reporting.

Launch every agent with the Agent tool as a new general-purpose agent, never a fork, since a fork inherits this conversation. Every brief has the same shape:

  1. "Read ${CLAUDE_SKILL_DIR}/references/bar.md and ${CLAUDE_SKILL_DIR}/references/<role>.md, then follow them."
  2. The facts for this job: the skill folder (${CLAUDE_SKILL_DIR}, written <skill> in the briefs), the repo path, the files in scope, the paths of the setup notes, ledger and sweep output, the agent's own output folder, and for verify, fix and check, the findings it handles, copied verbatim.

Leave everything else out: no theories about what's wrong, no earlier rounds' findings, no hint of the result you expect. The briefs in references/ already say how to work and what to report. Restating them in your own words is how the bar drifts.

Setup

Do this once per audit.

  1. Scope. Every tracked and untracked, non-ignored file in scope (git ls-files -co --exclude-standard), minus lockfiles, generated files, vendored code and binary assets. Audit the code as it is now, not a diff. Reviewing only recent changes lets older bugs survive. If there are uncommitted changes, tell the user the fixes will land alongside them. Never stage, commit or push.
  2. Output folder. <out> is audit/ in this session's scratchpad if there is one, otherwise a new mktemp -d. Round N writes to <out>/round-N/.
  3. Setup notes. Work out the stack, the build, test and run commands, and the project's instruction files (CLAUDE.md, AGENTS.md, CONTRIBUTING, style guides, DESIGN.md and similar). If there's a UI or a server, work out how to run an isolated copy: its own ports, its own containers or a temp database, and mocks for external services. It must not touch anything the user already has running. Note the routes or entry points, the states worth checking and how to produce or mock them. Write all of this to <out>/setup.md so agents don't rediscover it.
  4. Ledger. Use the project's audit ledger if it has one: look in the project memory folder and the repo for a file of past audit decisions. Otherwise create audit-ledger.md in the project memory folder if this session has one, and ask the user where to keep it if not. The format is below.
  5. Slices. Split the scope into slices that an agent can read in full, by package, folder or feature. Aim for roughly 2,000 to 5,000 lines each, usually 3 to 8 slices. Every file belongs to exactly one slice, including config, CSS, scripts, infra and docs. Save the map to <out>/slices.md and reuse it every round, so coverage is comparable between rounds.
  6. Start. Tell the user the slice count, the round limit and roughly how many agents a round will run, then begin without waiting for a reply.

Each round

Each round starts from scratch: fresh agents, full reads and a full tool sweep. Only the ledger, the slice map and the setup notes carry over. The eyes are new, but the bar stays the same.

  1. Sweep. Run bash ${CLAUDE_SKILL_DIR}/scripts/sweep.sh <repo> <out>/round-N/sweep.
    • It finds each package (Go, JS/TS, React, CSS, Tailwind 4, Python, Rust, shell) and runs its format check, linter, type checker, dead-code finder and vulnerability scanner. It uses the project's own config where there is one.
    • It writes a summary line per tool, saves each tool's full output to its own file, and lists any languages it doesn't cover. For those, look up that ecosystem's standard tools, run them and save their output next to the rest.
    • A tool that fails to run is a gap to fix or report, not a pass.
  2. Find. Run one reviewer per slice (find.md), all in parallel. Round 1 also runs one library researcher (libraries.md) over the whole scope. Later rounds rerun the researcher only if dependencies changed.
  3. Triage. You do this step. Merge the reports and drop duplicates (the same line or the same mechanism). Also drop anything the ledger already settled, unless the finding brings new evidence: a reproduced failure or a measurement. Don't judge merit, because that's the verifier's job. Add each reviewer's "considered and rejected" items to the ledger as they are.
  4. Verify. Run one verifier per finding (verify.md), in parallel. Findings about the same mechanism can share a verifier. Each verdict is CONFIRMED, REJECTED or NEEDS OWNER.
  5. Ask. Put NEEDS OWNER items, the reviewers' "needs the owner" items and library proposals to the user with AskUserQuestion.
    • Use at most 4 questions per call. Put your recommended option first, and state the cost in the option descriptions: lines added and removed, any new dependency, any visible change.
    • Only three kinds of question go to the user: new dependencies, visible changes, and decisions with more than one reasonable answer, such as what a fixed behaviour should be.
    • A debatable change with no clear win isn't a question. Ties go to the status quo.
    • Record every answer in the ledger.
  6. Fix. Group the confirmed findings and approved proposals by the files they touch, and run one fixer per group (fix.md). Groups that share no files run in parallel; overlapping groups run one after another. Give each group its own folder, <out>/round-N/fix-<group>/, with a backup/ inside it.
  7. Check. Run one checker per fix group (check.md). It must not be the agent that made the fix.
    • On FAIL, give the checker's report to a new fixer for one more attempt, then run a new checker.
    • If it fails again, restore the group's files from its backup. Record the finding as skipped, with the reason. It stays settled for the rest of this audit, and the final report lists it.
  8. Record. Every finding goes into the ledger as fixed (with how the fix was verified), rejected (with the rule that rejects it), skipped, or the owner's call. Rejected entries matter most: they stop the next round from raising the same items again.
  9. Next round or stop. Stop when no verifier confirms anything new, or when you reach the round limit. Otherwise start the next round at step 1. Don't tell the next round's reviewers what this round found. If a fix was wrong, fresh eyes should catch it on its own merits.

Ledger format

Keep each entry to one line.

# Audit ledger

Settled audit decisions for this project. An entry is reversed only with new evidence, meaning a reproduced failure or a measurement. A different opinion doesn't count.

## Settled
- `path:line` or area: the decision and the rule or reason behind it. (round N, YYYY-MM-DD)

## Owner's calls
- The question: what the owner decided, and why. (YYYY-MM-DD)

## Fixed
- `path:line`: what was wrong, and how the fix was verified. (round N, YYYY-MM-DD)

## Skipped
- `path:line`: what couldn't be fixed cleanly, and why. (round N, YYYY-MM-DD)

Final report

When the last round ends, tell the user:

  • for each round: how many findings were raised, confirmed, fixed, rejected and skipped;
  • for each fix: the file, what was wrong, how it was verified, and the net line change;
  • the owner's decisions, and the skipped items with the reason for each;
  • the final sweep's state, and the net lines the audit changed.

Leave every change uncommitted.

When the user questions a decision

Give your own reasoned answer against the bar: the evidence on both sides and a recommendation. Then wait for their call. Don't revert or concede just because they asked. A verdict that folds under a question is worthless, and flip-flopping is the failure this skill exists to prevent. Record their decision in the ledger.

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.