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 पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
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
Validate: Confirm
src/<context>/domain/exists. If not, suggest running/ddd-context <context>first.Pre-task hook:
npx @claude-flow/cli@latest hooks pre-task --description "DDD aggregate: <aggregate-name> in <context>"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
AggregateRootinterface
- File:
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
- File:
Create repository interface:
- File:
src/<context>/domain/repositories/<aggregate-name>.repository.ts - Include:
findById,save,deletemethods - Use the aggregate root and its ID value object as types
- This is an interface only -- no implementation (infrastructure concern)
- File:
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
- File:
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/itwithshould [behavior] when [condition]names
- File:
Update barrel exports: Add new files to the relevant
index.tsbarrel files.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" })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
कमेंट
- …
इस repository की और skills
agent-adaptive-coordinator
81kआपके एजेंट को काम बदलने पर AI एजेंटों के समूह को बाँटने और फिर से संतुलित करने में मदद करती है, और काम के हिसाब से लेआउट चुनती है।
agent-agent
81kआपके एजेंट को बड़े लक्ष्य को क्रमबद्ध कार्यों की योजना में बदलना सिखाती है, और स्थिति बदलने पर योजना फिर से बनाना भी।
agent-agentic-payments
81kAI खरीदारी के लिए खर्च के आदेश मैनेज करने में मदद करती है, जिसमें खर्च की सीमा, समय अवधि, व्यापारी नियम और signed मंज़ूरियाँ शामिल हैं।
agent-analyze-code-quality
81kआपके एजेंट को कोड की गुणवत्ता जाँचने में मदद करती है, बिना फ़ाइलें बदले code smells, technical debt और refactoring के सुझाव खोजकर।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।