Review an entire repository for opportunities to simplify implementation details, APIs, abstractions, and obsolete code. Use when the user asks for simplification ideas, architectural cleanup, API cleanup, removal of unnecessary gadgets, or a broad "make the codebase simpler" audit.
Use this skill when the user wants a whole-codebase pass aimed at reducing complexity rather than adding features.
If the software is prerelease or being prepared for a major revision, do not preserve backwards compatibility by default. Unless the user explicitly asks otherwise, prefer the simpler end state even when it requires breaking old formats, deleting compatibility shims, or collapsing legacy pathways.
The optimization target is clean, maintainable code. Programmer time is expensive, so optimize for simplicity, interpretability, and elegance over cleverness, configurability, or preserving unnecessary historical structure.
Where possible, prefer structured objects with type annotations, validation, and parsers over raw dicts. This keeps the meaning of data separate from its serialized or presentation form.
Prefer transform-before-erasure design: do meaningful transformations while data is still in its richest typed form, then render it into serialized or provider-specific shapes at one clear boundary.
Prefer preserving meaningful type distinctions. Maintain type safety when different types encode real invariants or valid-state constraints, and only collapse them when the differences are purely decorative.
Default to a review mindset:
If the user asks for implementation after the review, turn the highest-value items into an execution plan or patch set.
Map the codebase shape first.
rg --files and a few targeted file reads to understand top-level modules, entrypoints, config, and major subsystems.Sample representative hotspots instead of reading everything linearly.
rg, especially repeated phrases, repeated schemas, repeated conversion logic, and repeated lifecycle code.Evaluate simplification at two scales.
Produce a prioritized simplification report.
Prefer simpler code inside functions:
Eliminate small stub functions when they only rename another call, forward one line, or hide no meaningful policy.
Extract functionality into objects when it improves encapsulation:
Collapse duplicate parsing, normalization, validation, or formatting code into one path.
Replace boolean or sentinel-heavy control flow with clearer objects, enums, or distinct code paths when that reduces branching.
Remove one-off helpers that exist only to preserve an old layering choice.
Prefer assert for internal invariants and impossible states when failure indicates a programmer error, instead of open-coded if/then guard branches.
Prefer exception-driven error handling over returning ad hoc error objects or error strings through normal result paths when the call site is already operating in a failure-capable control flow.
Prefer structured return types when the result shape is likely to grow:
Prefer structured domain objects over loose dicts when data crosses boundaries or accumulates behavior:
Preserve type safety when it carries real meaning:
Prefer "transform before erasure":
Simplify API design:
Generalize repeated special cases into a single mechanism when the abstraction is real.
Look for gadgets:
Consolidate parallel representations:
Narrow ownership boundaries:
Remove speculative abstractions:
Prefer deletion over frameworking:
Prefer standard library or direct data structures over custom mini-frameworks when custom code adds maintenance without leverage.
When the product is prerelease or headed for a major revision, explicitly look for places where backwards compatibility is the main reason complexity still exists.
Ask these while scanning:
assert for invariants, exceptions for failures, and structured return types for evolving interfaces.Use or adapt this when the user wants a broad simplification audit:
Review the entire codebase and identify opportunities to simplify it. Focus on both local simplifications and structural simplifications.
Local examples:
- simpler code inside functions
- removing stub functions that add no policy
- extracting cohesive state and behavior into better-encapsulated objects
Structural examples:
- simplifying API surfaces
- folding special cases into more general mechanisms
- finding gadgets, obsolete extension points, or code for futures we no longer intend
Add any other high-value simplification opportunities you see, especially around duplicated pathways, speculative abstractions, split ownership, compatibility layers, and dead code. Prefer recommendations that move the code toward asserts for invariants, exceptions for failures, and structured return types where interfaces are likely to grow. If the project is prerelease or preparing for a major revision, ignore backwards compatibility unless explicitly told otherwise, and recommend radical simplifications where warranted.
Search the whole repository, prioritize findings by impact, and for each one explain:
- what is too complex
- the simpler shape
- why it is safe or worthwhile
- file references
- migration risk