spring-framework

Guides Spring Boot and Spring Framework development with Java best practices and RESTful API design.

Updated Dec 26, 2025
One-click install
npx skills add https://github.com/jwvdvuurst/CalculatorCollection --skill spring-framework-jwvdvuurst
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-framework
Source: https://github.com/jwvdvuurst/CalculatorCollection/tree/main/skills/spring-framework
Command: npx skills add https://github.com/jwvdvuurst/CalculatorCollection --skill spring-framework-jwvdvuurst

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing consistent, maintainable Spring Boot applications requires deep knowledge of annotations, dependency injection patterns, testing strategies, and configuration management. This Skill provides expert guidance so your Java backend code follows established Spring conventions from the start. ## Core Features & Use Cases - Architecture Guidance: Enforces clean separation of controllers, services, repositories, and models with proper annotation usage (@RestController, @Service, @ControllerAdvice). - Best Practices Enforcement: Covers constructor-based dependency injection, Spring Data JPA, Bean Validation, Spring Security with BCrypt, and Spring Cache abstraction. - Testing & Documentation: Directs JUnit 5, MockMvc, and @SpringBootTest testing patterns plus Springdoc OpenAPI documentation. - Use Case: When building a new REST endpoint for a Spring Boot 3.x application, activate this Skill to generate code that follows naming conventions, uses constructor injection, includes exception handling via @ExceptionHandler, and comes with matching unit tests. ## Quick Start Ask the assistant to create a Spring Boot REST controller with service layer, JPA repository, and JUnit 5 tests following Spring best practices.

Frequently Asked Questions about spring-framework

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

FAQPage Schema
How do I structure a Spring Boot REST API correctly?

Structure a Spring Boot application with clear separation into controllers, services, repositories, models, and configurations. Use @RestController for endpoints, @Service for business logic, and Spring Data JPA repositories for database access, following RESTful design principles.

Should I use field injection or constructor injection in Spring?

Constructor injection is preferred over field injection because it improves testability and makes dependencies explicit. Use @Autowired sparingly and rely on explicit constructor injection to leverage Spring's IoC container effectively.

How do I test Spring Boot controllers with JUnit 5?

Use MockMvc for testing web layer components in isolation, @SpringBootTest for full integration tests, and @DataJpaTest for repository layer testing. JUnit 5 with Spring Boot Test provides the annotations and utilities for each layer.

Does Spring Boot 3.x work with Java 17 features?

Yes, Spring Boot 3.x requires Java 17 or later and supports modern language features like records, sealed classes, and pattern matching. It also uses Jakarta EE namespaces, so Bean Validation uses Jakarta Validation annotations.

How do I handle exceptions globally in Spring Boot?

Handle exceptions gracefully using @ControllerAdvice combined with @ExceptionHandler methods. This centralizes error handling across all controllers and lets you return consistent error responses for different exception types.