Guides refactoring to reduce code volume by fixing judgment gaps (reinvention, wrong frames, hidden duplication, speculative generality). Use after linter cleanup for deeper simplification.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pproenca-dot-skills-1:same-results-less-codeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Code-review and refactoring guide focused on the parts of code volume that come from **judgment and modelling gaps** — wrong abstraction choices, hidden semantic duplication, defensive habits, premature generality. This skill deliberately skips what linters and tools like `knip`, `eslint`, `ruff`, `tsc --noUnusedLocals`, or formatters already catch. It is the second pass: after the mechanical c...
Code-review and refactoring guide focused on the parts of code volume that come from judgment and modelling gaps — wrong abstraction choices, hidden semantic duplication, defensive habits, premature generality. This skill deliberately skips what linters and tools like knip, eslint, ruff, tsc --noUnusedLocals, or formatters already catch. It is the second pass: after the mechanical cleanup, what remains?
Use this skill when:
Don't use this skill for:
knip, eslint, ruff, or prettier/black instead.complexity-optimizer for that.code-simplifier.| # | Category | Prefix | Impact | Rules | Gist |
|---|---|---|---|---|---|
| 1 | Reinvention | reinvent- | CRITICAL | 5 | You wrote what the platform/stdlib already provides |
| 2 | Wrong Frame | frame- | CRITICAL | 5 | Wrong abstraction shape — class where a function fits, manager nouns, OO over data |
| 3 | Hidden Duplication | dup- | HIGH | 5 | Semantic copies hiding behind syntactic differences |
| 4 | Derived State Stored | derive- | HIGH | 5 | Storing what should be computed |
| 5 | Procedural Rebuilds | proc- | MEDIUM-HIGH | 5 | Imperative reimplementation of declarative concepts |
| 6 | Speculative Generality | spec- | MEDIUM | 5 | Generality built for a second user who never arrived |
| 7 | Defensive Excess | defense- | MEDIUM | 4 | Checks for states the type/flow already rules out |
| 8 | Type System Underuse | types- | LOW-MEDIUM | 6 | Runtime guards that should be types |
reinvent-stdlib-collection-ops — Reach for .map/.filter/.reduce before writing loopsreinvent-date-and-time — Stop hand-rolling date and time arithmeticreinvent-deep-equality — Use a real deep-equal instead of hand-recursing objectsreinvent-explicit-state-machine — Surface a state machine instead of boolean flag jugglingreinvent-builtin-data-structures — Recognise when a custom container is just a Map, Set, or Queueframe-function-not-class — Use a function when the class has no identityframe-manager-noun-is-a-verb — Rename Manager/Helper/Util classes until the real verb appearsframe-composition-over-inheritance-for-shared-fields — Compose shared fields instead of inheritingframe-data-over-procedure — Model the problem as data before writing procedureframe-monolith-by-cohesive-axis — Split a god-function along its cohesive axis, not by line countdup-parallel-types-same-shape — Collapse parallel types that share a shapedup-near-twin-functions — Parameterize two functions that differ by a literaldup-mirrored-branches — Lift shared lines out of mirrored if/else branchesdup-config-not-copies — Replace many hardcoded copies with one tabledup-cross-layer-shape — Collapse identical DTOs, DB rows, and domain objectsderive-dont-store-computed — Compute what you can compute; store only what you can'tderive-single-source-of-truth — Pick one source of truth; derive the restderive-boolean-from-data — Derive booleans from the data, don't track them separatelyderive-cache-as-getter-not-field — Turn cached fields into getters until profiling proves otherwisederive-url-as-state — Let the URL or route be the state, not a mirror of itproc-mutation-builder-over-pipeline — Compose pipelines when the mutation-builder hides the intentproc-if-chain-as-lookup — Replace if/elif returning constants with a lookup tableproc-manual-recursion-of-walk — Use a recognised tree/object walk, not hand-coded recursionproc-build-vs-declarative-template — Use the declarative form when the framework provides oneproc-sequential-awaits-could-be-parallel — Parallelise independent awaitsspec-interface-of-one — Avoid defining an interface for a single implementationspec-options-bag-of-one — Avoid options bags where every caller passes the same valuesspec-flag-driven-paths — Split a function that a boolean flag has made into twospec-no-extension-point-without-extender — Delete extension points that have no second userspec-generic-over-one-type — Drop the generic parameter when only one concrete type uses itdefense-guard-against-impossible — Stop guarding against states the type/flow already rules outdefense-validate-once-at-boundary — Validate once at the boundary, trust insidedefense-let-it-throw — Let exceptions propagate; don't catch what you can't handledefense-null-pollution-from-bad-modelling — Fix the type that makes the null checks necessarytypes-discriminated-union-over-flags — Use a discriminated union instead of optional fields + tagstypes-literal-union-over-string — Narrow string down to a literal union when the set is closedtypes-no-any-to-silence — Avoid reaching for any/as to silence a type errortypes-branding-over-runtime-checks — Brand a validated value so you don't validate it twicetypes-exhaustive-switch-not-default — Use exhaustiveness checks instead of a catch-all defaulttypes-readonly-and-immutable-by-default — Mark data readonly until mutation is actually neededWhen asked to review or refactor code with this skill:
knip/eslint/ruff/tsc --noUnusedLocals will catch dead code, unused imports, style. Don't duplicate that work here.| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
code-simplifier — Mechanical simplification (naming, dead code, nesting). Complementary first pass.complexity-optimizer — Algorithmic/performance complexity. Different axis.refactor — General-purpose refactoring workflow.clean-code — Broader clean-code principles. This skill is the narrower, judgment-focused subset.npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin pproenca-dot-skills-1Simplifies code for clarity by reducing complexity while preserving behavior. Useful during refactoring and code review.
Simplifies code for clarity and maintainability without changing behavior. Useful after features work, during code review, or when refactoring complex logic.
Reviews code for elegance and simplicity using two guiding questions: shorter paths and lower cognitive load. Detects duplication, over-abstraction, dead code, and special-case branching.