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

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

Скилл antfu-simplify для Claude Code и Codex уменьшает текущий diff ветки или рабочей копии через абляцию, убирая лишние слои абстракции.

MIT 312 установок ★ 6 092 обновлён 2026-10-23

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

Что делает antfu-simplify

Скилл анализирует изменения в рабочей копии через git diff HEAD или базу слияния ветки PR. Каждый добавленный элемент — отдельную функцию, тип, параметр, условие или зависимость — он пробует удалить, объединить или встроить на место вызова. Поведение системы остаётся прежним: публичный API не меняется, а сторонний код вокруг diff не затрагивается.

Каждое удаление скилл сразу проверяет запуском тестов, тайпчека и линтера из репозитория. Если проверка падает, правку откатывает. В конце агент выводит сводную таблицу со списком удалённых и оставленных частей, причинами решений и статистикой git diff --stat, не делая коммит без прямого указания.

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

  • сократить размер diff перед открытием pull request
  • убрать лишние уровни абстракции и одноразовые хелперы
  • проверить необходимость добавленных параметров и типов тестами
  • найти избыточные ветвления и защитные проверки в коде

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

  • Сократи изменения в текущей ветке и убери всё лишнее
  • Проведи абляцию этого PR и оставь только нужный код
  • Очисти рабочий diff от случайных правок перед коммитом

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

1Через Skills CLI (Vercel)

npx skills add antfu/skills --skill antfu-simplify -a claude-code

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

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

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

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

Вопросы об antfu-simplify

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

Выполните команду npx skills add antfu/skills --skill antfu-simplify -a claude-code. Конфигурация запишется в путь ~/.claude/skills/antfu-simplify/SKILL.md.

Что делает antfu-simplify?

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

Что нужно для работы antfu-simplify?

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

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

SKILL.md · MIT
---
name: antfu-simplify
description: Simplify the changes of the current PR or working tree with an ablation study - remove each piece of the diff and keep only what is proven needed - so the result has just-right abstraction, minimal clean code, and stays robust and universal. Use when asked to simplify, slim down, clean up, or reduce the current changes or PR.
metadata:
  author: Anthony Fu
  version: "2026.10.31"
---

# Simplify Changes

Review the **current changes** (PR branch or working tree) and cut them down to the smallest correct diff, the way a skilled developer would. The method is an **ablation study**: remove each piece, check whether anything that matters breaks, and keep only what earns its place.

Goal: clean, minimal code with the **just-right abstraction**, that is also **robust** (handles real edge cases) and **universal** (solves the general case, not only the one that triggered the change).

## Hard Rules

- **Behavior stays the same.** Simplify only. Do not add features, change public APIs, or fix unrelated issues. Report unrelated findings instead.
- **Scope is the diff.** Only touch code the change introduced or modified, plus code that must change to remove it. Do not refactor the surrounding codebase.
- **Every removal is verified.** Run the repo's tests, typecheck, and lint after each batch. If a check has no coverage for the removed piece, reason about it explicitly or keep it.
- Match the surrounding code's style, naming, and comment density.

## Workflow

1. **Get the diff.** Pick the base: PR target branch merge base (`git merge-base HEAD origin/<default>`), else `git diff HEAD` for uncommitted work. Read the full diff and the files around it. Note the goal of the change in one sentence; it is the yardstick for everything below.
2. **Inventory the pieces.** List each unit the diff adds: function, parameter, option, branch, type, file, dependency, abstraction layer, comment, test. See [Ablation Study](#ablation-study).
3. **Ablate.** For each piece, try removing, inlining, or merging it. Decide keep or cut using [Keep vs Cut](#keep-vs-cut).
4. **Apply** the cuts in small steps. After each batch run focused checks (tests, typecheck, lint). Revert a cut that breaks behavior; that piece is now proven needed.
5. **Check the result.** Re-read the final diff as a reviewer. Is each remaining line explained by the one-sentence goal? Is it still robust and general?
6. **Report.** Show a short table of what was cut or kept and why, plus the diff size before and after (`git diff --stat`). Do not commit unless asked.

## Ablation Study

For every piece in the diff, ask: *if I delete this, what concretely breaks?*

| Piece | Ablation | Keep if |
|-------|----------|---------|
| New function / helper | Inline it at the call site | Called from 2+ places, or the name explains a non-obvious step |
| Wrapper / abstraction layer | Call the underlying thing directly | It hides real complexity or a likely-to-change boundary |
| Parameter / option / config | Hardcode the only used value | A real caller needs a different value now |
| Type / interface / generic | Use the inferred or existing type | It is exported, or inference gives a worse or wrong type |
| Branch / guard / try-catch | Delete it and run tests | It guards a reachable case (real input, real failure), not an impossible one |
| New file / module | Merge it into its only consumer | It has multiple consumers or a distinct responsibility |
| Dependency | Replace with a few lines or an existing dep | It handles hard edge cases you would otherwise get wrong |
| Duplicate logic | Reuse an existing util in the repo | No equivalent exists (search first) |
| Comment | Delete it | It explains *why* (constraint, workaround, surprising choice), not *what* |
| Test | Remove it and see what is unprotected | It covers behavior or a regression nothing else covers |
| Changed lines unrelated to the goal | Revert them | Never keep drive-by edits |

## Keep vs Cut

Cut when the piece is:

- Speculative: built for a future need nobody has (extra options, hooks, plugin points, "just in case" generics).
- Redundant: repeats what the language, framework, types, or an existing util already provides.
- Defensive against the impossible: null checks on values the types or callers guarantee, fallbacks that never run, catch blocks that swallow errors.
- Indirection without payoff: one-use helpers, pass-through wrappers, classes where a function works, factories that build one thing.
- Noise: commented-out code, narrating comments, unused imports and exports, formatting-only churn.

Keep (or even add) when the piece is:

- **Robustness:** handles real edge cases (empty input, concurrency, cleanup, cross-platform paths, error propagation with context).
- **Universality:** solves the general problem instead of special-casing the reported one. If the fix hardcodes a name, path, or value from the bug report, generalize it.
- **Right-sized abstraction:** the third repetition of something gets extracted; the first and second usually do not. A good abstraction removes more code than it adds.

If an abstraction is too small, merge; if a function does several unrelated things, split. The target is neither fewest lines nor most layers, it is the fewest concepts a reader must hold.

## Smells to Look For

- A fix that patches the symptom at the call site instead of the cause.
- Special cases (`if (name === 'foo')`) where a general rule would cover them.
- Two code paths that do the same thing with small differences; unify them.
- State, flags, or caches that can be derived from existing data.
- Long parameter lists or option bags where most values are never varied.
- Types duplicated by hand when they can be derived (`typeof`, `ReturnType`, `Parameters`, utility types).
- Hand-rolled utilities that the repo, runtime, or an existing dependency already has.
- Tests that assert implementation details or mirror the code line by line.

## Report Format

```md
| # | Piece | Action | Why |
|---|-------|--------|-----|
| 1 | `parseOptions()` in src/cli.ts | inlined | one caller, 3 lines |
| 2 | `retry` option | removed | no caller passes it; default is enough |
| 3 | `try/catch` in fetchData | kept | network errors reach users; test covers it |

Diff: +142 -8 -> +61 -8. Tests, typecheck, lint pass.
```

List anything noticed but out of scope (unrelated bugs, wider refactors) separately, and leave it alone.

© Anthony Fu · MIT · antfu/skills

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

Все скиллы по теме «Код-ревью и рефакторинг» →
deslop prathamdby Скилл deslop для Claude Code, Codex и Cursor убирает из диффа лишний шум и слоп, сохраняя поведение кода. Анализирует изменения в Git и правит код минимальными шагами. CX Codex +1 736установок simplify SeifBenayed Скилл simplify для Claude Code, Codex и Cursor проходит по коду и убирает лишнюю сложность. Запускается на свежих правках или на отдельном файле, который разросся. CX Codex +1 ★ 116звёзд репо review-and-simplify-changes Dimillian Скилл review-and-simplify-changes разбирает изменённый код на переиспользование, качество, эффективность и ясность, а потом по желанию вносит безопасные правки. Пригодится перед коммитом. CX Codex +1 872установок check tw93 Скилл check проводит аудит диффов, проверяет готовность релиза и разбирает PR перед слиянием. Скилл работает строго в режиме отчёта и не меняет файлы без прямого разрешения. CX Codex +1 16 500установок review garrytan Скилл review для Claude Code проверяет локальные изменения, ветку или PR перед слиянием. Агент ищет проблемы в diff и оформляет отчёт. CX Codex +1 514установок code-review waybarrios Скилл code-review проверяет пулреквесты и локальные правки на баги и нарушения проектных правил через независимых агентов. Помогает найти скрытые дефекты до слияния веток. CX Codex +1 477установок

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

Весь набор →
pinia Загружает документацию Pinia v4.0.3 прямо в контекст агента. Агент начинает правильно определять сторы, работать с storeToRefs() и настраивать SSR-гидратацию. CX Codex +1 20 600установок antfu Скилл antfu задаёт агенту правила Anthony Fu для JavaScript и TypeScript: структура файлов, ESLint, Knip, публикация пакетов. Пригодится при старте проекта и настройке монорепозитория. CX Codex +1 17 400установок unocss Скилл даёт агенту справочник по UnoCSS: конфиг, правила, шорткаты, пресеты и трансформеры. Пригодится при настройке проекта на UnoCSS или при переносе знаний Tailwind на него. CX Codex +1 16 400установок vitepress Скилл по VitePress: помогает агенту настраивать конфиг, тему и Markdown с Vue-компонентами при сборке сайта документации. CX Codex +1 12 200установок nitro Подтягивает знания о Nitro v3: файловые маршруты, route rules, кэш, хранилище и пресеты деплоя. Помогает агенту править nitro.config и писать обработчики H3. CX Codex +1 3 000установок antfu-create-pr Скилл antfu-create-pr для Claude Code создаёт GitHub pull request с заголовком Conventional Commits, проверками и скриншотами UI. Запускается по просьбе открыть или подготовить PR. CX Codex +1 919установок antfu-issue-triage Скилл antfu-issue-triage для Claude Code анализирует открытые issues и pull request в репозитории GitHub. Находит дубликаты, спам и закрытые баги, формируя таблицу действий перед отправкой правок. CX Codex +1 413установок antfu-query Скилл antfu-query для Claude Code проводит интервью о плане, решении или идее, пока не сложится общее понимание. Он разбивает решения на ветви и задаёт вопросы раундами. CX Codex +1 295установок

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

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