Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Sequential 3-lens cleanup of recent code changes.
.claude/skills/hezaohezao-simplify-code/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 96% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 113% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 93% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 57% | 0% |
Review your recent code changes with three focused lenses, aggregate findings, and apply the fixes worth applying.
Core principle: Three narrow reviews beat one broad review. Each one deeply searches the codebase for a single class of problem — reuse, quality, efficiency — without diluting attention across all three.
> Poirot note: The original skill runs 3 reviewers in parallel via > subagent delegation. Poirot has no subagents, so this version runs the 3 > lenses sequentially in the same context. The methodology is identical; > only the concurrency is lost.
Trigger this skill when the user says any of:
Optional modifiers the user may add — honor them:
Recognized focuses: reuse, quality, efficiency.
three lenses, present findings, apply NOTHING. Ask before applying.
src/foo.py" → narrow the diff source accordingly.
Do NOT auto-run this after every edit. Invoke it only when the user asks.
Capture the diff to review. Pick the source by what the user asked for:
bash# 1. Default: uncommitted working-tree changes (tracked files) git diff # 2. If that's empty, include staged changes git diff HEAD # 3. Scoped variants: git diff --staged # "staged changes" git diff HEAD~1 # "the last commit" git diff main...HEAD # "this branch" / "my PR" git diff -- src/foo.py # specific file(s)
If git diff and git diff HEAD are both empty, fall back to files the user explicitly named or recently edited in this session. If you can't find any changed code, say so and stop.
Capture the full diff text. Note its size: if >2000 changed lines, warn the user and offer to scope down before proceeding.
Each lens gets the complete diff (not fragments — cross-file issues hide in the gaps) plus the repo path so it can search the wider codebase via bash (grep) and read_file.
For each lens:
git blame on the line to understand why it exists. If you can't determine the original purpose, mark it confidence: low.
file:line → problem → suggested fix | confidence: high/medium/low | risk: SAFE/CAREFUL/RISKY
code, pass-through wrappers). Auto-apply these.
flatten nested ternary, extract helper). Apply with test verification.
human review — do NOT auto-apply.
Run these three lenses (skip any the user's focus excludes):
Lens 1 — Code Reuse > Review this diff for code that duplicates functionality already in the > codebase. Search utility modules, shared helpers, and adjacent files (use > bash grep) for existing functions, constants, or patterns the new code > could call instead of reimplementing. Flag: new functions that duplicate > existing ones; hand-rolled logic that an existing utility already does. For > each, name the existing thing to use and where it lives.
Lens 2 — Code Quality > Review this diff for quality problems. Look for: redundant state; parameter > sprawl; copy-paste-with-variation; leaky abstractions; stringly-typed code > (raw strings where a constant/enum exists); AI-generated slop patterns > (extra comments restating obvious code, unnecessary defensive null-checks, > as any casts). For each, give the concrete refactor.
Lens 3 — Efficiency > Review this diff for efficiency problems. Look for: unnecessary work > (redundant computation, repeated file reads, N+1 access); missed concurrency; > hot-path bloat; TOCTOU anti-patterns; memory issues (unbounded growth, > missing cleanup); overly broad reads; silent failures (empty catch blocks, > except: pass). For each, give the concrete fix and why it's faster/safer.
suggestions silently.
correctness > the user's stated focus > readability/reuse > micro-perf. Don't apply a perf "fix" that hurts clarity unless the path is genuinely hot.
pass-through wrappers. Run tests after.
locals, flatten ternaries, extract helpers, consolidate dupes. Run tests after each file. Revert any that break.
public API changes, concurrency fixes. Present each with risk description and test coverage status. If the user opted for a dry run, present all three tiers and apply nothing.
the touched files, and re-run any linter/type check the repo uses. If a fix breaks a test, revert that one fix and report it.
lens and risk tier, plus any findings you deliberately skipped and why.
cross-file duplication and N+1s only show up with the full picture.
existing utility is noise. Require file:line evidence; drop findings that lack it.
license to refactor the whole module. Keep edits scoped to what the diff touched plus the minimal surrounding change a fix requires.
AGENTS.md / CLAUDE.mdor a linter config, fold those rules into the lens prompts so suggestions match house style.
reviewing — a 5000-line diff may truncate.
knip, ts-prune, depcheck flagexports that ARE used dynamically. Always grep for the symbol name before removing — a clean tool report is not proof.
paths, DB column names, config keys are contracts. Tag public-contract changes as RISKY; never auto-rename them.
intentional. Flag it, don't remove it; let the human decide.
Use requesting-code-review for the pre-commit security/quality gate. This skill is the standalone after-the-fact cleanup pass.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 3,311 | 5,773 | +74% | 1 | 1 | 0% | 267 | 2,095 | +685% | 0 | 0 | — |
case-02 | fail→fail | 9,849 | 10,539 | +7% | 1 | 1 | 0% | 781 | 2,251 | +188% | 0 | 0 | — |
case-03 | fail→fail | 6,002 | 8,040 | +34% | 1 | 1 | 0% | 252 | 2,257 | +796% | 0 | 0 | — |
case-04 | fail→pass | 7,565 | 3,463 | -54% | 1 | 1 | 0% | 1,198 | 2,345 | +96% | 0 | 0 | — |
case-05 | fail→pass | 10,470 | 6,444 | -38% | 1 | 1 | 0% | 1,255 | 2,675 | +113% | 0 | 0 | — |
case-06 | pass→pass | 15,390 | 6,870 | -55% | 1 | 1 | 0% | 2,187 | 2,904 | +33% | 0 | 0 | — |
case-07 | fail→fail | 6,244 | 6,600 | +6% | 1 | 1 | 0% | 854 | 2,103 | +146% | 0 | 0 | — |
case-08 | fail→pass | 10,262 | 3,629 | -65% | 1 | 1 | 0% | 1,577 | 2,275 | +44% | 0 | 0 | — |
case-09 | pass→pass | 10,370 | 5,643 | -46% | 1 | 1 | 0% | 1,457 | 2,584 | +77% | 0 | 0 | — |
case-10 | fail→pass | 8,337 | 5,390 | -35% | 1 | 1 | 0% | 1,399 | 2,704 | +93% | 0 | 0 | — |
case-11 | pass→pass | 11,618 | 5,441 | -53% | 1 | 1 | 0% | 1,745 | 2,783 | +59% | 0 | 0 | — |
case-12 | pass→pass | 11,432 | 4,528 | -60% | 1 | 1 | 0% | 1,416 | 2,553 | +80% | 0 | 0 | — |
case-13 | pass→pass | 14,484 | 9,799 | -32% | 1 | 1 | 0% | 1,970 | 3,296 | +67% | 0 | 0 | — |
case-14 | fail→pass | 11,427 | 4,317 | -62% | 1 | 1 | 0% | 1,615 | 2,530 | +57% | 0 | 0 | — |
case-15 | fail→pass | 8,590 | 7,829 | -9% | 1 | 1 | 0% | 1,315 | 2,811 | +114% | 0 | 0 | — |
case-16 | pass→pass | 19,465 | 12,442 | -36% | 1 | 1 | 0% | 2,958 | 3,809 | +29% | 0 | 0 | — |
case-17 | fail→pass | 36,011 | 13,282 | -63% | 1 | 1 | 0% | 3,090 | 3,714 | +20% | 0 | 0 | — |
case-18 | fail→pass | 5,635 | 3,374 | -40% | 1 | 1 | 0% | 776 | 2,335 | +201% | 0 | 0 | — |
case-19 | pass→pass | 15,483 | 11,968 | -23% | 1 | 1 | 0% | 2,427 | 3,577 | +47% | 0 | 0 | — |
case-20 | fail→pass | 8,130 | 20,590 | +153% | 1 | 1 | 0% | 874 | 3,652 | +318% | 0 | 0 | — |
case-21 | fail→fail | 2,539 | 6,737 | +165% | 1 | 1 | 0% | 297 | 2,119 | +613% | 0 | 0 | — |
case-22 | fail→fail | 10,843 | 6,705 | -38% | 1 | 1 | 0% | 1,967 | 2,271 | +15% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 16 counted toward the lift figure. The other 6 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +41 percentage points is the difference between those two pass rates over the 16 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.