К основному содержанию
скилл CX Codex

simplify · legendapp — скилл для Claude Code: что делает и как установить

Упрощает написанный код или свежий диф без потери логики и тестов. Скилл убирает лишние абстракции, дубли и оверинжиниринг, сохраняя привычный стиль репозитория.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add LegendApp/legend-skills --skill simplify -a claude-code
Открыть на GitHub

Что делает simplify

Скилл заставляет агента сокращать количество концепций и подвижных деталей в коде, а не просто сжимать строки. Перед правками он изучает ограничения, инварианты и архитектуру проекта. Задача — выбрать решение с минимумом сущностей, используя уже существующие в репозитории структуры данных и паттерны.

В проверку входит поиск оверинжиниринга: одноразовых хелперов, пустых обёрток, проглатывающих ошибки блоков try/catch и флагов конфигурации под несуществующие сценарии. На уровне строк агент проверяет контекст вокруг дифа, чтобы не плодить параллельные ветки и условия, которые уже предусмотрены рядом.

Оптимизации без профилирования или замеров здесь заблокированы. Скилл требует подтверждённого базового прогона тестов перед чисткой, поэтому на нестабильном коде без покрытия он бесполезен.

Какие задачи решает

  • убрать лишние абстракции и одноразовые хелперы из свежего дифа
  • найти дублирующиеся ветки и условия в коде вокруг изменений
  • вычистить неиспользуемые флаги конфигурации и спекулятивные интерфейсы
  • провести аудит ветки перед слиянием без раздувания правок

Примеры запросов агенту

  • Упрости этот диф, но сохрани текущее поведение и покрытие тестами.
  • Проверь ветку перед слиянием и удали временные леса и промежуточные абстракции.
  • Найди оверинжиниринг в src/services/auth.ts и избавься от лишних обёрток.

Как установить simplify

1Через Skills CLI (Vercel)

npx skills add LegendApp/legend-skills --skill simplify -a claude-code

2Вручную: положить файлы

~/.claude/skills/simplify/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/simplify/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о simplify

Как установить simplify в Claude Code?

Выполните команду npx skills add LegendApp/legend-skills --skill simplify -a claude-code. Также файл скилла можно положить вручную по пути ~/.claude/skills/simplify/SKILL.md.

Чем упрощение в simplify отличается от обычного сжатия кода?

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

Разрешает ли simplify оптимизировать производительность?

Да, но любые оптимизации требуют профилирования или бенчмарка. Вносить усложнения ради теоретического выигрыша в скорости инструкция запрещает.

Исходный текст

SKILL.md · MIT
---
name: simplify
description: "Simplify the requested code or diff while preserving behavior and meaningful coverage."
---

# Simplify

Produce the smallest clear implementation that fully satisfies the required behavior. Minimize concepts and moving parts, not line count.

## Cadence

- Before adding code, decide the smallest change that meets the requirement; each new concept must earn its place.
- During construction, apply the priorities locally while discovering behavior. Allow clearly temporary instrumentation or scaffolding when it accelerates learning.
- At convergence, once a logical behavior slice passes, simplify that slice, remove superseded attempts and scaffolding, and rerun focused validation.
- For an explicitly requested branch audit, compare with the intended base. Otherwise review only the requested change; do not broaden a small cleanup into a whole-branch audit.

## Workflow

1. Identify the required behavior, invariants, constraints, and non-goals.
2. Inspect the relevant diff and separate it into logical concepts. For a final branch audit, compare the full branch with its merge base and check history for superseded attempts when relevant.
3. Inspect the existing owners, sources of truth, common path, decision points, and nearby code style before adding anything.
4. Choose the design with the fewest necessary concepts and the least work at runtime.
5. When changes are requested, implement directly and reuse existing mechanisms where they fit.
6. Validate behavior with checks proportional to the risk.
7. Review the final code, tests, names, comments, documentation, configuration, and relevant history for anything that no longer earns its complexity.

## Simplification Priorities

- Match the repository's existing style and patterns: naming, file layout, error handling, test style, and the libraries it already uses. Do not introduce a new pattern where an existing one fits.
- Prefer deletion, reuse, or a direct change over a new abstraction.
- Keep one source of truth; avoid mirrored state, overlapping guards, duplicate registries, and compensating mechanisms.
- Where the repository has no convention, prefer straightforward positive control flow over early-return chains or empty branches.
- On hot paths, minimize allocations, callback recreation, subscriptions, renders, passes, I/O, and native work.
- For prose, remove repetition and keep the shortest wording or example that remains self-sufficient.

## Over-engineering Checklist

Remove these when they serve no required behavior, invariant, useful clarity, measured performance need, or existing repository convention:

- one-use helpers that can be inlined instead;
- defensive null or type checks for states the types or callers already rule out;
- config flags, options, or parameters for variation no current caller needs;
- wrapper types or classes that only forward;
- new files, modules, or abstractions where an existing owner fits;
- fallback, compatibility, or migration paths the task does not require;
- try/catch blocks that swallow errors or silently fall back;
- speculative generality: extension points or cases nothing uses yet.

## Line-level Pass

- Read every added block with the existing code around it, not just the diff hunk.
- Flag new code that duplicates a statement, return, or branch the surrounding code already has.
- Flag cases where guarding, wrapping, or skipping existing code would be smaller than adding a parallel path.
- Flag existing lines that became unreachable or redundant.
- Apply or report each case with the smaller rewrite; a diff-level "lean/proportional" verdict is not enough.
- Example: a fast path `if (sortsAfterTail) { queue.push(task); return; }` before a scan loop that already ends with `queue.push(task)` duplicates the push. Guard the loop with `if (!sortsAfterTail)` so one trailing push serves both paths.

## Existing Work

Establish a passing baseline before simplifying working code. Test one questionable concept at a time, rerun the relevant validation, and restore it if behavior or meaningful coverage weakens. Do not restructure several accumulated fix attempts before establishing which changes are causally necessary.

When duplicate or ineffective regression coverage is suspected, deliberately break the claimed invariant and confirm the remaining test fails. Passing tests alone do not prove that every test or implementation concept is necessary.

Do not rewrite branch history without authorization.

## Performance Changes

Name the exact common-path work being removed: allocations, scans, mounts, renders, subscriptions, I/O, or native calls. Control-flow evidence plus regression tests can justify removing work that is structurally unused. Require a benchmark, profile, or repeated repro when an optimization changes semantics or introduces a tradeoff. Do not add complexity for theoretical gains.

## Guardrails

- Preserve correctness, required behavior, type safety, distinct regression coverage, and useful clarity.
- Do not replace clear code with compressed or clever code merely to reduce lines.
- Make scoped, behavior-preserving improvements directly. If a simplification beyond the requested change would alter a public API or add a new concept, explain and suggest it instead.
- Leave unrelated and user-authored changes untouched.

Stop when every remaining concept supports a requirement, invariant, useful clarity, existing repository convention, or measured performance need. Report only material simplifications, validation, and unresolved opportunities.

© LegendApp · MIT · LegendApp/legend-skills

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

Все скиллы по теме «Код-ревью и рефакторинг» →

Сначала — simplify от других авторов.

simplify brianlovin Переписывает код, который вы только что написали: снимает лишнюю вложенность, дубли и неудачные имена. Поведение программы остаётся прежним. CX Codex +1 20 200установок improve-codebase-architecture Matt Pocock Скилл ищет архитектурные узкие места в кодовой базе и показывает варианты углубления модулей в HTML-отчёте. Подойдёт для ревью перед рефакторингом. 1 163 035установок tdd Matt Pocock Скилл управляет циклом красный-зелёный в TDD: проверяет, что тесты пишутся до кода, держит их на уровне публичных интерфейсов и не завязывает на внутреннюю структуру. 1 141 062установок triage Matt Pocock Скилл проводит issue и внешние PR через роли триажа, проверку и подготовку брифа для агента. Подойдёт мейнтейнеру, который разбирает очередь задач. 990 453установок codebase-design Matt Pocock Скилл помогает проектировать модули с небольшим интерфейсом и скрытой внутри сложностью. Подходит для рефакторинга, тестируемости и поиска чистого seam. 850 344установок code-review Matt Pocock Проверяет изменения от выбранной точки по стандартам репозитория и требованиям задачи. Нужен для ревью ветки, PR или незавершённой работы. 789 521установок implement Matt Pocock Выполняет задачу по спецификации или тикетам, ведёт работу через тесты и завершает её ревью с коммитом. Подходит для задач, где нужен дисциплинированный цикл разработки. 774 700установок

Из того же набора9

legend-list-best-practices Скилл для работы с виртуализированным списком @legendapp/list: помогает внедрить его по контрактам библиотеки или провести аудит существующего кода. CX Codex +1 546установок legend-state-best-practices Скилл задаёт правила работы с @legendapp/state: где хранить состояние, как подписываться и что делать с персистентностью. Пригодится при рефакторинге и аудите реактивного кода. CX Codex +1 475установок react-coding-style Скилл для ИИ-агента: помогает писать и ревьюить React-код с узкими подписками, стабильными идентичностями и честными зависимостями хуков. CX Codex +1 466установок diagnose Скилл ведёт расследование бага: строит гипотезы о причине, проверяет их пробами и выдаёт вывод с оценкой уверенности. CX Codex +1 423установок diagnose-fix-loop Скилл ведёт агента по кругу: диагноз, точечная правка, проверка тем же сигналом и снова диагноз. Пока не найдётся причина, а не симптом. CX Codex +1 420установок commit Превращает правки текущей задачи в один или несколько аккуратных коммитов и не тянет в них постороннюю работу. Пригодится, когда в дереве накопилось несколько несвязанных изменений. CX Codex +1 404установок commit-confirm Обёртка над скиллом $commit, которая собирает изменения со всего дерева проекта, готовит план коммитов и ждёт подтверждения перед отправкой в Git. CX Codex +1 394установок git-integrate Ведёт rebase, merge, cherry-pick или revert до конца и не трогает постороннюю работу. Пригодится, когда операция встала на конфликте. CX Codex +1 389установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой