pit-of-success
यह क्या करती है
यह AI को ऐसे API कॉल, setter और props ढूँढने के चरण समझाती है जिनका गलत इस्तेमाल हो सकता है, फिर ज़रूरी व्यवहार को साझा कोड में ले जाती है। यह कोड की समीक्षा या रीफ़ैक्टर करने वाले डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब किसी API, setter या कंपोनेंट prop में ऐसा जाल हो जिसमें सामान्य कॉल फँस सकती है।
- ✓जब आप कोड को ऐसे रीफ़ैक्टर करते हैं कि सुरक्षित रास्ता डिफ़ॉल्ट रास्ता बन जाए।
- ✓जब आप दोहराए गए helpers या wrappers की जगह एक साझा इम्प्लीमेंटेशन चाहते हैं।
Skill का लिंक
https://github.com/trycompai/crm/blob/release/.agents/skills/pit-of-success/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“यह setter तब टूटता है जब कोई null भेजता है। क्या आप कोड बदल सकते हैं ताकि सामान्य कॉल हमेशा काम करे?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI सार्वजनिक एंट्री पॉइंट के हर caller को खोजता है, जाँचता है कि सामान्य कॉल व्यवहार तोड़ती है या नहीं, फिर नियम को साझा कोड में ले जाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Pit of Success
Make misuse hard and the obvious call correct.
Steps
- Find the public seam being used: exported function, hook return value, setter, component prop, route body, schema, or command. Then search every caller of that seam. Done when you know the natural call a future maintainer would write.
- Run the footgun test: “If someone does the obvious thing without knowing the hidden helper or convention, does behavior break?” Examples:
setSelection(null)should mean the product’s normal clear behavior; a schema should reject states the UI never wants; a prop should not require sibling props in the right combo. - Move the invariant into the seam. Prefer, in order:
- make the existing API do the safe thing,
- narrow the type/schema so bad states cannot be represented,
- rename/split the API so the dangerous path is explicit,
- only then add a helper, and only if all natural callers use it.
- Delete bypasses and duplicate meanings. Replace local wrappers, parallel helper names, and comments that explain the trap with one shared implementation at the seam.
- Prove the pit with one check: a focused test or type/schema assertion showing the obvious call now preserves behavior, plus a grep confirming no caller still uses the old footgun.
Rules
- Do not fix only the named callsite. If the seam is wrong, fix the seam.
- Do not rely on “remember to call this helper first” when callers can still call the raw API.
- Do not add comments as a substitute for making misuse impossible or obvious.
- Keep the diff boring: one invariant, one owner, no speculative abstraction.
- If compatibility prevents changing the seam, name the dangerous API accordingly and expose a safe default API beside it.
अक्सर पूछे जाने वाले सवाल
क्या यह सिर्फ़ एक कॉल साइट ठीक करती है?
नहीं। जब API ही गलत हो, तो स्किल कहती है कि एक caller के बजाय साझा सीम ठीक करें।
यह किस क्रम में सुधार पसंद करती है?
पहले मौजूदा API को सुरक्षित बनाना, फिर टाइप सीमित करना, फिर API बाँटना, और helpers सबसे आख़िर में जोड़ना।
सुधार का सबूत कैसे मिलता है?
एक केंद्रित टेस्ट या टाइप जाँच से दिखाया जाता है कि सामान्य कॉल अब काम करती है, और खोज से पुष्टि होती है कि पुराने caller नहीं बचे।
जानकारी
लेखक का मूल विवरण
Review or refactor code so the correct behavior is the default path; use when APIs, setters, hooks, helpers, or component props have footguns where a natural call bypasses required semantics.
repo: trycompai/crm
लोकप्रियता
- GitHub स्टार
- 12k
- रैंकिंग में स्थान
- #11523
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
ai-elements
12kयह आपके एजेंट को बातचीत, संदेश, टूल डिस्प्ले और प्रॉम्प्ट इनपुट के लिए तैयार कॉम्पोनेंट से AI चैट इंटरफ़ेस बनाने में मदद करती है।
ai-sdk
12kयह आपके एजेंट को Vercel AI SDK से AI फ़ीचर बनाने में मदद करती है, जिसमें टेक्स्ट जनरेशन, स्ट्रीमिंग, टूल कॉलिंग और एजेंट शामिल हैं।
better-accessibility
12kयह आपके एजेंट को इंटरफ़ेस को कीबोर्ड और स्क्रीन रीडर के लिए उपयोगी बनाने में मदद करती है, जिसमें फ़ोकस, लेबल, ARIA और फ़ॉर्म शामिल हैं।
better-auth-best-practices
12kयह आपके एजेंट को TypeScript ऐप में लॉगिन, सेशन, OAuth और प्लगइन के लिए Better Auth सेट करने में मदद करती है, उसके दस्तावेज़ी चरणों के अनुसार।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।