same-results-less-code
БесплатноБез исполняемых скриптовНе проверенSame behaviour in fewer, clearer lines — covers the judgment gaps that linters cannot catch (reinvention, wrong frame, hidden duplication, derived state…
от pproenca★ 231 звезда на GitHubОб этом скилле
Community Refactoring Best Practices: Same Results, Less Code
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?
Core Principles
- Preserve behaviour. Every transformation must produce identical observable behaviour — same outputs, same errors, same side effects, same API surface.
- Earlier mistakes cascade. A wrong frame multiplies into wrong shapes, which multiply into duplicate logic. Optimise from the top of the lifecycle.
- Explain why, not just what. Each rule explains the cost of the anti-pattern so judgment can transfer to novel cases.
- Quantify where possible. Prefer "eliminates N lines / prevents X bug class" over "cleaner."
- Don't over-refactor. Rule of three: extract abstractions when duplication has actually appeared three times, not in anticipation.
When to Apply
Use this skill when:
- Reviewing a PR for "could this be simpler?" (the question linters can't answer)
- Refactoring code that has grown in volume without growing in capability
- Auditing a module that "feels heavy" — many flags, many layers, many checks
- Onboarding to an unfamiliar codebase and trying to spot the parts that are accidental volume vs essential complexity
- Designing a new module and wanting to avoid the common over-abstraction traps
- Working alongside knip / eslint / ruff and wanting the layer of judgment those tools can't supply
Don't use this skill for:
- Mechanical cleanup that a linter or formatter already does (unused imports, dead exports, style) — use
knip,eslint,ruff, orprettier/blackinstead. - Algorithmic complexity / performance tuning — use
complexity-optimizerfor that. - General cleanup of recently modified code regardless of mental-model gaps — use
code-simplifier.
Rule Categories by Priority
| # | 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 |
Quick Reference
1. Reinvention (CRITICAL)
reinvent-stdlib-collection-ops— Reach for.map/.filter/.reducebefore 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 Queue
2. Wrong Frame (CRITICAL)
frame-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 count
3. Hidden Duplication (HIGH)
dup-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
Установить same-results-less-code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл same-results-less-code?
Same behaviour in fewer, clearer lines — covers the judgment gaps that linters cannot catch (reinvention, wrong frame, hidden duplication, derived state, procedural rebuilds, speculative generality, defensive excess, type-system underuse). Trigger when reviewing, refactoring, or simplifying code — and even when the user doesn't explicitly ask for "simplification" but is reviewing code, refactoring, or asking "is there a shorter way to write this?". Complements knip/eslint/ruff/tsc by focusing on the conceptual modelling layer those tools cannot see.
Как установить скилл same-results-less-code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл same-results-less-code запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic