antfu-simplify
하는 일
이 스킬은 AI가 현재 코드 변경을 검토하고 필요 없는 것을 제거하도록 합니다. 개발자가 기능은 그대로 두고 더 작고 깔끔한 변경을 원할 때 쓰는 스킬입니다.
사용하는 경우
- ✓풀 리퀘스트가 필요 이상으로 커졌을 때.
- ✓동작을 바꾸지 않고 변경에서 불필요한 코드를 제거하고 싶을 때.
- ✓검토를 요청하기 전에 작업을 더 깔끔하게 만들고 싶을 때.
스킬 링크
https://github.com/antfu/skills/blob/main/skills/antfu-simplify/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“현재 브랜치의 변경을 코드가 하는 일은 바꾸지 않고 단순하게 줄여 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 변경 사항을 한 번에 하나씩 제거하고, 프로젝트의 테스트와 점검을 실행하며, 필요한 부분만 남깁니다. 동작은 그대로 유지됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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
- Get the diff. Pick the base: PR target branch merge base (
git merge-base HEAD origin/<default>), elsegit diff HEADfor 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. - Inventory the pieces. List each unit the diff adds: function, parameter, option, branch, type, file, dependency, abstraction layer, comment, test. See Ablation Study.
- Ablate. For each piece, try removing, inlining, or merging it. Decide keep or cut using Keep vs Cut.
- 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.
- 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?
- 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 th
자주 묻는 질문
새 기능을 추가하나요?
아니요. 기존 변경만 단순하게 하며, 관련 없는 문제는 고치지 않고 보고만 합니다.
내 변경 밖의 코드를 바꾸나요?
아니요. 내 변경으로 추가되거나 수정된 코드에서만 작업합니다.
아무것도 깨지지 않았는지 어떻게 확인하나요?
제거 작업을 한 묶음 끝낼 때마다 저장소의 테스트, 타입 검사, 린트를 실행합니다.
상세 정보
작성자의 원본 설명
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.
repo: antfu/skills
인기도
- GitHub 스타
- 6.0k
- 순위
- #14438
- 라이선스
- MIT
- 업데이트
- 2026. 10. 30.
댓글
- …
이 저장소의 다른 스킬
antfu-create-pr
6.0k에이전트가 내 브랜치에서 GitHub 풀 리퀘스트를 열도록 돕고, 무엇이 왜 바뀌었는지 쉽게 설명한 요약을 함께 씁니다.
antfu-issue-triage
6.0k에이전트가 열린 GitHub 이슈와 풀 리퀘스트를 살펴 중복과 이미 해결된 항목을 찾고, 실행 전에 사용자에게 먼저 묻도록 돕습니다.
antfu-query
6.0k에이전트가 계획을 한 번에 한 단계씩 질문해, 함께 명확하고 검증된 이해에 이르도록 돕습니다.
antfu
6.0k에이전트에게 파일 구조부터 도구 선택까지, Anthony Fu가 선호하는 JavaScript와 TypeScript 습관을 가르칩니다.