मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग12k · #11523

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/trycompai/crm/blob/release/.agents/skills/pit-of-success/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“यह setter तब टूटता है जब कोई null भेजता है। क्या आप कोड बदल सकते हैं ताकि सामान्य कॉल हमेशा काम करे?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI सार्वजनिक एंट्री पॉइंट के हर caller को खोजता है, जाँचता है कि सामान्य कॉल व्यवहार तोड़ती है या नहीं, फिर नियम को साझा कोड में ले जाता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Pit of Success

Make misuse hard and the obvious call correct.

Steps

  1. 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.
  2. 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.
  3. 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.
  4. Delete bypasses and duplicate meanings. Replace local wrappers, parallel helper names, and comments that explain the trap with one shared implementation at the seam.
  5. 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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

ai-elements

12k

यह आपके एजेंट को बातचीत, संदेश, टूल डिस्प्ले और प्रॉम्प्ट इनपुट के लिए तैयार कॉम्पोनेंट से AI चैट इंटरफ़ेस बनाने में मदद करती है।

कोडिंगवेबसाइट और UI (frontend)

ai-sdk

12k

यह आपके एजेंट को Vercel AI SDK से AI फ़ीचर बनाने में मदद करती है, जिसमें टेक्स्ट जनरेशन, स्ट्रीमिंग, टूल कॉलिंग और एजेंट शामिल हैं।

AI और एजेंटएजेंट

better-accessibility

12k

यह आपके एजेंट को इंटरफ़ेस को कीबोर्ड और स्क्रीन रीडर के लिए उपयोगी बनाने में मदद करती है, जिसमें फ़ोकस, लेबल, ARIA और फ़ॉर्म शामिल हैं।

डिज़ाइनइंटरफ़ेस (UI/UX)

better-auth-best-practices

12k

यह आपके एजेंट को TypeScript ऐप में लॉगिन, सेशन, OAuth और प्लगइन के लिए Better Auth सेट करने में मदद करती है, उसके दस्तावेज़ी चरणों के अनुसार।

कोडिंगसिक्योरिटी

मिलती-जुलती skills