spring-boot-idioms
SkillAI & modelsSpring Boot (3.x) rewards auto-configuration, constructor injection, and actuator-driven observability. Idiomatic Spring = annotation-driven, testable, production-ready.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the spring-boot-idioms skill
About this capability
Comprehensive sets of standards and practices designed to elevate the capabilities of AI coding agents.
What this skill tells your AI
The instructions your AI receives, as published by irahardianto/awesome-agv in .agents/skills/spring-boot-idioms/SKILL.md and read by ahel’s review.
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:
@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:
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> findActivByPriority(@Param("priority") Priority priority); } -
Projections for read-only views — avoid loading full entities.
-
@Transactionalon service methods, never on repositories.
REST Controllers
-
@RestController+ DTOs — never expose entities directly:@RestController @RequestMapping("/api/v1/tasks") public class TaskController { @PostMapping @ResponseStatus(HttpStatus.CREATED) public TaskResponse create(@Valid @RequestBody CreateTaskRequest request) { return taskService.create(request); } } -
@ControllerAdvicefor global exception handling.
Actuator and Observability
- Actuator endpoints enabled for health, metrics, info.
- Micrometer for custom metrics.
- Structured logging with MDC for correlation IDs.
Testing
For universal testing principles, see
.agents/rules/testing-strategy.md. Below: language-specific patterns only.
-
@SpringBootTestfor integration,@WebMvcTestfor controller slices:@WebMvcTest(TaskController.class) class TaskControllerTest { @Autowired MockMvc mockMvc; @MockBean TaskService taskService; @Test void createTask_returns201() throws Exception { mockMvc.perform(post("/api/v1/tasks") .contentType(MediaType.APPLICATION_JSON) .content("{\"title\":\"Test\",\"priority\":\"HIGH\"}")) .andExpect(status().isCreated()); } } -
TestContainers for database integration tests.
Related
- Java Idioms @.agents/skills/java-idioms/SKILL.md
- Database Design Principles @.agents/rules/database-design-principles.md
- API Design Principles @.agents/rules/api-design-principles.md
Signals
- GitHub stars
- 156
- Forks
- 53
- Last commit
- Aug 2026
Advanced
- Catalog kind
- skill
- Gateway key
spring-boot-idioms- Source
- github.com/irahardianto/awesome-agv