Skip to content
Back to skills

Simplification Audit

ASecurity

Use when the user explicitly asks for an audit of the codebase or to refactor a part of the codebase, or in `MODE=cr` over the current diff of every code review. Provides a bounded, read-only assessment over every subsystem in scope and returns ranked simplification recommendations for data structures, state representation, control flow, algorithms, and ownership, without changing a single file.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 26, 2026
developmentgophpbashrefactoringcode-reviewgit

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add pekral/ai-olympus --skill simplification-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Simplification Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Simplification Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pekral-simplification-audit/badge)](https://www.skillsdirectory.com/skills/pekral-simplification-audit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: simplification-audit
description: "Use when the user explicitly asks for an audit of the codebase or to refactor a part of the codebase, or in `MODE=cr` over the current diff of every code review. Provides a bounded, read-only assessment over every subsystem in scope and returns ranked simplification recommendations for data structures, state representation, control flow, algorithms, and ownership, without changing a single file."
license: MIT
metadata:
  author: "Petr Král (pekral.cz)"
---

Entry contract: from this skill directory, read the file printed by `bash ../_shared/resolve-command-helper.sh --entry`.

## Constraints
- **Audit-only and read-only.** Never edit, create, or delete a file. Never run the test suite, a fixer, a static analyser, or a build. Never implement a recommendation. Never stage, commit, push, or open a pull request. Read-only inspection commands (`git log`, `git grep`, `rg`, `find`, `cat`, `sed -n`) are allowed. The repository is byte-identical when the audit ends.
- **The audit mode runs only on an explicit user request** — see *Use when*. Never start the audit mode as a side effect of another skill or agent. The one other run is *Diff mode* (`MODE=cr`) inside every code review.
- **Publishes nothing.** No tracker comment, no issue, no PR. In *Diff mode* the code review publishes the findings on changed lines inside its own comment; the skill itself still publishes nothing. An audit produces proposals, and `@rules/compound-engineering/tracker.md` *File deferred points as follow-up tracker issues* → *The filing bar* files no refactoring proposal of any kind. The report stays in this run's output; the user decides what becomes an issue.
- Apply `@rules/refactoring/general.md` — it owns what refactoring is (behaviour-preserving structural change), when not to refactor ("just to make the code look nice", "without a business reason"), and the no-big-bang-rewrite rule. Every recommendation must be implementable incrementally.
- Apply `@skills/agent-voice/SKILL.md` to the prose of the audit report, which the user reads in the run output. A finding states a fact, never an adjective.
- Apply `@rules/php/core-standards.md` **only once it is established that the audited project is a PHP project (PHP stack in `composer.json`) and the recommendation touches PHP code** — skip it for a non-PHP subsystem.
- Apply `@rules/laravel/architecture.md` **when the project is a Laravel project using `pekral/arch-app-services` and the recommendation moves logic between layers** — that rule owns where business logic lives, so the ownership dimension of this audit never invents a competing taxonomy.
- **Never force an abstraction.** Boring local code that is already clear stays. Style consistency, hypothetical extensibility, line-count reduction, and moving existing branching behind a new type are not recommendations.

---

## Scope
Inspect the supplied subsystem in a bounded, read-only audit that finds materially useful simplifications in the audited scope's **data structures, state representation, control flow, algorithms, and ownership**, then rank them.


**What this skill deliberately leaves to another skill.** It never implements: an accepted recommendation is implemented later, in a separate and separately requested run, by `@skills/class-refactoring/SKILL.md` (class-level structure) or `@skills/refactor-entry-point-to-action/SKILL.md` (entry-point orchestration extraction). A suspected defect is not a simplification — route it to `@skills/analyze-problem/SKILL.md`. A pull-request diff review is `@skills/code-review/SKILL.md`, which is tied to a PR, never triggered by a bare audit request, and runs this skill only in *Diff mode*.

---


## Use when
- The user explicitly asks for an audit of the codebase ("audit this codebase", "audit the whole repository", "prověř celý projekt", "find simplifications across the repo").
- The user explicitly decides to refactor a part of the codebase and wants the cleanest available option before any code changes.

**Never runs when:** no such explicit request was made and no code review runs. The audit mode is never a side effect of another workflow — not `@skills/resolve-issue/SKILL.md`, not `@skills/code-review/SKILL.md` or any other review skill, not `@skills/process-code-review/SKILL.md`, and not an agent pipeline step. Another skill or agent may invoke the audit mode only when that caller is itself carrying out an explicit user audit or refactoring request, and it names that request when it does. *Diff mode* is the one run a code review starts on its own.

**Scope of the audit.** The user's scope always wins:
- An audit request covers the whole repository only when it says so in words ("the whole repository", "prověř celý projekt", "across the repo").
- A refactoring request, or an audit request that names an area, covers the part the user named. The inventory boundary is then that part plus the interfaces it exposes to the rest of the tree.
- Any other request that names no area, for example "audit this codebase", covers the hot spots chosen by change frequency (*Hot-spot scoping* in the audit contract).

Never widen the boundary beyond what was asked.

---

## Execution

Apply the inspection in `references/worker-brief.md` to the assigned subsystem. Return at most two opportunities or an explicit skip. Preserve the subsystem boundary, evidence, dependencies and reasons.

## Diff mode (`MODE=cr`) — inside every code review

With `MODE=cr`, inspect the current pull-request diff (`@skills/code-review/references/specialized-reviews.md` *Specialized Reviews*). This section is the one owner of the diff-mode contract; the reviewer and the lens list reference it and never restate it. In this mode:

1. **Scope.** The mode reads the changed lines, and the code they directly call or replace, only to judge the changed lines. Every finding anchors to a changed line. A simplification only in called or replaced code is dropped, never published.
2. **Dimensions and bar.** Apply the same five dimensions as *Scope* above, the same signals in `references/worker-brief.md`, and the same bar: a finding names a concrete smaller result that is materially useful. *Never force an abstraction* in *Constraints* applies unchanged.
3. **Passes.** Read the changed representation and affected call sites. Return findings with the eight fields in `references/worker-brief.md`.
4. **Validation.** `the command workflow` step 3 *Validate and synthesize* applies to every finding before it is returned, including the re-run search behind a deletion-test or single-implementation finding.
5. **Read-only.** The mode modifies no file, runs no test, fixer, static analyser, or build, and stages, commits, and pushes nothing.
6. **Publishes nothing, and severity.** The findings return to the reviewer as markdown, and the mode itself carries no severity. The reviewer assigns it:
    - A finding that rests on a rule with its own severity takes that severity, and that rule's bullet raises it.
    - Every other finding is **Moderate**, never Critical.
    - A finding that maps to neither Critical nor Moderate is not reported (`@rules/code-review/general.md` *Minor findings are not detected*).
    - The reviewer publishes each finding in its one review comment under `## Findings`, with the usual reproducer fields.
    - When no changed line meets the bar, the mode returns one line saying so, and the review reports nothing for this lens.
7. **Gating — one finding per violation, never two.** The mode divides the *dimensions* of a change, never its lines. It owns whether the structure the changed lines introduce is the smallest one that fits the assignment, and it proposes only a representation: a state model, a typed shape, a branching map, a collection or index, or an ownership boundary. These owners raise their own findings, and the mode does not raise a line again when one of them does:
    - `@rules/code-review/core-analysis.md` *Speculative interfaces* and *Simplicity First* own a new abstraction, a new class for simple logic, and a speculative interface.
    - `@rules/code-review/general.md` *Reuse Existing Logic* owns duplicated and already-existing logic, and *Bulk Data & Batch Processing* owns per-row work.
    - The architecture rules own which layer holds the logic.
    - `@rules/code-review/core-analysis.md` *Architecture principles — one lens, one finding format* owns the failure and concurrency trace of a state change, a flag parameter at its call site, and a dependency the code does not need. The mode owns only the representation of the state and of a set of booleans.
    - `@skills/test-audit/SKILL.md` with `MODE=cr` owns the value of a test.

---

## Output

In the audit mode, one markdown report in the shape of `templates/audit-report.md`, returned in this run. It contains:
- the subsystem inventory with a final status on every row;
- every accepted recommendation with its eight fields;
- the explicit skip decisions and their reasons;
- the cross-cutting patterns, and the duplicates and superseded findings that were removed;
- the ranked priorities with their dependencies, and the best first implementation slices;
- the audit log.

Write the report in the language the user made the request in. Code identifiers, file paths, and status words stay verbatim.

---

## Done when
- Every identifiable subsystem in scope has been reviewed.
- Every subsystem row carries a recommendation or an explicit skip.
- Every finding carries complete evidence, scope, risk, and validation fields.
- Duplicates and weak abstractions have been removed.
- Priorities and dependencies are internally consistent.
- The repository is unchanged — `git status --short` matches the pre-audit baseline recorded in the report's `## Scope` block.

---

## References
- `references/worker-brief.md` — the bounded subsystem inspection, and the eight required recommendation fields.
- `templates/audit-report.md` — the canonical report shape.

Files in this skill

  • SKILL.md14.7 KB
  • references/worker-brief.md4.3 KB
  • templates/audit-report.md3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.