Finds over-engineered or bloated code (a wrapper a standard library covers) and, in apply mode, tidies it one change at a time, rerunning the existing tests unmodified after each change and undoing any change that fails. Review mode reports TRIM findings or GO and edits nothing. Use when a feature works and its tests pass but the code is heavier than it should be, or a diff is larger than the task. Not for failing tests, behaviour changes, performance tuning, or code about to be replaced. Gui...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Simplicity Review?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/naimkatiman-simplicity-review)
---
name: simplicity-review
tier: "2"
description: "Finds over-engineered or bloated code (a wrapper a standard library covers) and, in apply mode, tidies it one change at a time, rerunning the existing tests unmodified after each change and undoing any change that fails. Review mode reports TRIM findings or GO and edits nothing. Use when a feature works and its tests pass but the code is heavier than it should be, or a diff is larger than the task. Not for failing tests, behaviour changes, performance tuning, or code about to be replaced. Guidance for Law 4 (Verify Before Reporting)."
origin: continuous-improvement
user-invocable: true
argument-hint: "[review | apply] [commit range or file list]"
---
# Simplicity Review: Make Working Code Smaller Without Changing What It Does
Passing tests show the code is correct. They do not show it is the least code that would be correct. This skill finds the over-build and, when asked, removes it with the tests as the judge. It is text you follow: no hook checks it, so the test runs and the lists below are the only proof.
## Two modes
- **review**: Steps 1 to 3, then the report. Edit nothing. Use it when the user asked for a review or asked "is this over-built?", when another review dispatched you as one of its reviewers (the `/production-readiness-review` command does), or when you cannot tell which mode was asked. In that last case, end by offering apply.
- **apply**: Steps 1 to 5. Use it when the user asked to simplify, trim or clean up.
## When to use it, and when not to
Use it when a feature works and its tests pass but the implementation is more complicated than it needs to be, when a diff is larger than the task, or when a new file, dependency or wrapper may duplicate something that already exists. Do not use it when:
- **Tests fail or the feature is unfinished.** Fix that first. See the red-baseline rule in Step 1.
- **The user wants different behaviour.** A bug fix or feature is a separate change, made separately.
- **You cannot say what the code does or who calls it.** Read until you can, or stop and ask.
- **The code is being deleted or rewritten in this same task.**
- **The complicated form exists for measured speed** and you cannot measure the replacement.
- **The code is already minimal.** Report GO with the evidence Step 5 asks for. Do not invent findings.
## Step 1: Scope and baseline
**Scope**, first match: the files or commit range the user named; the uncommitted diff (`git diff HEAD`); the branch's commits against its base (`git diff <base>...HEAD`). If all are empty, ask. Edit nothing outside the scope. Note anything else you spot as a follow-up.
**Baseline** (apply mode, before any edit):
1. Find the project's test command, plus typecheck and build if it has them. If the `verification-loop` skill is installed, its Phase 0 resolves these. If not, read `package.json` scripts, the Makefile, the CI config or the README.
2. Run them. Record each command and its result (passed and failed counts).
3. Save the output of `git status --short` and `git diff HEAD --stat`. This is the state you return to.
If everything is green and the tests exercise the scoped code, continue. Otherwise:
- **Red**: stop and report the failing tests. A later failure cannot be told apart from these. Continue only if the user says so, and then the baseline is that exact failing set: no new failure is allowed.
- **No test exercises the scoped code** (search the tests for its names to check): say so. Either stay in review mode and mark every finding `unverified`, or first write tests that pin what the code does today, see them pass on the unchanged code, record the baseline again, and treat them as original tests from then on.
- **Tests cannot run here**: review mode, and say why.
## Step 2: Read before you cut
The ladder shortens the solution, not the reading. For every changed block, read these and list them in the report. A block with an item missing gets no finding and no GO.
- The whole function or module around it. The changed lines alone are not enough.
- Every caller of anything you might change: search for the name and record the search and the hit count.
- The tests that exercise it, by file name.
- The thing you propose to reuse (rungs 2 to 5): open it and compare inputs, errors and edge cases such as empty, null and boundary values.
- The history, when code looks odd for no visible reason: `git log -L` or `git blame` on those lines. A bug-fix commit means the oddness is doing a job.
## Step 3: Walk the ladder
For each added or changed block, stop at the first rung that holds:
```
1. Does this need to exist? -> skip it (YAGNI)
2. Already in this codebase? -> reuse it
3. Stdlib does it? -> use it
4. Native platform feature? -> use it
5. Installed dependency? -> use it
6. One line? -> one line
7. Only then: the minimum that works
```
Most real cuts come from rungs 2 to 4. Rung 1 covers parts as well as wholes: an option nobody passes, an interface with one implementation, a layer that only forwards. It needs proof: a search showing no caller and no test that exercises the code. If a test exercises it, it is behaviour, and removing it is the user's decision. Fewer lines is not the aim: a dense one-liner, or inlining a helper that gave an idea a name, is not a simplification.
**Never a finding**, whatever it costs in lines: input validation at trust boundaries, error handling that prevents data loss, security controls (authorization checks, escaping, secret handling), accessibility.
**Load-bearing until Step 2 proves otherwise**: retries, timeouts, locks, the order of side effects, and anything a comment or commit message ties to a bug.
**Behaviour is more than what the tests cover.** Hold all of these fixed, tested or not:
- Error messages, error types and codes, exit codes, and which inputs raise.
- Side effects and their order: writes, network calls, emitted events, mutation of arguments.
- Logging and metrics: the lines, levels and fields something else may parse or alert on.
- Public signatures: exported names, parameter order and defaults, return shape, types.
- Performance a caller relies on: complexity, number of queries or requests, streaming versus loading everything, caching.
For each finding write which of these it touches and how you checked. "None: internal rewrite, same inputs and outputs" is a fine answer when true. A finding that changes one is not a simplification: mark it `left` with what would change. If only performance is in doubt, measure before and after or leave it. Review mode ends here: write the report.
## Step 4: Apply, one finding at a time
Take the findings lowest risk first: internal rewrites before anything on the behaviour list. For each one:
1. Make that one change and nothing else.
2. Rerun the exact baseline commands.
3. **Same result as baseline**: keep it and mark it `applied`. Commit only if the user asked for commits.
4. **Any new failure**: undo that one change by reversing your own edit, rerun to confirm the baseline result is back, and mark it `reverted` with the failing test's name. Do not undo with `git checkout` or `git restore`: on that file they also discard earlier applied findings and any uncommitted work that was there before you started. Retry once at most, and only if you can name what the first attempt got wrong.
Never edit, skip, delete or loosen a test, snapshot or fixture to get back to green. A test that has to change means behaviour changed. If a test pins an internal detail you wanted to remove, mark the finding `left` and let the user decide.
## Step 5: Done
Apply mode is done when all four hold:
1. The baseline commands give the baseline result, with the same number of tests run.
2. The test, snapshot and fixture entries in `git status --short` and `git diff HEAD --stat` match the saved baseline output exactly.
3. The code is smaller or clearer by a measure you state with before and after values: net lines (`git diff --shortstat`), files, dependencies or exports removed, nesting depth or branch count, or a duplicate replaced by the existing helper. If nothing improved, undo the changes and say so.
4. Every finding is listed as `applied`, `reverted` (with the failing test) or `left` (with the reason), and `git diff --stat` shows no file outside the scope.
**GO** means nothing to trim. It needs the Step 2 list for every changed block, plus the rung each block reached with a one-line reason ("rung 2: searched `formatDate` and `toISO`, no existing helper"). Without those, report "not reviewed", not GO.
## Report
```
Mode: review | apply Scope: <files or range>
Baseline: <command> -> <passed/failed> (review mode: result, or "not run")
Read: <files read, caller searches with hit counts, test files>
Findings:
1. <file:line>
over-built: <what the code does the long way>
simpler: <reuse X | stdlib Y | native Z | one line | delete>
behaviour touched: <none | which, and how checked>
status: <proposed | unverified | applied | reverted: failing test | left: reason>
After: <command> -> <result>; tests unmodified: yes; measure: <before -> after>
Verdict: GO | TRIM (review) | applied N, reverted N, left N (apply)
```
## Excuses, and the answer to each
| Excuse | Answer |
|---|---|
| "The diff is small and obviously fine. GO." | GO needs the read list and a rung per block. No list, no GO. |
| "That test checked an implementation detail, so I updated it." | Mark the finding `left`. Editing a test to pass is how a behaviour change gets hidden. |
| "I will apply all five and run the tests once." | When it fails you will not know which change did it. One change, one run. |
| "No test covers this, but the rewrite is clearly equivalent." | "Clearly" is not a check. Pin it with a test first, or report it `unverified`. |
| "Nothing calls this. Delete it." | Show the search. Dynamic lookup, config, exports and outside users do not show up in a plain text search. |
| "The wording of the error does not matter." | Callers, logs and alerts match on it. Same text, same type. |
| "This error handling is noise. The code is cleaner without it." | Check the never-a-finding list in Step 3 first. If it is on the list, it stays. |
| "This other file is messy too. I will fix it on the way." | Out of scope. Note it as a follow-up. |