clean-code-audit

A broad review of a codebase against common code-quality practices, including TDD, where tests are written around the code's expected behavior.

In plain words
What is it for?
Checking project structure, test coverage and patterns, refactoring opportunities, SOLID design principles, object-oriented code, functional techniques, and architecture.
Why use it?
It brings many kinds of maintainability problems into one report, including missing tests, complex code, design violations, and code smells.

Command

Part of the clean-code-skills plugin — 21 skills, 2 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/helmedeiros/clean-code-skills/clean-code-audit
Clone the repo
git clone --depth 1 https://github.com/helmedeiros/clean-code-skills

Or install clean-code-skills, the plugin that ships this one along with the rest of its 21 skills, 2 commands.

Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 736 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00057 $0.00736
Opus 5 $0.00028 $0.00368
Sonnet 5 $0.00011 $0.00147
Haiku 4.5 $0.00006 $0.00074

Measured 2d ago against content hash 21112d1c918d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

clean-code-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/clean-code-audit.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Clean Code Audit

Perform a comprehensive code quality audit on the current project. Evaluate the codebase against all 20 clean code skills and produce a structured report.

Audit Process

Step 1: Scan the Codebase

Identify the primary language(s), framework(s), and project structure. Focus on source files, excluding vendored dependencies and generated code.

Step 2: TDD Assessment

  • Check for test files and test coverage patterns.
  • Evaluate whether tests follow the Arrange-Act-Assert pattern.
  • Look for test-first indicators (test files matching source files, comprehensive edge case coverage).
  • Flag untested public methods or classes.

Step 3: Refactoring Opportunities

  • Identify long methods that should be extracted (more than 20 lines of logic).
  • Flag poorly named variables, methods, or classes.
  • Detect complex conditionals (nested if/else, switch statements with shared logic) that could use polymorphism.

Step 4: SOLID Compliance

  • SRP: Flag classes with multiple reasons to change (mixed concerns).
  • OCP: Look for modification-heavy code that should use extension points.
  • LSP: Check inheritance hierarchies for contract violations.
  • ISP: Find large interfaces that force clients to depend on unused methods.
  • DIP: Identify high-level modules directly depending on low-level implementations.

Step 5: OOP Review

  • Check for data classes with no behavior (anemic domain models).
  • Flag exposed internal state (public fields, getter/setter pairs without invariants).
  • Identify deep inheritance hierarchies that should use composition.

Step 6: Functional Programming Opportunities

  • Spot impure functions with hidden side effects.
  • Identify loops that could be replaced with map/filter/reduce.
  • Find null-based error handling that could use Result/Either/Option patterns.

Step 7: Architecture Assessment

  • Evaluate dependency direction (do domain modules depend on infrastructure?).
  • Check for port/adapter separation at system boundaries.
  • Flag domain logic mixed with I/O, serialization, or framework code.

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 104 lines · 57 tokens per session scan A 21112d1c918d

Subscribe to this mod's changes

clean-code-audit is a command published in the GitHub repository helmedeiros/clean-code-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 57 tokens to every session and 736 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.