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
The skill lives in:
java-domain-driven-design/
Key files:
java-domain-driven-design/SKILL.mdjava-domain-driven-design/agents/openai.yamljava-domain-driven-design/references/*.md
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
- Keep domain language and business invariants at the center.
- Protect bounded contexts from foreign models with ACLs.
- Keep
shared-kernelthin 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.
For medium or large systems, the skill recommends:
shared-kernel- optional
contracts - one module per bounded context
- one
apporbootstrapmodule
Both Maven and Gradle examples are documented in:
java-domain-driven-design/references/build-structures.md
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.
The skill has been validated with the skill validator and is currently in a valid state.
This repository is licensed under the MIT License. See LICENSE.
This repository now includes a user-facing README.md for navigation, but the skill itself is driven by:
SKILL.mdfor model instructionsagents/openai.yamlfor invocation metadatareferences/for progressive disclosure