Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions skills-generator/src/main/resources/skill-indexes/305-skill.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<prompt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://jabrena.github.io/pml/schemas/0.7.0/pml.xsd"
id="305-frameworks-spring-boot-modulith">
<metadata>
<author>Juan Antonio Breña Moral</author>
<version>0.15.0</version>
<license>Apache-2.0</license>
<description>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.</description>
</metadata>

<title>Spring Boot - Spring Modulith</title>
<goal><![CDATA[
Apply Spring Modulith guidelines for Spring Boot modular monoliths.

**What is covered in this Skill?**

- Spring Modulith BOM and starter dependency selection
- Business-capability package structure for application modules
- ApplicationModules verification and architecture tests
- Named interfaces and explicit allowed dependencies
- Domain events for loose coupling between modules
- @ApplicationModuleTest and Scenario-based module integration tests
- Generated module documentation, actuator exposure, and observability
- Event publication registry choices for reliable domain events

**Scope:** Apply recommendations based on the reference rules, official Spring Modulith documentation, and good/bad examples.
]]></goal>

<constraints>
<constraints-description>Before applying Spring Modulith changes, ensure the project compiles. After improvements, run full verification including module structure tests.</constraints-description>
<constraint-list>
<constraint>**MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change</constraint>
<constraint>**PRECONDITION**: The project must be a Spring Boot application; for non-Boot Java modularity use architecture or design skills instead</constraint>
<constraint>**BASELINE**: Align dependency choices with Spring Boot 4.0.x and the Spring Modulith compatibility matrix</constraint>
<constraint>**SAFETY**: If compilation fails, stop immediately</constraint>
<constraint>**VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements</constraint>
<constraint>**BEFORE APPLYING**: Read the reference for detailed rules, good/bad patterns, and official documentation links</constraint>
</constraint-list>
</constraints>

<triggers>
<trigger-list>
<trigger>Add Spring Modulith to a Spring Boot application</trigger>
<trigger>Review Spring Modulith module boundaries</trigger>
<trigger>Improve modular monolith architecture in Spring Boot</trigger>
<trigger>Add @ApplicationModuleTest tests</trigger>
<trigger>Generate Spring Modulith documentation</trigger>
<trigger>Refactor Spring Boot modules with Spring Modulith</trigger>
</trigger-list>
</triggers>

<steps>
<step number="1"><step-title>Read reference and inspect project structure</step-title><step-content>Read `references/305-frameworks-spring-boot-modulith.md` and inspect the Spring Boot version, Maven dependencies, main application package, and current package/module boundaries.</step-content></step>
<step number="2"><step-title>Model application modules</step-title><step-content>Identify business-capability modules, public APIs, internal packages, named interfaces, and intentional allowed dependencies.</step-content></step>
<step number="3"><step-title>Apply framework-aligned changes</step-title><step-content>Add or refine Spring Modulith dependencies, package annotations, architecture verification tests, domain events, and module tests following the reference patterns.</step-content></step>
<step number="4"><step-title>Run verification and report results</step-title><step-content>Execute appropriate build/tests, especially `ApplicationModules.verify()` and `@ApplicationModuleTest` coverage, then summarize changes, risks, and follow-up module design work.</step-content></step>
</steps>
</prompt>
Loading
Loading