.clinerules/coding.md
This project is a Micronaut module which is part of the Micronaut Framework, a modern, JVM-based, full-stack framework for building modular, easily testable microservice and serverless applications.
The description of what this project is doing can be found in the gradle.properties file under the projectDesc key.
This repository does not represent an actual application; its modules are designed to be used as dependencies by applications. The root project MUST NOT contain any code: it is a parent project which coordinates the build and supplies documentation.
⚠️ CRITICAL: DO NOT USE attempt_completion BEFORE TESTING ⚠️
--stacktrace, --info (excessive output will not fit the context)-q option, since that will suppress the output result of each test.micronaut-. For example, directory mylib maps to Gradle project :micronaut-mylib../gradlew.test- or test-suite are not intended for users: they are functional tests of the project./gradlew -q :<module>:compileTestJava./gradlew :<module>:test./gradlew -q cM
cM is the canonical Checkstyle runner defined in build logic to validate Checkstyle across the codebase../gradlew -q spotlessCheck./gradlew -q spotlessApply (MUST be used to fix violations found by spotlessCheck)You SHOULD prefer modern Java idioms: records, pattern matching, sealed interfaces/classes, var for local variables.
You MUST NOT use fully qualified class names unless there is a conflict between 2 class names in different packages.
You MUST annotate the code with nullability annotations (org.jspecify.annotations.Nullable, org.jspecify.annotations.NonNull).
You MUST NOT use reflection: Micronaut is a reflection-free framework tailored for integration with GraalVM.
You MUST use jakarta.inject for dependency injection, NOT javax.inject.
Micronaut projects are intended to be used in consumer applications and therefore follow semantic versioning. As a consequence:
./gradlew japiCmp task to get a report about binary breaking changes@io.micronaut.core.annotation.InternalYou MUST follow this sequence after editing source files:
Compile affected modules
./gradlew -q :<module>:compileTestJava :<module>:compileTestGroovyRun targeted tests first (fast feedback)
./gradlew :<module>:test --tests 'pkg.ClassTest'./gradlew :<module>:test --tests 'pkg.ClassTest.method' (optional)Run full tests for all affected modules
./gradlew :<module>:testStatic checks
./gradlew -q cM(Optional) If, and only if you have created new files, you SHOULD run
./gradlew -q spotlessCheck./gradlew -q spotlessApply then re-run spotlessCheckgit_status to verify the working tree:
<use_mcp_tool>
<server_name>mcp-server-git</server_name>
<tool_name>git_status</tool_name>
<arguments>
{
"repo_path": "/home/cchampeau/DEV/PROJECTS/micronaut/micronaut-langchain4j" // adjust absolute path if necessary
}
</arguments>
</use_mcp_tool>
.clinerules/docs.md.You MUST use Context7 to get up-to-date, version-specific documentation and code examples for frameworks and libraries.
Preferred library IDs:
/websites/micronaut_io/websites/micronaut-projects_github_io_micronaut-test/websites/micronaut-projects_github_io_micronaut-oracle-cloud/openrewrite/rewrite-docsExample (fetch docs for a topic):
<use_mcp_tool>
<server_name>context7-mcp</server_name>
<tool_name>get-library-docs</tool_name>
<arguments>
{
"context7CompatibleLibraryID": "/openrewrite/rewrite-docs",
"topic": "JavaIsoVisitor"
}
</arguments>
</use_mcp_tool>
For other libraries, you MUST resolve the library ID first:
<use_mcp_tool>
<server_name>context7-mcp</server_name>
<tool_name>resolve-library-id</tool_name>
<arguments>
{
"libraryName": "Mockito"
}
</arguments>
</use_mcp_tool>
gradle/libs.versions.toml.Adding a new dependency (steps):
libs.versions.toml).libraries).build.gradle.kts, for example:
implementation(libs.some.library)testImplementation(testlibs.some.junit)You SHOULD choose the appropriate scope depending on the use of the library:
- api for dependencies which appear in public signatures or the API of a module
- implementation for dependencies which are implementation details, only used in the method bodies for example
- compileOnly for dependencies which are only required at build time but not at runtime
- runtimeOnly for dependencies which are only required at run time and not at compile time
Micronaut projects follow Gradle best practices, in particular usage of convention plugins.
Convention plugins live under the buildSrc directory.
You MUST NOT add custom build logic directly in build.gradle(.kts) files.
You MUST implement build logic as part of convention plugins.
You SHOULD avoid build logic code duplication by moving common build logic into custom convention plugins.
You SHOULD try to prefer composition of convention plugins.
You MUST confirm all of the following BEFORE using attempt_completion:
cM) passesspotlessCheck) passes (apply fixes if needed)If ANY item is “no”, you MUST NOT use attempt_completion.
While you SHOULD add new files using git add, you MUST NOT commit (git commit) files yourself.