agentleFS
ku5icku5ic/claude-kit/skills/audit-debt/SKILL.md

audit-debt

Skill2 starsChanged 15 days agoMITView on GitHub

Technical debt inside a target's modules, ranked by severity, with a remediation path

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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. Very specific:

    If $ARGUMENTS is a directory, run tokei --files --sort code <path> to get accurate line counts per language and per file.

    line 23
  2. Distinctive:

    Read the 5 files with the highest code-line counts (excluding tests, generated files, and lockfiles).

    line 24
  3. Very specific:

    Read any index.ts, main.py, urls.py, routes.ts equivalents.

    line 25
  4. Distinctive:

    Run git log --oneline -20 on the target to see recent churn.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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-debt

Surface technical debt inside the target's modules, with severity and remediation path. Coupling, layering, and cycles between modules are /audit-arch.

Run

With no target in the arguments, ask for one first, since the auditor can't ask. Resolve a linked ticket or doc as skills/investigate step 0 describes, then dispatch the auditor agent (subagent_type: kit:auditor, foreground) with this file's procedure and the resolved arguments. It writes the report. Then run the report-format skill's Runtime checks yourself, and reply per skills/kit-rules/reference/output.md section 3.

Procedure

  1. Stack is in the <repo-context> block from the SubagentStart hook.
  2. Load the patterns skill for the detected stack (react-patterns, django-patterns, etc.) for the anti-pattern reference.
  3. Read the target.
    1. If $ARGUMENTS is a directory, run tokei --files --sort code <path> to get accurate line counts per language and per file.
    2. Read the 5 files with the highest code-line counts (excluding tests, generated files, and lockfiles).
    3. Read any index.ts, main.py, urls.py, routes.ts equivalents.
  4. Run git log --oneline -20 on the target to see recent churn. High-churn files are candidates for higher-priority debt.
  5. Collect deliberate shortcuts: rg -n 'shortcut:' <target>. Each is a finding in its own right. Its stated ceiling is the problem and its upgrade path is the remediation. A shortcut in a high-churn file, or one whose ceiling the code already exceeds, ranks higher.
  6. Evaluate across these categories. Skip categories with no findings. Do not pad.

Categories

  • Type safety: escape hatches, runtime assumptions not in types, unsafe casts, any in public surface
  • State management: local state that should be lifted, global state that should be local, derived state stored instead of computed
  • Side effects: unguarded async, missing cleanup, implicit ordering, hidden I/O
  • Scalability: works now, breaks at scale (data size, user count, team size)
  • Testing debt: core paths with no tests, brittle tests, untestable designs
  • Security debt: authn/authz gaps, input validation, exposed secrets, dependency CVEs (if easy to check)
  • Observability debt: silently swallowed errors, no logging on critical paths, no telemetry where it matters
  • Dead code and duplication: unused exports, and copies of one thing along a stable axis (copies with divergent lifecycles are correct, per skills/kit-rules/reference/change.md section 8). Each finding names the pattern skills/engineering-fundamentals/reference/design-patterns.md gives for its signal.
  • Build and dependency health: deprecated APIs, ejected config, outdated patterns, unmaintained deps
  • Metric thresholds breached: the numbers in skills/engineering-fundamentals/reference/metric-thresholds.md; use tokei for size and a quick scan for the rest. Each is a smell, not a failure; the audit's value is correlating these with high churn from git log.

Not a finding

  • A shortcut: comment whose ceiling the code hasn't reached and whose file barely changes. It stays info at most.
  • Two copies with different lifecycles, per skills/kit-rules/reference/change.md section 8.
  • A metric threshold breached in a file nobody changes, with no bug history in git log.

Severity anchors

  • failure: the debt is causing harm now, such as a swallowed error on a payment path, or a core path with no test that broke in the last 20 commits.
  • warning: it will cost the next change here, such as a 900-line file in the top churn, or duplicated logic already edited in one copy only.
  • info: worth knowing, with no cost yet.

Output per finding

  • What it is, with file:line
  • Evidence: what was checked and what it showed (a tokei size, a churn count from git log, the quoted line)
  • Why it matters: scale, maintainability, correctness, security, performance, or operability
  • Severity: per the report-format skill's rubric; failure here means an active liability, not a future risk
  • Fix: the concrete first step, and its effort: small (hours), medium (days), or large (weeks)

Output file

Load the report-format skill and use its format. Write to the path kit scratch-dir debt <target-slug> prints.

Sort findings by severity, then by effort (smallest first within each severity) so the quick wins are visible at the top.

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.