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

principle-type-system-discipline

यह क्या करती है

यह स्किल असिस्टेंट को ऐसे टाइप डिज़ाइन करने का नियम देती है जो गलतियाँ जल्दी पकड़ें। यह स्टैटिकली टाइप की गई भाषाओं में काम करने वाले डेवलपर्स के लिए है।

कब इस्तेमाल करें

  • ✓जब आप टाइप डिज़ाइन करते हैं या फ़ंक्शन सिग्नेचर की समीक्षा करते हैं।
  • ✓जब दो मानों का टाइप एक है, पर उनका अर्थ अलग है।
  • ✓जब प्रोग्राम के बाहर से डेटा कोड में आता है।

Skill का लिंक

https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-type-system-discipline/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

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

इस skill से मेरी मदद करो: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-type-system-discipline/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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

“हमारे user ID और order ID दोनों सादे string हैं और अक्सर आपस में मिल जाते हैं। टाइप इतने कसे कीजिए कि कंपाइलर यह रोक दे।”

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

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

असिस्टेंट हर अर्थपूर्ण मान को अपना टाइप देता है, बाहरी डेटा को सीमा पर टाइप किए मॉडल में पार्स करता है, अनसँभले वेरिएंट से बिल्ड विफल करवाता है, और टाइप हाथ से लिखी प्रतियों के बजाय आधिकारिक schema से निकालता है।

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

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

Type System Discipline

Make the compiler reject impossible states, mismatched primitives, and unhandled variants. Prefer defining errors and special cases out of existence over proliferating handlers. For TypeScript syntax, see the typescript-best-practices skill.

  • Brand semantic primitives. UserId and OrderId are strings underneath but should not be interchangeable. Give each its own type, such as a branded intersection in TypeScript or a newtype elsewhere. Validate once at creation, trust the type downstream. If two arguments share a primitive type but mean different things, brand them.
  • External data is untyped until parsed. RPC payloads, JSON, IPC messages, CLI args, config files, environment variables, database rows. Have a parse function at every boundary that turns unstructured input into the typed model. The boundary-discipline principle skill says where to put validation.
  • Derive types from authoritative schemas. When a protocol buffer, OpenAPI spec, GraphQL schema, database migration, design-token file, or another file owns a shape, derive from it instead of hand-rolling a parallel type. See the encode-lessons-in-structure principle skill.
अक्सर पूछे जाने वाले सवाल

ब्रांडेड टाइप क्या है?

वह टाइप जो नीचे से string जैसा दिखे, पर दूसरे ID के साथ मिलाया न जा सके, ताकि कंपाइलर गलती पकड़े।

पार्सिंग कहाँ होती है?

हर सीमा पर, जैसे नेटवर्क पेलोड, कॉन्फ़िग फ़ाइलें, कमांड-लाइन आर्गुमेंट और डेटाबेस रो।

टाइप schema से क्यों निकालें?

ताकि प्रोटोकॉल फ़ाइल या माइग्रेशन का बनाया आकार हाथ से दोहराया न जाए और अलग होकर बिगड़ न जाए।

जानकारी

लेखक का मूल विवरण

Apply when designing types, reviewing a function signature, or writing code in any statically-typed language. Make illegal states unrepresentable, brand semantic primitives, parse external data at boundaries, exhaust variants, derive from authoritative schemas.

repo: cursor/plugins

लोकप्रियता

GitHub स्टार
15k
रैंकिंग में स्थान
#10991
लाइसेंस
—
अपडेट की गई
31/10/2026

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

0

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

कमेंट

  • …

इस repository की और skills

advisor

15k

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

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

check-agent-compatibility

15k

जाँचती है कि AI कोडिंग एजेंट किसी रिपॉज़िटरी को शुरू, सत्यापित और दस्तावेज़ित कर सकते हैं या नहीं, और एक अनुकूलता स्कोर के साथ मुख्य समस्याएँ लौटाती है।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

cli-for-agents

15k

आपके एजेंट को कमांड-लाइन टूल ऐसे डिज़ाइन या जाँचना सिखाती है कि AI एजेंट उन्हें बिना प्रॉम्प्ट चला सकें, साफ़ help टेक्स्ट और उदाहरणों के साथ।

कोडिंगAPI और सर्वर (backend)

continual-learning

15k

पिछली चैट की समीक्षा का काम एक समर्पित मेमोरी अपडेटर को सौंपकर आपकी AGENTS.md नोट्स को अद्यतन रखती है।

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

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