diff --git a/skills-generator/src/main/resources/skill-indexes/305-skill.xml b/skills-generator/src/main/resources/skill-indexes/305-skill.xml new file mode 100644 index 00000000..ca17c24a --- /dev/null +++ b/skills-generator/src/main/resources/skill-indexes/305-skill.xml @@ -0,0 +1,59 @@ + + + + Juan Antonio Breña Moral + 0.15.0 + Apache-2.0 + Use when you need to design, review, or improve modular monoliths with Spring Modulith in Spring Boot applications - including application module package structure, ApplicationModules verification, named interfaces, allowed dependencies, domain events, @ApplicationModuleTest, Scenario-based module tests, generated documentation, actuator exposure, observability, and event publication registry choices. This should trigger for requests such as Add Spring Modulith to a Spring Boot application; Review Spring Modulith module boundaries; Improve modular monolith architecture in Spring Boot; Add @ApplicationModuleTest tests; Generate Spring Modulith documentation. + + + Spring Boot - Spring Modulith + + + + Before applying Spring Modulith changes, ensure the project compiles. After improvements, run full verification including module structure tests. + + **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change + **PRECONDITION**: The project must be a Spring Boot application; for non-Boot Java modularity use architecture or design skills instead + **BASELINE**: Align dependency choices with Spring Boot 4.0.x and the Spring Modulith compatibility matrix + **SAFETY**: If compilation fails, stop immediately + **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements + **BEFORE APPLYING**: Read the reference for detailed rules, good/bad patterns, and official documentation links + + + + + + Add Spring Modulith to a Spring Boot application + Review Spring Modulith module boundaries + Improve modular monolith architecture in Spring Boot + Add @ApplicationModuleTest tests + Generate Spring Modulith documentation + Refactor Spring Boot modules with Spring Modulith + + + + + Read reference and inspect project structureRead `references/305-frameworks-spring-boot-modulith.md` and inspect the Spring Boot version, Maven dependencies, main application package, and current package/module boundaries. + Model application modulesIdentify business-capability modules, public APIs, internal packages, named interfaces, and intentional allowed dependencies. + Apply framework-aligned changesAdd or refine Spring Modulith dependencies, package annotations, architecture verification tests, domain events, and module tests following the reference patterns. + Run verification and report resultsExecute appropriate build/tests, especially `ApplicationModules.verify()` and `@ApplicationModuleTest` coverage, then summarize changes, risks, and follow-up module design work. + + diff --git a/skills-generator/src/main/resources/skill-references/305-frameworks-spring-boot-modulith.xml b/skills-generator/src/main/resources/skill-references/305-frameworks-spring-boot-modulith.xml new file mode 100644 index 00000000..b638ce2b --- /dev/null +++ b/skills-generator/src/main/resources/skill-references/305-frameworks-spring-boot-modulith.xml @@ -0,0 +1,356 @@ + + + + Juan Antonio Breña Moral + 0.15.0 + Apache-2.0 + Spring Boot - Spring Modulith + Use when you need to design, review, or improve modular monoliths with Spring Modulith in Spring Boot applications - including module package structure, ApplicationModules verification, named interfaces, allowed dependencies, domain events, @ApplicationModuleTest, Scenario-based module tests, generated documentation, actuator exposure, observability, and event publication registry choices. + + + You are a Senior software engineer with extensive experience in Spring Boot, modular monolith architecture, domain-driven design, and Spring Modulith + + + + + + Before applying recommendations, ensure the Spring Boot project compiles. Spring Modulith changes affect architecture, package boundaries, and test bootstrapping, so failures must be addressed before refactoring. + + + **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change + **PREREQUISITE**: Confirm the project is a Spring Boot application; for non-Boot Java modularity use architecture or design skills instead + **BASELINE**: Align dependency choices with the active Spring Boot 4.0.x baseline and the Spring Modulith compatibility matrix + **SAFETY**: If compilation fails, stop immediately and report the blocking errors + **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements; include module structure tests when adding Spring Modulith + **BOUNDARIES**: Do not use Spring Modulith to hide cyclic, chatty, or anemic module design; use verification failures to refine package boundaries and APIs + + + + + + + + + Maven coordinates + Use the Spring Modulith BOM and add only the modules needed by the application + + + + + + + + org.springframework.modulith + spring-modulith-bom + ${spring-modulith.version} + import + pom + + + + + + + org.springframework.modulith + spring-modulith-starter-core + + + org.springframework.modulith + spring-modulith-starter-test + test + +]]> + + + + + org.springframework.modulith + spring-modulith-core + 1.0.0 + + + + + org.springframework.modulith + spring-modulith-actuator + 1.0.0 +]]> + + + + + + + Application module package structure + Let package boundaries express business capabilities + + + + + + + + + + + + + + + Module boundary verification + Use ApplicationModules.verify() as an architecture test + + + + + + + + + + + + + + + Named interfaces and allowed dependencies + Expose intentional APIs instead of whole modules + + + + + + + + + + + + + + + Domain events between modules + Publish events for decoupling instead of invoking another module's internals + + + + + + + + + + + + + + + Application module tests + Use @ApplicationModuleTest to bootstrap one module or its declared dependencies + + + + + + + + orders.placeOrder("customer-123")) + .andWaitForEventOfType(OrderPlaced.class) + .toArriveAndVerify(event -> { + assertThat(event.customerId()).isEqualTo("customer-123"); + }); + } +}]]> + + + + + + + + + + Documentation, actuator, and observability + Add runtime and documentation features deliberately + + + + + + + + + org.springframework.modulith + spring-modulith-actuator + runtime + + + org.springframework.boot + spring-boot-starter-actuator +]]> + + + + + + + + + + + **ANALYZE** the Spring Boot package structure, module boundaries, cross-module dependencies, and current test strategy + **RECOMMEND** Spring Modulith dependency and module modeling changes aligned with the active Spring Boot baseline + **APPLY** minimal framework-aligned changes: module package boundaries, package annotations, architecture tests, domain events, and module tests + **VERIFY** with compilation, module boundary tests, and `./mvnw clean verify` where feasible + + + diff --git a/skills-generator/src/main/resources/skills.xml b/skills-generator/src/main/resources/skills.xml index eabc6f12..3912b36e 100644 --- a/skills-generator/src/main/resources/skills.xml +++ b/skills-generator/src/main/resources/skills.xml @@ -242,6 +242,11 @@ 304-frameworks-spring-boot-security + + + 305-frameworks-spring-boot-modulith + + 311-frameworks-spring-jdbc