मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)7.1k · #13512

tactical-ddd

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

यह स्किल AI से सॉफ़्टवेयर मॉडल की समीक्षा करवाती है, जिनमें बिज़नेस नियम गायब या बिखरे हों, फिर उन्हें रिफ़ैक्टर करवाती है ताकि नियम ऑब्जेक्ट्स के अंदर रहें। यह उन डेवलपर्स के लिए है जो चाहते हैं कि उनका डोमेन कोड अपने नियमों की रक्षा करे।

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

  • ✓जब आप AI से डोमेन मॉडल की कमज़ोर डिज़ाइन की समीक्षा या जाँच करवाना चाहते हैं।
  • ✓जब आपके डोमेन ऑब्जेक्ट सिर्फ़ डेटा रखते हैं और नियम दूसरी सर्विसेज़ में हैं।
  • ✓जब आप कोड को entities, value objects या aggregates में रिफ़ैक्टर करना चाहते हैं।

Skill का लिंक

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/tactical-ddd/SKILL.md

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

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

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

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

इस skill से मेरी मदद करो: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/tactical-ddd/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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

“हमारी order और invoice क्लासें देखिए और बताइए कि क्या वे सिर्फ़ डेटा का थैला हैं, और उसके लिए क्या करना चाहिए।”

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

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

AI पहले कमज़ोर मॉडल पहचानता और उन्हें अंक देता है, फिर तय करता है कि हर क्लास के लिए कौन सा डिज़ाइन हिस्सा ठीक है, और आपके कहने पर चरण-दर-चरण रिफ़ैक्टर करता है।

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

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

Tactical DDD — Rich Domain Modeling

Workflow

Determine the user's intent first:

Intent Phases to run
"validate / review / check / is this correct?" Phase 1 + 2 only → report findings, ask before refactoring
"fix / refactor / improve / clean up" Phase 1 + 2 + 3
"how should I design / model this?" Load reference.md directly

Phase 1 — Detect

Load detection.md and scan the target code for anemia signals. Produce a severity score and list of affected classes.

Phase 2 — Assess

For each affected class, determine the correct building block:

Has unique identity tracked over time? Has invariants tying multiple objects? → Building Block
Yes — Entity
No — Value Object
Yes (root) + children with shared invariants Yes Aggregate
Operation spans multiple Aggregates/doesn't belong to any — Domain Service

Prefer Value Objects over Entities. Prefer small Aggregates over large ones.

If intent was validate/review: stop here. Report findings using the output format below. Ask "Would you like me to apply these fixes?" before proceeding.

Phase 3 — Refactor

Load refactoring.md for step-by-step moves. Apply in this order:

  1. Replace setter chains with a single expressive method
  2. Move service logic into the Aggregate that owns it
  3. Add business guards at the top of each method
  4. Publish a Domain Event after each successful state change
  5. Replace primitive types with Value Objects

For deep pattern questions (boundary design, event modeling, service vs. entity decision), load reference.md.


Quick Anemia Signals (scan first)

public setX() / public setY()        → behaviour should be encapsulated
service.doX(entity, ...)              → logic likely belongs in entity
entity.setA(); entity.setB(); ...     → setter chain = missing intent method
no domain methods beyond getters      → pure data bag

Golden Rules

  1. Behaviour with data — Objects own both state and the operations that change it
  2. Ubiquitous Language — Method names come from the domain, not CRUD (commitTo, not setStatus)
  3. Small Aggregates — Root + Value Objects by default; add child Entities only for true invariants
  4. One transaction = one Aggregate — Cross-Aggregate rules use eventual consistency via Domain Events
  5. Reference by ID — Never hold object references to other Aggregates
  6. Value Objects first — Use Entities only when individual identity is essential
  7. Domain Services sparingly — Excessive services → anemic model
  8. Protect invariants — The Aggregate is the last line of defence; never trust the caller

Output Format

When reviewing code, report:

## Anemia Diagnosis: <ClassName>

Severity: [None | Mild | Moderate | Severe]

Issues:
- <description of problem>

Recommended refactoring:
- <specific move from refactoring.md>

When refactoring, show a before/after diff for each class touched.

अक्सर पूछे जाने वाले सवाल

क्या यह बिना पूछे कोड बदल देगी?

नहीं। समीक्षा माँगने पर यह नतीजे बताती है और बदलाव करने से पहले रुकती है।

anemic model क्या है?

वह क्लास जो डेटा रखती है, पर सारे बिज़नेस नियम कहीं और छोड़ देती है।

value objects क्या हैं?

छोटे ऑब्जेक्ट्स जिनकी अपनी पहचान नहीं होती, जैसे पैसे की रकम या पता।

जानकारी

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

Detects anemic domain models, validates and refactors them into rich domain models, and enforces tactical DDD patterns (Entities, Value Objects, Aggregates, Domain Services, Domain Events). Use when the user asks to validate, review, or check domain models or DDD code; detect anemia; refactor domain objects; improve encapsulation; or mentions terms like "anemic model", "rich domain", "aggregate", "value object", "domain event", "ubiquitous language", "is this good DDD", "does this follow DDD", or "check my domain". Do NOT use for module or service boundary design, architectural decomposition,

repo: tech-leads-club/agent-skills

लोकप्रियता

GitHub स्टार
7.1k
रैंकिंग में स्थान
#13512
लाइसेंस
—
अपडेट की गई
2/11/2026

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

0

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

कमेंट

  • …

इस repository की और skills

component-common-domain-detection

7.1k

यह आपके एजेंट को कोडबेस के कई हिस्सों में दोहराए गए बिज़नेस लॉजिक को ढूँढने और उन्हें मिलाने का तरीका सुझाने में मदद करती है।

कोडिंगसामान्य कोडिंग

component-flattening-analysis

7.1k

यह आपके एजेंट को गलत जगह रखा गया कोड ढूँढने और उलझे हुए कंपोनेंट फ़ोल्डर ढाँचे को सीधा करने में मदद करती है, ताकि हर चीज़ अपनी सही जगह रहे।

कोडिंगसामान्य कोडिंग

component-identification-sizing

7.1k

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

कोडिंगसामान्य कोडिंग

coupling-analysis

7.1k

यह आपके एजेंट को जाँचने में मदद करती है कि कोडबेस के हिस्से एक-दूसरे पर कितनी कसकर निर्भर हैं, और पहले कौन से जोड़ ढीले करने चाहिए।

कोडिंगसामान्य कोडिंग

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