# Anti-Patterns और Skill कब उपयोग न करें — Claude Code Skills और SKILL.md

Source: https://www.geekswithgeeks.com/hi/claude-code-skills/p-anti

> वे आम ग़लतियाँ टालें जो skills को बेकार या हानिकारक बनाती हैं।

## आम ग़लतियाँ

बार-बार दिखने वाले anti-patterns: **अस्पष्ट description** जिससे skill कभी trigger नहीं होती; **विशाल SKILL.md** जो पूरा दस्तावेज़ दोहराती है; **CLAUDE.md की सामग्री दोहराना** जो बस वहीं रहनी चाहिए; **ऐसे निर्देश जो मॉडल के नियम याद रखने पर निर्भर हैं** जबकि **hook या script** उसे लागू कर सकती है; हर सूक्ष्म-चरण **अति-निर्धारित** करना ताकि स्थिति अलग हो तो Claude ढल न सके; **सत्यापन चरण नहीं** (जाँचे बिना "पूर्ण"); **पुरानी commands और paths** जो अब मौजूद नहीं; **ओवरलैपिंग skills** जिनके descriptions होड़ करते हैं; **व्यापक `allowed-tools`**; और **files में secrets**। यह भी जानें कि skill कब **नहीं** लिखनी: एक बार का कार्य जो दोहराएँगे नहीं; ऐसा तथ्य जो हर session में चाहिए (CLAUDE.md उपयोग करें); ऐसा नियम जो कभी टूटना नहीं चाहिए (hook, permission setting या CI जाँच उपयोग करें); या वह जो मॉडल बिना मदद के पहले से अच्छा करता है। छोटे से शुरू करें: वह प्रक्रिया पकड़ें जो आपने तीन बार समझाई, उसे परखें, और असली उपयोग में कमी दिखे तभी बढ़ाएँ।

## Anti-pattern सुधार

आम समस्याएँ और उनकी जगह क्या करें।

```text
Anti-pattern                          Instead
vague description                      what + when + trigger phrases, tested with real requests
1500-line SKILL.md                      short body; details in references/ loaded on demand
rule "always run prettier"              a hook (deterministic), not a hopeful sentence
every micro-step dictated               give goal, constraints, checks; let Claude adapt
no "how to verify"                      a verification step with a script or checklist
stale paths/commands                    update the skill in the same PR as the change
broad allowed-tools                     specific scripts only, read-only where possible
```

## जो skills कोई उपयोग नहीं करता उन्हें हटाएँ

अनुपयोगी skills फिर भी description tokens ख़र्चती हैं और ग़लती से trigger होने का जोखिम रखती हैं।

**Quiz:** किसी formatting नियम को हर संपादन के बाद बिना अपवाद लागू होना है। सबसे अच्छा क्या है?

- [ ] लंबा description
- [ ] Skill में एक वाक्य, इस आशा में कि Claude याद रखे
- [x] Hook जो formatter को निश्चित रूप से चलाता है
- [ ] बड़ी context window

*Answer:* Hook जो formatter को निश्चित रूप से चलाता है. जो नियम हमेशा टिकने चाहिए उनके लिए निश्चित प्रवर्तन उपयोग करें।
