ddd-architecture
Skill0 starsChanged 23 days agoMITView on GitHub
Domain-Driven Design patterns for bounded contexts, aggregates, and ubiquitous language.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- Hive-Academy/PtahCodetheir own version, first seen Nov 8, 2026
- Hive-Academy/ptah-extensiontheir own version, first seen Nov 3, 2026
- Gvidon-Solutions/agentops-backend-kittheir own version, first seen Oct 11, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Hive-Academy/ptah-extension★ 34same name
- Hive-Academy/PtahCode★ 34same name
- Gvidon-Solutions/agentops-backend-kit★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- api-designSkill
- arch-constraint-guardSkill
- backend-patternsSkill
- clean-architectureSkill
- codebase-mappingSkill
- context-budgetSkill
- cqrsSkill
- debug-flowSkill
- dependency-auditSkill
- django-patternsSkill
- django-tddSkill
- event-driven-architectureSkill
- fd-codenavSkill
- fd-mapSkill
- frontend-patternSkill
- git-releaseSkill
- git-workflowSkill
- golang-patternsSkill
- hexagonal-architectureSkill
- java-patternsSkill
- layered-architectureSkill
- performance-profilingSkill
- postgres-patternsSkill
- python-patternsSkill
- refactor-guideSkill
- research-firstSkill
- rust-patternsSkill
- saga-architectureSkill
- security-scanSkill
- tdd-workflowSkill
- test-gap-detectorSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
When modeling complex business domains where deep understanding of the problem space, ubiquitous language, and bounded contexts are …
- Distinctive: line 14
Build the domain model: - Create entities, value objects, aggregates, and domain events that reflect real business concepts.
- Distinctive: line 18
Define repository interfaces: - Create ports for persisting and retrieving aggregates (implementation is infrastructure).
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ddd-architecture
When to Activate
When modeling complex business domains where deep understanding of the problem space, ubiquitous language, and bounded contexts are critical for long-term maintainability.
Steps
- Establish the bounded context - Identify the explicit boundary within which a single model (ubiquitous language) holds.
- Build the domain model - Create entities, value objects, aggregates, and domain events that reflect real business concepts.
- Define aggregates - Group related entities and value objects under a root aggregate that enforces invariants.
- Identify domain events - Capture meaningful business occurrences that other parts of the system may need to react to.
- Create domain services - Model operations that don't naturally belong to a single entity or value object.
- Define repository interfaces - Create ports for persisting and retrieving aggregates (implementation is infrastructure).
- Implement application services - Orchestrate the domain model, handle transactions, and coordinate multiple aggregates.
- Establish anti-corruption layers - Translate between external systems (legacy, third-party) and your domain model.
Examples
// Value Object - Immutable concept with equality
class Money {
constructor(
public readonly amount: number,
public readonly currency: Currency
) {}
static of(amount: number, currency: Currency): Money {
return new Money(Math.round(amount * 100) / 100, currency)
}
add(other: Money): Money {
if (this.currency !== other.currency) {
throw new Error('Currency mismatch')
}
return Money.of(this.amount + other.amount, this.currency)
}
}
// Aggregate Root - Enforces invariants for the aggregate
class Order extends AggregateRoot {
constructor(
private readonly id: OrderId,
private readonly customer: Customer,
private items: OrderItem[],
private status: OrderStatus
) {
super()
this.validate()
}
private validate(): void {
if (this.items.length === 0) {
throw new DomainException('Order must have at least one item')
}
}
get total(): Money {
return this.items.reduce(
(sum, item) => sum.add(item.subtotal),
Money.of(0, Currency.USD)
)
}
// Business methods that enforce invariants
addItem(item: OrderItem): void {
if (this.status !== OrderStatus.DRAFT) {
throw new DomainException('Cannot add items to a non-draft order')
}
this.items.push(item)
this.addDomainEvent(new OrderItemAddedEvent(this.id, item))
}
submit(): void {
if (!this.canSubmit()) {
throw new DomainException('Order cannot be submitted')
}
this.status = OrderStatus.SUBMITTED
this.addDomainEvent(new OrderSubmittedEvent(this))
}
private canSubmit(): boolean {
return this.status === OrderStatus.DRAFT && this.items.length > 0
}
}
// Domain Event - Business facts that may trigger reactions
class OrderSubmittedEvent extends DomainEvent {
constructor(public readonly order: Order) {
super('order.submitted', order.id)
}
}
// Repository Interface (Port) - Persistence abstraction
interface OrderRepository {
findById(id: OrderId): Promise<Order | null>
findByCustomer(customerId: CustomerId): Promise<Order[]>
save(order: Order): Promise<void>
}Related Skills
- clean-architecture
- hexagonal-architecture
- layered-architecture
- saga-architecture
- backend-patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

