This repository is a Micronaut Framework module, not an application. The root project coordinates the Gradle build, documentation, examples, tests, and publishing metadata. Do not add production code directly at the root.
- Core modules live in
serde-api,serde-support,serde-jackson,serde-jsonp,serde-bson,serde-jackson-cbor,serde-oracle-jdbc-json, and related TCK modules. - The compile-time annotation processor lives in
serde-processor. Followserde-processor/AGENTS.mdfor generated-serde and Sourcegen work. - Documentation lives under
src/main/docs/guide, with the guide table of contents insrc/main/docs/guide/toc.yml. - Runnable documentation examples live under
doc-examples. - JMH benchmarks live in
benchmarks. Followbenchmarks/AGENTS.mdwhen changing benchmark code, benchmark results, or benchmark charts. - Shared Gradle convention logic lives in
buildSrc. Prefer convention plugins there over duplicating build logic in individual build files.
This repository includes local agent skills under .agents/skills. Use them for deeper, task-specific workflow before making related changes:
coding: Java implementation, framework bug fixes, internal API evolution, JSpecify null-safety, public API review, and committer-ready verification.gradle: build failures, version catalogs, BOM/publishing/signing behavior, binary compatibility, andmicronaut-buildplugin work.docs: module guide updates undersrc/main/docs/guide,toc.ymlchanges, Micronaut docs macros, and docs build/publishing fixes.guides: standalone tutorial work formicronaut-projects/micronaut-guides; do not use it for ordinary module guide pages in this repository.micronaut-sourcegen: any Sourcegen-based generated source, Kotlin/Groovy-compatible source, bytecode generation, or generated serde model work.agent-md-refactor: splitting or reorganizing oversized instruction files such asAGENTS.md,CLAUDE.md, orCOPILOT.md.skill-creator: creating, updating, validating, or packaging skills under.agents/skillsor equivalent skill directories.
Read only the relevant SKILL.md first, then load referenced files from that skill's references/ directory only when needed.
- Use the Gradle wrapper for all build work:
./gradlew. - Use quiet output for non-test Gradle tasks:
./gradlew -q <task>. - Do not use quiet output for test tasks because it hides useful test result output.
- Gradle project paths use standardized Micronaut names. For example, directory
serde-jacksonmaps to project:micronaut-serde-jackson. - Compile an affected Java/Groovy module before broad testing:
./gradlew -q :micronaut-<module>:compileTestJava :micronaut-<module>:compileTestGroovy. - Run targeted tests first:
./gradlew :micronaut-<module>:test --tests 'pkg.ClassTest'. - Run the full affected module test task before finishing:
./gradlew :micronaut-<module>:test. - Run aggregate Checkstyle with
./gradlew -q cMwhen source changes may affect style. - Run
./gradlew -q spotlessCheckfor new files or formatting/license-sensitive changes. If it fails, run./gradlew -q spotlessApplyand re-run the check. - Build docs with
./gradlew -q docsor./gradlew -q publishGuidewhen guide content changes.
- Keep changes scoped to the affected modules and existing package boundaries.
- Preserve public API and binary compatibility unless the user explicitly approves a breaking change. Run
./gradlew -q japiCmpwhen public signatures change. - Mark non-user-facing APIs with
@io.micronaut.core.annotation.Internal. - Use
jakarta.inject, notjavax.inject. - Do not introduce reflection-based behavior; Micronaut serialization should remain friendly to build-time analysis and GraalVM native images.
- Use JSpecify annotations such as
org.jspecify.annotations.Nullableandorg.jspecify.annotations.NonNullwhere nullness is part of the contract. - New Java packages should include
package-info.javawith@org.jspecify.annotations.NullMarked; add it to existing packages you materially touch unless the local package has a deliberate exception. - Prefer modern Java idioms already used in the codebase, including records, pattern matching, sealed types, and
varfor clear local variables. - Avoid fully qualified class names unless they are needed to resolve a name conflict.
- Add dependencies through the Gradle version catalog in
gradle/libs.versions.toml; do not hard-code dependency versions in module builds.
- Treat serializers and deserializers as runtime hot-path code. Avoid adding repeated annotation lookups, feature checks, or serde discovery inside per-property positive paths.
- Prefer computing configuration, feature flags, property arguments, serializers, and deserializers once during serde creation or construction and storing them in final fields.
- Keep generated and runtime serde behavior aligned. When changing generated serde behavior, include tests that compare generated behavior with the runtime fallback and Jackson Databind where practical.
- Use Micronaut Sourcegen APIs for generated source work. Follow the scoped
serde-processor/AGENTS.mdinstructions before changing Sourcegen-based cserdes.
- Write user guide content in AsciiDoc under
src/main/docs/guide. - Update
src/main/docs/guide/toc.ymlwhen adding or reorganizing guide pages. - Prefer runnable examples from
doc-examplesover untested snippets. - Prefer Micronaut docs macros such as
dependency:,snippet::,[configuration]blocks, and generated configuration property includes over manually duplicated dependency blocks, source snippets, or property tables. - Keep docs focused on Micronaut Serialization usage, compatibility, configuration, and migration behavior.
- Use clear AsciiDoc structure, admonitions, and descriptive image alt text.
- Read the relevant module build files and nearby tests before changing implementation.
- Add or update tests with the narrowest scope that proves the behavior change.
- Check for existing user changes before editing and do not revert unrelated work.
- Before finishing, report the exact verification commands run and any checks that were skipped.