Skip to content

n7tequila/DDD-Patterns-for-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Domain-Driven Design Skill

This repository contains a Codex/Claude skill for designing and implementing Java systems with Domain-Driven Design.

The skill is intended for tasks such as:

  • Java backend architecture with bounded contexts
  • aggregate and value object modeling
  • Spring Boot service design with clear layer boundaries
  • anti-corruption layer design
  • shared kernel and published contracts decisions
  • query-side/read-model design
  • saga and eventual consistency workflows
  • modular monolith or multi-module project structure

Location

The skill lives in:

java-domain-driven-design/

Key files:

  • java-domain-driven-design/SKILL.md
  • java-domain-driven-design/agents/openai.yaml
  • java-domain-driven-design/references/*.md

What The Skill Covers

The skill defines guidance for:

  • strategic design: bounded contexts, context relationships, ownership
  • tactical design: entities, value objects, aggregates, repositories, domain services, domain events
  • layering: domain, application, infrastructure, interfaces
  • anti-corruption layers for foreign models
  • assemblers for boundary-local type conversion
  • shared kernel versus contracts
  • query side versus write side
  • transaction boundaries, eventual consistency, sagas
  • testing strategy and error handling
  • Maven and Gradle multi-module layouts

Core Principles

  • Keep domain language and business invariants at the center.
  • Protect bounded contexts from foreign models with ACLs.
  • Keep shared-kernel thin and stable.
  • Keep contracts separate from local domain models.
  • Keep assemblers pure and close to the boundary they serve.
  • Keep read models separate from write-side aggregate concerns when needed.
  • Keep strong consistency inside aggregate boundaries and use events or sagas across boundaries.

Recommended Structure

For medium or large systems, the skill recommends:

  • shared-kernel
  • optional contracts
  • one module per bounded context
  • one app or bootstrap module

Both Maven and Gradle examples are documented in:

  • java-domain-driven-design/references/build-structures.md

How To Use With Codex Or Claude

Example prompt:

Use $java-domain-driven-design to design a Java modular monolith for order, inventory, and payment management with bounded contexts, aggregates, ACLs, contracts, query models, and a Spring Boot app module.

You can also use it for smaller requests, for example:

Use $java-domain-driven-design to refactor this Spring Boot order service into proper aggregates, application services, repository ports, persistence adapters, and request/response assemblers.

Validation

The skill has been validated with the skill validator and is currently in a valid state.

License

This repository is licensed under the MIT License. See LICENSE.

Notes

This repository now includes a user-facing README.md for navigation, but the skill itself is driven by:

  • SKILL.md for model instructions
  • agents/openai.yaml for invocation metadata
  • references/ for progressive disclosure

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors