java-architecture

Standardize Spring Boot 3+ Java project architecture with layered modules and CQRS.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/tassosgomes/poc-iam-service --skill java-architecture-tassosgomes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-architecture
Source: https://github.com/tassosgomes/poc-iam-service/tree/main/.github/skills/java/java-architecture
Command: npx skills add https://github.com/tassosgomes/poc-iam-service --skill java-architecture-tassosgomes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defines mandatory architectural standards and project structure for Java Spring Boot 3+ / Java 21, enabling consistent, maintainable codebases across modules.

Core Features & Use Cases

  • Standardized layered architecture (domain, application, api, infra) with clear responsibilities.
  • CQRS with type-safe dispatchers, explicit handlers and no reflection.
  • Guidelines for packaging, module structure, MapStruct mappers, and centralized error handling (DomainException, GlobalExceptionHandler, RFC 7807).

Quick Start

Follow these conventions to structure a new Java service: create modules Domain/Application/API/Infra with Maven, implement a type-safe dispatcher-based CQRS, and apply the provided error handling and MapStruct mappers.

Frequently Asked Questions about java-architecture

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

FAQPage Schema
How do I structure a Spring Boot 3 project with hexagonal architecture and CQRS?

Structure a Spring Boot 3 project by creating separate Maven modules for domain, application, api, and infra layers, implementing a type-safe dispatcher for CQRS without reflection, and enforcing clear module dependency rules for maintainable codebases.

What is the best way to enforce clean architecture separation in a Java 21 application?

Enforcing clean architecture in a Java 21 application requires codifying domain, application, api, and infra layer separation with explicit responsibilities, ensuring a domain-free domain layer and transactional use cases to standardize project structure.

Can I use MapStruct mappers and RFC 7807 error responses in a multi-module Maven setup?

Yes, you can use MapStruct mappers and RFC 7807 error responses in a multi-module Maven setup by applying centralized error handling with DomainException and GlobalExceptionHandler across your standardized Java Spring Boot architecture.

Does the type-safe CQRS dispatcher require reflection in Spring Boot?

No, the type-safe CQRS dispatcher requires no reflection, using explicit handlers to manage command and query separation within the application layer of your Spring Boot 3 multi-module architecture.

Why use a standardized architectural blueprint for Java Spring services?

A standardized architectural blueprint for Java Spring services solves inconsistent codebases by defining mandatory architectural standards, enabling consistent domain/application/api/infra separation and error handling across new modules.

When should I not use hexagonal architecture for my Java Spring Boot application?

Avoid hexagonal architecture for simple Java Spring Boot applications where the overhead of multi-module Maven separation, explicit CQRS dispatchers, and strict domain-free domain layers outweighs maintainability benefits.