501-frameworks-micronaut-core

Solid

Use when building or reviewing Micronaut applications — Micronaut.run bootstrap, @Singleton/@Prototype, @Factory beans, @ConfigurationProperties, environments, @Requires, @Controller vs services, @Scheduled, graceful shutdown, @ExecuteOn for blocking work, and Jakarta-consistent APIs. Part of the skills-for-java project

AI & Automation 393 stars 78 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 89/100

Stars 20%
86
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
98
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Micronaut Core Guidelines Apply Micronaut core guidelines for DI, configuration, HTTP adapters, and operations. **What is covered in this Skill?** - Thin `main` with `Micronaut.run(Application.class, args)` - Bean scopes: @Singleton, @Prototype; request scope only when justified - Constructor injection with `jakarta.inject.Inject` - @Factory for third-party or explicit bean construction - @ConfigurationProperties (grouped settings) vs scattered @Property - @Requires and environments instead of env branching in domain code - Thin @Controller types delegating to @Singleton services - @Scheduled with explicit failure visibility - @ExecuteOn(TaskExecutors.BLOCKING) (or virtual-thread executors) for blocking I/O off the event loop - Netty graceful shutdown properties - AOP interceptors for cross-cutting concerns **Scope:** Apply recommendations based on the reference rules and good/bad code examples. ## Constraints Before applying Micronaut changes, ensure the project compiles. If compilation fails, stop immediately. After applying improvements, run full verification. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **PREREQUISITE**: Project must compile successfully before applying Micronaut core improvements - **SAFETY**: If compilation fails, stop immediately — compilation failure is a blocking condition - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements - **BEFORE APPLYING**: Read the reference ...

Details

Author
jabrena
Repository
jabrena/cursor-rules-java
Created
1 years ago
Last Updated
today
Language
Java
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Solid

521-frameworks-micronaut-testing-unit-tests

Use when you need to write unit tests for Micronaut applications — Mockito-first with @ExtendWith(MockitoExtension.class), @MicronautTest with @MockBean, HttpClient @Client("/") assertions, @Property overrides, @ParameterizedTest, and *Test vs *IT naming. For framework-agnostic Java use @131-java-testing-unit-testing. Part of the skills-for-java project

393 Updated today
jabrena
Testing & QA Solid

522-frameworks-micronaut-testing-integration-tests

Use when you need to write or improve integration tests for Micronaut — @MicronautTest, HttpClient, TestPropertyProvider with Testcontainers, transactional test mode where appropriate, and Maven Surefire/Failsafe splits for *Test, *Tests, *IT, and *AT. Part of the skills-for-java project

393 Updated today
jabrena
API & Backend Solid

502-frameworks-micronaut-rest

Use when you need to design, review, or improve REST APIs with Micronaut — including @Controller routes, HTTP status codes, DTOs, Bean Validation, exception handlers, pagination, idempotency, ETag/If-Match, caching headers, versioning, contract-first OpenAPI (OpenAPI Generator), optional runtime OpenAPI via micronaut-openapi, and security annotations. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

511-frameworks-micronaut-jdbc

Use when you need programmatic JDBC in Micronaut — pooled DataSource, parameterized SQL, io.micronaut.transaction.annotation.Transactional, batching, and domain exception translation. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

301-frameworks-spring-boot-core

Use when you need to review, improve, or build Spring Boot 4.0.x applications — including proper usage of @SpringBootApplication, component annotations (@Controller, @Service, @Repository), bean definition and scoping, configuration classes and @ConfigurationProperties (with @Validated), component scanning, conditional configuration and profiles, constructor injection, @Primary and @Qualifier for multiple beans of the same type, bean minimization, graceful shutdown, virtual threads, Jakarta EE namespace consistency, and scheduled tasks. This should trigger for requests such as Review Java code for Spring Boot application; Apply best practices for Spring Boot application in Java code. Part of cursor-rules-java project

393 Updated today
jabrena