architecture

Structure Java Spring applications with hexagonal architecture, DDD, CQRS, and event sourcing.

3|2|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/taipt1504/agent-skills --skill architecture-taipt1504
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture
Source: https://github.com/taipt1504/agent-skills/tree/main/skills/architecture
Command: npx skills add https://github.com/taipt1504/agent-skills --skill architecture-taipt1504

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hexagonal architecture, DDD, CQRS, and event sourcing for Java Spring applications. Use when designing package structure, creating Aggregate Roots or Value Objects, implementing ports and adapters, setting up CQRS command/query separation, wiring domain events, writing ArchUnit tests, or creating solution architecture documents and ADRs.

Core Features & Use Cases

  • Hexagonal layering guidance for Domain, Application, and Infrastructure boundaries.
  • Domain-Driven Design concepts (Aggregate Roots, Value Objects, Domain Events) with pragmatic examples.
  • CQRS patterns (command/query separation) and event-sourcing considerations.
  • ArchUnit-based governance for dependency rules and ADR/solution design references.

Quick Start

Run the standard architecture workshop by adopting hexagonal patterns and CQRS in your Java Spring project.

Frequently Asked Questions about architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Java Spring application using hexagonal architecture and DDD?

Structure your Java Spring application by defining clear boundaries between Domain, Application, and Infrastructure layers. Implement DDD concepts like Aggregate Roots and Value Objects, and wire ports and adapters to isolate domain logic from external dependencies.

What is the best way to enforce dependency direction rules in a hexagonal architecture codebase?

The best way to enforce dependency direction is by writing ArchUnit tests. These governance constraints automatically verify that infrastructure packages depend on domain ports, preventing incorrect layering and ensuring testability across the codebase.

How do I set up CQRS command and query separation in a Spring project?

Set up CQRS by separating your application services into distinct command and query handlers. This pattern isolates write operations from read operations, allowing you to optimize domain event processing and state mutations independently of query retrieval.

Does hexagonal architecture work for small Java Spring codebases or is it only for large projects?

Hexagonal architecture works for Java Spring codebases of varying sizes. It provides pragmatic layering guidance, ensuring clear dependency direction and testability whether you are building a small modular service or a large complex domain model.

When should I implement event sourcing alongside CQRS in my domain model?

Implement event sourcing alongside CQRS when you need to persist state as a sequence of domain events. This combination allows you to reconstruct aggregate states from event logs while maintaining strict command and query separation.