antfu-simplify
यह क्या करती है
यह स्किल आपके AI को आपके मौजूदा कोड बदलावों की समीक्षा करके वह सब हटाने देती है जो ज़रूरी नहीं है। यह उन डेवलपरों के लिए है जिन्हें छोटा, साफ़ बदलाव चाहिए जो फिर भी काम करे।
कब इस्तेमाल करें
- ✓जब आपका pull request ज़रूरत से बड़ा हो गया है।
- ✓जब आप व्यवहार बदले बिना किसी बदलाव से अतिरिक्त कोड हटाना चाहते हैं।
- ✓जब आप रिव्यू माँगने से पहले अपने काम का साफ़ रूप चाहते हैं।
Skill का लिंक
https://github.com/antfu/skills/blob/main/skills/antfu-simplify/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी मौजूदा ब्रांच के बदलावों को सरल कीजिए, बिना यह बदले कि कोड क्या करता है।”
हर हफ़्ते 5 नई skills, 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
- अपडेट की गई
- 30/10/2026
कमेंट
- …
इस repository की और skills
antfu-create-pr
6.0kआपके एजेंट को आपकी ब्रांच से GitHub पर साफ़ pull request खोलने में मदद करती है, जिसमें बदला गया और कारण का सरल सारांश होता है।
antfu-issue-triage
6.0kआपके एजेंट को खुले GitHub इश्यू और pull request छाँटने में मदद करती है, डुप्लिकेट और पहले से ठीक हो चुके आइटम पहचानकर, और कार्रवाई से पहले आपसे पूछकर।
antfu-query
6.0kआपके एजेंट को किसी योजना या विचार पर एक-एक करके सवाल पूछने देती है, जब तक आप दोनों एक स्पष्ट और परखी हुई समझ पर न पहुँच जाएँ।
antfu
6.0kआपके एजेंट को JavaScript और TypeScript प्रोजेक्ट के लिए Anthony Fu की पसंदीदा आदतें सिखाती है, फ़ाइल लेआउट से लेकर टूलिंग के चुनाव तक।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।