spring-boot-dev

Provides architecture patterns and conventions for Spring Boot 3.x Java backend development.

Updated Sep 1, 2026
One-click install
npx skills add https://github.com/sshekhar-04/SIH_PS_26151 --skill spring-boot-dev-sshekhar-04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-boot-dev
Source: https://github.com/sshekhar-04/SIH_PS_26151/tree/main/.agents/Skills/spring-boot-dev
Command: npx skills add https://github.com/sshekhar-04/SIH_PS_26151 --skill spring-boot-dev-sshekhar-04

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Spring Boot projects often suffer from inconsistent layering, N+1 query problems, leaked JPA entities in APIs, and scattered exception handling. This Skill gives you a concrete set of architectural standards and code patterns so your Java backend stays clean, maintainable, and performant. ## Core Features & Use Cases - Layered Architecture Standards: Enforces a clear project structure with config, controller, dto, exception, entity, repository, and service layers. - JPA & Hibernate Optimization: Provides patterns to avoid N+1 queries using JOIN FETCH and @EntityGraph, plus pagination with Pageable. - Centralized Exception Handling: Implements @RestControllerAdvice to convert domain and validation exceptions into standardized error responses. - Use Case: When building a patient management REST API, use this Skill to structure controllers with @Valid DTO records, delegate logic to transactional services, and return consistent error responses. ## Quick Start Ask the AI to review or scaffold a Spring Boot REST controller with proper DTO validation, service-layer delegation, and global exception handling following this Skill's conventions.

Frequently Asked Questions about spring-boot-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Spring Boot project with layered architecture?

Organize code into config, controller, dto, exception, entity, repository, and service packages. Keep controllers thin by delegating business logic to service classes, and never expose JPA entities directly through API endpoints.

How to avoid N+1 query problems in Spring Data JPA?

Use JOIN FETCH in JPQL queries or @EntityGraph on repository methods to load relationships in a single query. Also apply pagination with Pageable for collection queries to limit result sets.

Should I use Java records for DTOs in Spring Boot?

Yes, Java records are recommended for immutable DTOs in Java 17+. Combine them with Jakarta Bean Validation annotations like @NotBlank, @Email, and @Min to validate incoming request payloads.

How do I handle exceptions globally in Spring Boot?

Implement a @RestControllerAdvice class with @ExceptionHandler methods for each exception type. Return standardized error responses containing timestamp, status, message, and request path for consistent API error handling.

Is constructor injection better than @Autowired field injection in Spring?

Constructor injection is preferred because it makes dependencies explicit, supports immutability, and simplifies testing. Use Lombok's @RequiredArgsConstructor to generate constructors for final fields automatically.