java-springboot
Comprehensive best practices for developing high-quality Spring Boot applications with production-ready patterns. Trigger: When developing Spring Boot applications, need best practices, or working with Spring framework.
How do I install this agent skill?
npx skills add https://github.com/vekzz-dev/opencode-skills --skill java-springbootIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides production-ready Spring Boot development patterns and code templates. It is generally safe and promotes secure practices such as proper secrets management and strong password hashing. It carries a low-risk rating due to a surface for indirect prompt injection via the integration of a documentation search tool.
- Socketpass
No alerts
- Snykwarn
Risk: MEDIUM · 1 issue
What does this agent skill do?
When to Use
- Developing Spring Boot applications
- Need best practices for Spring Boot
- Configuring Spring Boot projects
- Working with Spring framework components
Core Principles
- Constructor Injection — Always use it for testability. Never
@Autowiredon fields. - DTOs — Never expose JPA entities to the API layer. Use records or projection interfaces.
- Package by Feature — Group by domain (order/, user/), not by layer (controller/, service/).
- Validation — Use Bean Validation (
@Valid,@NotBlank) on request DTOs. - Transactions — Keep them short and at the service layer with
@Transactional. - Logging — Use parameterized logging (
{}), never string concatenation. - Security — Never hardcode secrets. Use env vars and
@ConfigurationProperties. - Testing — Use the narrowest test slice that gives you confidence.
- Configuration — Externalize everything via
application.ymland@ConfigurationProperties. - Monitoring — Add Actuator and health checks to every service.
Reference Index
| Topic | Reference |
|---|---|
| Build tool, starters, package structure | references/project-setup.md |
| Constructor injection, Lombok, stereotypes | references/dependency-injection.md |
| application.yml, @ConfigurationProperties, profiles, secrets | references/configuration.md |
| REST controllers, DTOs, validation, exception handler | references/web-layer.md |
| Business logic, @Transactional | references/service-layer.md |
| Repositories, queries, projections | references/data-layer.md |
| SLF4J logging patterns | references/logging.md |
| Spring Security, JWT, password encoding | references/security.md |
| Async, caching, API versioning, pagination | references/advanced.md |
| Actuator, health indicators | references/monitoring.md |
| Test slice quick reference | references/testing.md |
Commands
# Run Spring Boot application
mvn spring-boot:run
# Run with specific profile
mvn spring-boot:run -Dspring-boot.run.profiles=dev
# Build project
mvn clean package
# Run tests
mvn test
# Run specific test
mvn test -Dtest=OrderServiceTest
Testing
For comprehensive testing guidance (test slices, MockMvcTester, Testcontainers, AssertJ), see the java-springboot-testing skill.
Quick Reference
| Test Type | Annotation | Use For |
|---|---|---|
| Unit | @ExtendWith(MockitoExtension.class) | Service logic |
| Web | @WebMvcTest | Controllers |
| Data | @DataJpaTest | Repositories |
| Integration | @SpringBootTest | Full flow |
| Slice | @RestClientTest | REST clients |
Context7 Integration
When you need up-to-date information on Spring Boot:
-
Resolve the libraryId — Use
context7_resolve-library-idwith:libraryName: "spring boot" or "spring framework"query: what you're going to do (e.g., "configuration properties", "custom health check")
-
Query the docs — Use
context7_query-docswith:libraryId: the ID from the previous step (e.g., "/spring/spring-boot")query: your specific question
Before answering about Spring Boot APIs, configurations, or best practices, consult Context7 to get up-to-date information.
Resources
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/vekzz-dev/opencode-skills/java-springboot">View java-springboot on skillZs</a>