java-springboot

Applies Spring Boot 3.3 conventions for controllers, services, repositories, and configuration.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit --skill java-springboot-serpro-workshop-fortaleza
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: java-springboot
Source: https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit/tree/main/.github/skills/java-springboot
Command: npx skills add https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit --skill java-springboot-serpro-workshop-fortaleza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams modernizing the SIFAP 2.0 server layer need consistent, idiomatic Spring Boot code. This Skill provides a checklist of best practices so new feature slices follow the same package structure, dependency injection, DTO, transaction, and error-handling conventions enforced by CI. ## Core Features & Use Cases - Feature-slice scaffolding: Guides creation of controller, service, and repository organized by domain package rather than by layer. - Convention enforcement: Covers constructor injection, Java 21 record DTOs, Bean Validation, @Transactional placement, Spring Data JPA, RFC 7807 ProblemDetail errors, and externalized configuration with secret management. - Use Case: When asked to expose a JPA entity as a REST endpoint, the Skill produces a /api/v1 controller with a validated record request DTO, a transactional service, and a Spring Data repository, matching the kit's quality checklist. ## Quick Start Ask the AI to create the structure of a new feature slice (controller, service, and repository) for a SIFAP module following Spring Boot best practices.

Frequently Asked Questions about java-springboot

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

FAQPage Schema
How do I structure a Spring Boot project by feature?▼

Organize packages by domain or bounded context, such as com.example.app.order, instead of by layer like controller or service. Each feature package contains its own controller, service, and repository so modules never import another module's internals.

How to create a REST endpoint from a JPA entity in Spring Boot?▼

Expose a record DTO at the controller boundary, never the JPA entity itself. Validate the request record with Bean Validation annotations, delegate to a @Transactional service, and persist through a Spring Data JPA repository.

Where should @Transactional be placed in Spring Boot?▼

Place @Transactional only on service-layer classes, never on controllers or repositories. Use @Transactional(readOnly = true) for read operations to optimize database access.

Should I use field injection or constructor injection in Spring?▼

Always use constructor injection for required dependencies, declaring fields as private final. This makes dependencies explicit, enforces immutability, and simplifies unit testing with Mockito.

How do I handle errors in Spring Boot REST APIs?▼

Centralize error handling in a single @RestControllerAdvice that returns ProblemDetail following RFC 7807. This keeps controllers free of try-catch blocks and produces consistent error responses across endpoints.

How should secrets be managed in a Spring Boot application?▼

Never hardcode secrets in application.yml or source code. Use environment variables locally and Azure Key Vault via Managed Identity in Azure, binding configuration through @ConfigurationProperties for type-safe access.