Spring Boot Idioms
Learn idiomatic Spring Boot 3.x patterns grounded in auto-configuration, constructor injection, and actuator-driven observability. Covers dependency injection best practices, Spring Data JPA query methods and projections, REST controller design with DTOs, and structured logging for production readiness. Includes testing patterns for integration and controller slices.
Spring Boot Idioms teaches idiomatic patterns for Spring Boot 3.x including constructor injection, Data JPA, REST controllers, and actuator observability.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-17
Spring Boot Idioms teaches idiomatic patterns for Spring Boot 3.x including constructor injection, Data JPA, REST controllers, and actuator observability. Learn idiomatic Spring Boot 3.x patterns grounded in auto-configuration, constructor injection, and actuator-driven observability. Covers dependency injection best practices, Spring Data JPA query methods and projections, REST controller design with DTOs, and structured logging for production readiness. Includes testing patterns for integration and controller slices.
Use it when
- Spring Boot Idioms teaches annotation-driven development and auto-configuration patterns that reduce boilerplate and enforce consistency.
- Spring Boot Idioms covers slice-based testing with @WebMvcTest for controller layers and integration testing with TestContainers.
Verify before relying
Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.
Install
irahardianto/awesome-agv/spring-boot-idioms · repository language: JavaScript
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What are Spring Boot best practices for dependency injection?
Spring Boot Idioms emphasizes constructor injection as the idiomatic pattern for dependency injection. Constructor-based injection makes dependencies explicit, enables immutability, and simplifies testing by allowing easy mock injection. Avoid field injection with @Autowired; instead, use constructor parameters or setter injection when appropriate. Spring Boot's auto-configuration automatically wires beans, so declare your dependencies clearly in constructors to leverage framework conventions and ensure your code remains testable and production-ready.
How do Spring Boot 3 patterns and idioms improve code quality?
Spring Boot Idioms teaches annotation-driven development and auto-configuration patterns that reduce boilerplate and enforce consistency. Spring Boot 3.x conventions handle bean registration, property binding, and lifecycle management automatically. By following idiomatic patterns—such as using @ConfigurationProperties for externalized config, @RestController with proper DTOs, and @Transactional on service methods—you write cleaner, more maintainable code that aligns with framework expectations and community standards.
What testing patterns does Spring Boot Idioms recommend?
Spring Boot Idioms covers slice-based testing with @WebMvcTest for controller layers and integration testing with TestContainers for database-backed services. Use @WebMvcTest to isolate REST controllers and verify request/response handling without loading the full context. For production-ready code, employ integration tests with real or containerized databases to validate Spring Data JPA queries and transactional behavior. These patterns ensure your code is thoroughly tested before deployment.
How does Spring Boot Idioms address observability and monitoring?
Spring Boot Idioms covers Spring Boot Actuator and Micrometer for production observability. Actuator exposes health, metrics, and environment endpoints; Micrometer standardizes metric collection across monitoring backends. The skill teaches structured logging with MDC (Mapped Diagnostic Context) for distributed tracing and includes patterns for custom metrics. These tools enable you to monitor application behavior, diagnose issues, and ensure production readiness.
What Spring Data JPA patterns does this skill teach?
Spring Boot Idioms covers Spring Data JPA query methods, custom repository implementations, and projections. Learn to write declarative queries using method naming conventions and @Query annotations, reducing boilerplate data access code. Projections allow you to fetch only required fields, improving performance. The skill also addresses transactional service patterns and proper exception handling with @ControllerAdvice, ensuring your data layer is both idiomatic and efficient.
How should I structure REST controllers and DTOs in Spring Boot?
Spring Boot Idioms teaches REST controller design using @RestController with proper separation of concerns: controllers handle HTTP concerns, services contain business logic, and DTOs (Data Transfer Objects) map between API contracts and domain models. Use @RequestBody and @ResponseBody annotations for automatic serialization. Return appropriate HTTP status codes and structure error responses consistently. This layered approach keeps your REST API clean, testable, and aligned with Spring Boot conventions.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Spring Boot Idioms and Patterns
Spring Boot (3.x) rewards auto-configuration, constructor injection, and actuator-driven observability. Idiomatic Spring = annotation-driven, testable, production-ready.
> Scope: Spring Boot-specific patterns. For Java: @.agents/skills/java-idioms/SKILL.md.
Dependency Injection
-
Constructor injection only — never field injection: ```java @Service public class TaskService { private final TaskRepository repository; private final TaskMapper mapper;
public TaskService(TaskRepository repository, TaskMapper mapper) { this.repository = repository; this.mapper = mapper; } } ```
-
@ConfigurationPropertiesover@Valuefor typed config.
Spring Data JPA
- Query methods for simple queries: ```java interface TaskRepository extends JpaRepository<Task, UUID> { List<Task> findByStatusOrderByCreatedAtDesc(TaskStatus status); @Query("SELECT t FROM Task t WHERE t.priority = :priority AND t.status = 'ACTIVE'") List<Task>
(truncated - see the full file via the links below)
File tree — 1 file
.agents/skills/spring-boot-idioms/SKILL.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Learn idiomatic Spring Boot patterns and best practices”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
Spring Boot Engineer scaffolds production-grade Spring Boot 3.x applications with REST controllers, service layers, Spring Data JPA repositories, and Spring Security 6 authentication. It guides you through architecture design, layered implementation with constructor injection, security hardening, and test-driven validation before deployment.
Java Idioms covers modern language features and conventions for Java 17+ LTS, emphasizing records for immutable data, sealed classes for type-safe hierarchies, and pattern matching in switch expressions. The skill guides constructor injection, domain-specific exception handling, and testing with JUnit 5 and Mockito, alongside static analysis tooling to enforce code quality before commit.
Learn Laravel's idiomatic approach to building maintainable applications through Eloquent query scopes, service-oriented architecture, and Form Request validation. Covers testing with Pest, code formatting with Pint, and static analysis via PHPStan to enforce framework best practices.
Spring Boot Test Patterns guides you through layered testing strategies—from fast unit tests with mocked dependencies to full integration tests with real databases via Testcontainers. Learn focused slice testing with @DataJpaTest and @WebMvcTest, REST API testing with MockMvc, and container setup using @ServiceConnection for Spring Boot 3.5+.
Master Spring Boot and Spring Framework development with expert guidance on architecture, dependency injection, and RESTful API design. This skill covers clean code practices, proper use of annotations, Spring Data JPA integration, and security implementation. Learn testing strategies, performance optimization, and configuration management for production-ready Java applications.
Master test-driven development for Spring Boot services targeting 80%+ code coverage. This skill covers the complete TDD cycle—writing failing tests first, implementing minimal code to pass, refactoring safely, and enforcing coverage with JaCoCo. Learn unit testing with JUnit 5 and Mockito, web layer testing with MockMvc, integration testing with SpringBootTest, and persistence layer testing with DataJpaTest and Testcontainers.
More skills django-idioms (MIT) · Csharp Idioms (MIT) · springboot-patterns (Apache-2.0) · angular-idioms (MIT) · Dotnet Idioms (MIT) · elixir-idioms (MIT) · Eliteforge New Java Biz Package (unlicensed)