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

ddd-aggregate

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

यह स्किल मौजूदा मॉड्यूल के भीतर एक aggregate के लिए शुरुआती कोड बनाती है। aggregate एक मुख्य बिज़नेस ऑब्जेक्ट है जो अपने नियमों की रक्षा करता है। यह उन सॉफ़्टवेयर टीमों के लिए है जो domain-driven design अपनाती हैं।

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

  • ✓जब आप मौजूदा मॉड्यूल में अपने नियमों वाली नई बिज़नेस अवधारणा जोड़ें।
  • ✓जब आपको entity, repository और इवेंट फ़ाइलें एक साथ बनानी हों।
  • ✓जब आप नए aggregate के मेल में टेस्ट स्टब बनवाना चाहें।

Skill का लिंक

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-ddd/skills/ddd-aggregate/SKILL.md

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

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

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

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

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

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

“मेरे सेल्स मॉड्यूल में एक नया Order aggregate बनाइए, जिसमें उसकी ID, repository और इवेंट हों।”

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

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

स्किल जाँचती है कि मॉड्यूल फ़ोल्डर मौजूद है, फिर entity फ़ाइल उसके नियमों के साथ लिखती है, साथ में एक ID value object, एक repository इंटरफ़ेस, domain इवेंट फ़ाइलें और टेस्ट स्टब बनाती है।

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

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

Scaffold a complete aggregate root inside a bounded context.

Parse $ARGUMENTS as <context-name> <aggregate-name> (both kebab-case). The context must already exist under src/.

Steps

  1. Validate: Confirm src/<context>/domain/ exists. If not, suggest running /ddd-context <context> first.

  2. Pre-task hook: npx @claude-flow/cli@latest hooks pre-task --description "DDD aggregate: <aggregate-name> in <context>"

  3. Create aggregate root entity:

    • File: src/<context>/domain/entities/<aggregate-name>.entity.ts
    • Include: unique ID field, constructor with invariant validation, domain methods that enforce business rules, equals() based on identity
    • Export a TypeScript class extending or implementing a base AggregateRoot interface
  4. Create value objects:

    • File: src/<context>/domain/value-objects/<aggregate-name>-id.value-object.ts
    • Include: immutable ID value object with factory method and validation
    • Add additional value objects as properties of the aggregate suggest them
  5. Create repository interface:

    • File: src/<context>/domain/repositories/<aggregate-name>.repository.ts
    • Include: findById, save, delete methods
    • Use the aggregate root and its ID value object as types
    • This is an interface only -- no implementation (infrastructure concern)
  6. Create domain events:

    • File: src/<context>/domain/events/<aggregate-name>-created.event.ts
    • File: src/<context>/domain/events/<aggregate-name>-updated.event.ts
    • Include: event name (past tense), timestamp, aggregate ID, payload
  7. Create unit test stubs:

    • File: src/<context>/domain/entities/<aggregate-name>.entity.test.ts
    • Include: test cases for construction invariants, domain methods, equality
    • Use describe/it with should [behavior] when [condition] names
  8. Update barrel exports: Add new files to the relevant index.ts barrel files.

  9. Store in domain model graph:

    mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store({ key: "domain/context-<context>/aggregate-<aggregate-name>", value: "Aggregate <aggregate-name> (parent: context-<context>)", tier: "semantic" })
    mcp__plugin_ruflo-core_ruflo__agentdb_causal-edge({ sourceId: "entity:context-<context>", targetId: "entity:aggregate-<aggregate-name>", relation: "contains" })
    mcp__plugin_ruflo-core_ruflo__memory_store({ key: "ddd-aggregate-<context>-<aggregate-name>", value: "AGGREGATE_SUMMARY", namespace: "tasks" })
    
  10. Post-task hook: npx @claude-flow/cli@latest hooks post-task --task-id "ddd-aggregate-<aggregate-name>" --success true

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

इस्तेमाल से पहले क्या मौजूद होना चाहिए?

bounded context फ़ोल्डर source फ़ोल्डर के नीचे पहले से होना चाहिए। न हो, तो स्किल पहले context बनाने का सुझाव देती है।

क्या यह storage का कोड लिखती है?

नहीं। repository सिर्फ़ एक इंटरफ़ेस है, और storage का कोड infrastructure परत पर छोड़ दिया जाता है।

यह किस भाषा में लिखती है?

यह TypeScript फ़ाइलें लिखती है, bounded context के फ़ोल्डर और नामकरण ढाँचे का पालन करते हुए।

जानकारी

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

Scaffold an aggregate root with entity, value objects, repository interface, domain events, and test stubs. Use when adding a new aggregate to an existing bounded context, modeling a new business concept that owns invariants, or generating the boilerplate for an entity + repo + events triplet.

repo: ruvnet/ruflo

लोकप्रियता

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

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

0

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

कमेंट

  • …

इस repository की और skills

agent-adaptive-coordinator

81k

आपके एजेंट को काम बदलने पर AI एजेंटों के समूह को बाँटने और फिर से संतुलित करने में मदद करती है, और काम के हिसाब से लेआउट चुनती है।

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

agent-agent

81k

आपके एजेंट को बड़े लक्ष्य को क्रमबद्ध कार्यों की योजना में बदलना सिखाती है, और स्थिति बदलने पर योजना फिर से बनाना भी।

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

agent-agentic-payments

81k

AI खरीदारी के लिए खर्च के आदेश मैनेज करने में मदद करती है, जिसमें खर्च की सीमा, समय अवधि, व्यापारी नियम और signed मंज़ूरियाँ शामिल हैं।

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

agent-analyze-code-quality

81k

आपके एजेंट को कोड की गुणवत्ता जाँचने में मदद करती है, बिना फ़ाइलें बदले code smells, technical debt और refactoring के सुझाव खोजकर।

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

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