Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  1. Preserve behaviour. Every transformation must produce identical observable behaviour — same outputs, same errors, same side effects, same API surface.
  2. Earlier mistakes cascade. A wrong frame multiplies into wrong shapes, which multiply into duplicate logic. Optimise from the top of the lifecycle.
  3. Explain why, not just what. Each rule explains the cost of the anti-pattern so judgment can transfer to novel cases.
  4. Quantify where possible. Prefer "eliminates N lines / prevents X bug class" over "cleaner."
  5. 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, or prettier/black instead.
  • Algorithmic complexity / performance tuning — use complexity-optimizer for 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)

2. Wrong Frame (CRITICAL)

3. Hidden Duplication (HIGH)

Полный SKILL.md на GitHub

Установить same-results-less-code в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

AGENTS.mdREADME.mdassets/templates/_template.mdmetadata.jsonreferences/_sections.mdreferences/defense-guard-against-impossible.mdreferences/defense-let-it-throw.mdreferences/defense-null-pollution-from-bad-modelling.mdreferences/defense-validate-once-at-boundary.mdreferences/derive-boolean-from-data.mdreferences/derive-cache-as-getter-not-field.mdreferences/derive-dont-store-computed.mdreferences/derive-single-source-of-truth.mdreferences/derive-url-as-state.mdreferences/dup-config-not-copies.mdreferences/dup-cross-layer-shape.mdreferences/dup-mirrored-branches.mdreferences/dup-near-twin-functions.mdreferences/dup-parallel-types-same-shape.mdreferences/frame-composition-over-inheritance-for-shared-fields.mdreferences/frame-data-over-procedure.mdreferences/frame-function-not-class.mdreferences/frame-manager-noun-is-a-verb.mdreferences/frame-monolith-by-cohesive-axis.mdreferences/proc-build-vs-declarative-template.mdreferences/proc-if-chain-as-lookup.mdreferences/proc-manual-recursion-of-walk.mdreferences/proc-mutation-builder-over-pipeline.mdreferences/proc-sequential-awaits-could-be-parallel.mdreferences/reinvent-builtin-data-structures.mdreferences/reinvent-date-and-time.mdreferences/reinvent-deep-equality.mdreferences/reinvent-explicit-state-machine.mdreferences/reinvent-stdlib-collection-ops.mdreferences/spec-flag-driven-paths.mdreferences/spec-generic-over-one-type.mdreferences/spec-interface-of-one.mdreferences/spec-no-extension-point-without-extender.mdreferences/spec-options-bag-of-one.mdreferences/types-branding-over-runtime-checks.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить same-results-less-code с