Create Spring Modulith Skill for Java Plugin
Overview
Implement a new Spring Modulith skill for the Java plugin to provide developers with comprehensive knowledge and patterns for building modular monolithic applications. This skill should enable validation of module boundaries, automatic architecture diagram generation, and best practices for implementing domain-driven modular architectures.
Problem Statement
Many enterprises are transitioning away from microservices back to Modular Monoliths as a more pragmatic architectural approach. However, developers often lack guidance on:
- How to properly structure applications into logical, domain-aligned modules
- Validating and enforcing module boundaries at compile-time and test-time
- Visualizing application architecture and module dependencies
- Implementing event-driven inter-module communication with guaranteed delivery
- Testing individual modules in isolation
This skill will address these gaps by providing practical patterns and automated tooling for Spring Modulith.
Objectives
The skill should deliver:
-
Module Structure Validation
- Teach how to use
ApplicationModules API to analyze and verify module structure
- Provide patterns for defining module boundaries using package organization
- Explain module configuration with
@Modulith and @ApplicationModule annotations
- Demonstrate validation of architectural constraints (no cycles, no internal access violations)
-
ArchUnit Integration
- Show how to integrate ArchUnit for compile-time and test-time module verification
- Provide reusable ArchUnit rules for enforcing module boundaries
- Demonstrate hexagonal architecture patterns with driving/driven ports
- Include examples of package structure following architectural principles
-
Automated Documentation & Diagrams
- Generate PlantUML architecture diagrams from module structure
- Create module dependency graphs automatically
- Document module public APIs and internal components
- Generate architecture documentation snippets
-
Event-Driven Inter-Module Communication
- Explain
@ApplicationModuleListener for transactional event handling
- Demonstrate guaranteed event delivery using
EventPublicationRegistry
- Show how to handle incomplete/failed event publications
- Provide patterns for async communication between modules
-
Module Integration Testing
- Teach
@ApplicationModuleTest for isolated module testing
- Demonstrate different bootstrap modes (STANDALONE, DIRECT_DEPENDENCIES, ALL_DEPENDENCIES)
- Show the
Scenario DSL for event-driven testing
- Provide examples of testing module interactions
-
Best Practices & Patterns
- Modular thinking from application start
- Domain-aligned module organization
- Public API design for modules
- Dependency management and avoiding circular dependencies
- Module observability with Micrometer at module level
Reference Materials
Skill Content Structure
The skill should include:
1. Foundational Concepts
- What is a Modular Monolith and why it matters
- Comparison with microservices and monolithic architectures
- Benefits of Spring Modulith approach
2. Module Structure & Organization
- Defining modules through package hierarchy
- Module public APIs and internal components
- Module configuration and metadata
- Shared modules and cross-cutting concerns
3. Validation & Verification
- Using
ApplicationModules for structure analysis
- ArchUnit rules for boundary enforcement
- Compile-time vs. runtime verification
- Detecting and preventing architectural violations
4. Architecture Documentation
- Generating PlantUML diagrams
- Module dependency visualization
- Architecture documentation generation
- Keeping documentation in sync with code
5. Event-Driven Communication
- Publishing events between modules
- Guaranteed delivery patterns
- Event listener configuration
- Handling failed publications
6. Testing Strategies
- Unit testing within modules
- Integration testing with
@ApplicationModuleTest
- Testing module interactions with
Scenario
- Different bootstrap modes for different test scenarios
7. Practical Examples
- Complete e-commerce system example
- Order management module
- Inventory management module
- Payment processing module
- Inter-module event flows
8. Common Pitfalls & Solutions
- Circular dependencies between modules
- Leaking internal implementations
- Improper event handling
- Testing isolation issues
Acceptance Criteria
Implementation Notes
- Focus on practical, production-ready patterns
- Provide copy-paste ready code examples
- Include both simple and advanced scenarios
- Ensure examples work with current Spring Boot and Spring Modulith versions
- Consider different application sizes (small, medium, large)
- Include performance considerations for module verification
Related Issues
This skill complements existing Java plugin skills and provides enterprise-grade architectural guidance for building maintainable, scalable applications.
Labels
enhancement
skill
java
spring-modulith
architecture
pattern
Create Spring Modulith Skill for Java Plugin
Overview
Implement a new Spring Modulith skill for the Java plugin to provide developers with comprehensive knowledge and patterns for building modular monolithic applications. This skill should enable validation of module boundaries, automatic architecture diagram generation, and best practices for implementing domain-driven modular architectures.
Problem Statement
Many enterprises are transitioning away from microservices back to Modular Monoliths as a more pragmatic architectural approach. However, developers often lack guidance on:
This skill will address these gaps by providing practical patterns and automated tooling for Spring Modulith.
Objectives
The skill should deliver:
Module Structure Validation
ApplicationModulesAPI to analyze and verify module structure@Modulithand@ApplicationModuleannotationsArchUnit Integration
Automated Documentation & Diagrams
Event-Driven Inter-Module Communication
@ApplicationModuleListenerfor transactional event handlingEventPublicationRegistryModule Integration Testing
@ApplicationModuleTestfor isolated module testingScenarioDSL for event-driven testingBest Practices & Patterns
Reference Materials
Spring Modulith Core Concepts: https://context7.com/spring-projects/spring-modulith/llms.txt
ArchUnit Integration Guide: https://context7.com/clutcher/spring-modulith-module-archunit/llms.txt
Skill Content Structure
The skill should include:
1. Foundational Concepts
2. Module Structure & Organization
3. Validation & Verification
ApplicationModulesfor structure analysis4. Architecture Documentation
5. Event-Driven Communication
6. Testing Strategies
@ApplicationModuleTestScenario7. Practical Examples
8. Common Pitfalls & Solutions
Acceptance Criteria
Implementation Notes
Related Issues
This skill complements existing Java plugin skills and provides enterprise-grade architectural guidance for building maintainable, scalable applications.
Labels
enhancementskilljavaspring-modulitharchitecturepattern