principle-model-the-domain
यह क्या करती है
यह स्किल असिस्टेंट को स्टेटफ़ुल लॉजिक को डोमेन से मेल खाने वाली संरचनाओं में मॉडल करने का नियम देती है। यह उन इंजीनियरों के लिए है जिनके कोड में फ़्लैग और नेस्टेड शर्तें भरी हैं।
कब इस्तेमाल करें
- ✓जब आप लाइफ़साइकल या चरणों वाला स्टेटफ़ुल लॉजिक लिख रहे हैं।
- ✓जब कोड में भारी ब्रांचिंग हो या फ़ाइलों में एक जैसी आकार वाली मान्यताएँ दोहराई जाती हों।
- ✓जब अमान्य स्टेट बार-बार सिस्टम में घुस रही हों।
Skill का लिंक
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-model-the-domain/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारा ऑर्डर फ़्लो स्टेटस दिखाने के लिए booleans के ढेर का इस्तेमाल करता है। इसे ठीक से मॉडल कीजिए, ताकि असंभव स्टेट बन ही न सकें।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
असिस्टेंट असली स्टेट और नियम पहचानता है, फिर उन्हें उपयुक्त संरचना में कोड करता है, जैसे state machine, टाइप किया हुआ मॉडल या lookup table। इससे कई ब्रांच हट जाती हैं और अमान्य स्टेट लिखना कठिन हो जाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Model the Domain
Encode the real domain in a data structure instead of scattering it across conditionals. A structure that matches the domain makes invalid states unrepresentable and deletes branches. Choosing it at write time is cheap. Recovering it later reads as a refactor and gets deferred.
Reach for:
- A state machine instead of scattered booleans, phases, or lifecycle checks.
- A typed model instead of loose parameters or repeated shape assumptions.
- A map, registry, lookup table, or discriminated union instead of branching spread across files.
- A reducer or command/event model instead of ad hoc state mutations.
- A module organized around one body of domain knowledge instead of a sequence such as load, validate, transform, and save. Execution order is not ownership.
- A small module boundary that gathers repeated behavior, ownership, or invariants.
- A queue, cache, index, graph, tree, or normalized collection where the access pattern calls for it.
- Any other structure that fits. When none fits, work out what the code must never allow and how the data gets read, then find the structure that encodes exactly that.
Do not force an abstraction. Prefer boring code if the current shape is already clear, local, and unlikely to grow. Be skeptical of an abstraction that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk.
The sign that you skipped this is a new feature that grows an existing if/else chain by one more branch, or a second boolean that must stay in sync with the first. Temporal decomposition is another sign. Phase-named modules repeat the same domain rules across steps.
अक्सर पूछे जाने वाले सवाल
क्या हर समस्या को नई संरचना चाहिए?
नहीं। स्किल कहती है कि जब मौजूदा आकार साफ़ हो और उसके बढ़ने की संभावना कम हो, तो सादा कोड पसंद करें।
एक आम उदाहरण क्या है?
बिखरे booleans की जगह एक state machine रखना जो केवल मान्य ट्रांज़िशन की अनुमति दे।
संरचना जल्दी क्यों चुनें?
लिखते समय यह सस्ता है, जबकि बाद में सही संरचना खोजना अक्सर टलता है और ज़्यादा महँगा पड़ता है।
जानकारी
लेखक का मूल विवरण
Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.
repo: cursor/plugins
लोकप्रियता
- GitHub स्टार
- 15k
- रैंकिंग में स्थान
- #10982
- लाइसेंस
- —
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
advisor
15kअगर आप इसे चालू करते हैं, तो आपका एजेंट बड़े फ़ैसले से पहले या किसी त्रुटि में अटकने पर एक ज़्यादा शक्तिशाली दूसरे मॉडल से सलाह ले सकता है।
check-agent-compatibility
15kजाँचती है कि AI कोडिंग एजेंट किसी रिपॉज़िटरी को शुरू, सत्यापित और दस्तावेज़ित कर सकते हैं या नहीं, और एक अनुकूलता स्कोर के साथ मुख्य समस्याएँ लौटाती है।
cli-for-agents
15kआपके एजेंट को कमांड-लाइन टूल ऐसे डिज़ाइन या जाँचना सिखाती है कि AI एजेंट उन्हें बिना प्रॉम्प्ट चला सकें, साफ़ help टेक्स्ट और उदाहरणों के साथ।
continual-learning
15kपिछली चैट की समीक्षा का काम एक समर्पित मेमोरी अपडेटर को सौंपकर आपकी AGENTS.md नोट्स को अद्यतन रखती है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।