codebase-simplification-audit

A read-only audit that searches a codebase for useful ways to simplify data structures, stored state, control flow, and algorithms. A codebase is the collection of source files that make up a software project.

In plain words
What is it for?
Use it to inspect a project for incremental simplifications that can be applied while keeping the code working between changes.
Why use it?
It provides evidence-based refactoring recommendations without changing the repository or relying on a quick opinion.

Skill for Claude CodeCodex

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 skills/pekral/cursor-rules/codebase-simplification-audit
Any agent
npx skills add pekral/cursor-rules --skill codebase-simplification-audit
Clone the repo
git clone --depth 1 https://github.com/pekral/cursor-rules

Made for: Claude Code, Codex.

Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,605 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.00100 $0.02605
Opus 5 $0.00050 $0.01303
Sonnet 5 $0.00020 $0.00521
Haiku 4.5 $0.00010 $0.00261

Measured yesterday against content hash 0a9acd9cd566, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codebase-simplification-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 yesterday.

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.

skills/codebase-simplification-audit/SKILL.md · 185 lines

How it starts

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

Constraints

  • Audit-only, read-only, no exceptions. Do not edit files, write or run tests, implement a recommendation, commit, or push. Read-only inspection commands (git log, git grep, rg, find, cat, sed -n) are the whole toolset. The deliverable is a report; the repository is unchanged when the audit ends.
  • Apply @rules/refactoring/general.mdc — the shared definition of refactoring and the ban on big-bang rewrites. Every recommendation must be reachable by incremental steps that keep the codebase green between them.
  • Apply @rules/compound-engineering/general.mdc Project-local agent instructions are part of the rule set — load the project's own CLAUDE.md and the sibling instruction files that section lists before the first subsystem review. They frequently declare the intentional semantics that turn a "simplification" into a misreading.
  • Apply @rules/compound-engineering/general.mdc Temporary-file hygiene — the working scratchpad is scratch, not an artifact. Write it under the session scratchpad directory and delete it when the audit ends; the report returned to the caller is the deliverable.
  • Apply @rules/php/core-standards.mdc only when the audited project is a PHP project (a PHP stack in composer.json) — its Design Principles own the YAGNI and speculative-interface bars this audit leans on. Skip it for a non-PHP codebase.
  • If the audited project uses Laravel, also apply @rules/laravel/architecture.mdc — its layer boundaries are the project's declared ownership model, so an ownership finding must be expressed in its vocabulary rather than a freshly invented one.
  • Output in English, Markdown only.

Boundary against neighbouring skills

Raise a concern once, in the skill that owns it — never file the same item twice:

  • @skills/class-refactoring/SKILL.md — one class, and in MODE=apply it changes code. This skill is repo-wide and never changes anything. When an accepted recommendation is ready to implement, hand the target class to that skill.
  • @skills/automation-audit-ops/SKILL.md — audits the repo's automation (workflows, hooks, scripts), not its data model.
  • @skills/production-audit/SKILL.md — answers ship / block for a release; this skill answers what the code should look like.
  • @skills/blueprint/SKILL.md — turns one objective into a sequenced multi-PR plan. This audit's ranked output is a natural input to it; do not duplicate its planning format here.
  • @skills/analyze-problem/SKILL.md — starts from a reported problem and finds its root cause. This audit starts from no complaint at all and looks for representations that invite future problems.

Read the full file on GitHub · 185 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. yesterday First seen · 185 lines · 100 tokens per session scan A 0a9acd9cd566

Subscribe to this mod's changes

codebase-simplification-audit is a skill published in the GitHub repository pekral/cursor-rules (6 stars, last pushed 7d ago), licensed MIT. It adds 100 tokens to every session and 2,605 once invoked, about $0.0005 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.