mcpField
J
java-springboot

java-springboot

github.com/vekzz-devDevelopment441 installsUpdated 1w ago
Repository

About java-springboot

A skill for developers building or maintaining Spring Boot applications, with guidance on project setup, architecture, security, testing, and monitoring. Its topic-based references cover practices from dependency injection to health checks.

Key features

  1. 01Constructor injection and DTO guidance
  2. 02Package-by-feature organization
  3. 03Validation and transaction practices
  4. 04Configuration, security, and logging advice
  5. 05Test-slice references
  6. 06Actuator and health checks

Use cases

  1. 01Starting a Spring Boot project
  2. 02Designing REST controllers and service layers
  3. 03Configuring security and externalized settings
  4. 04Choosing an application testing approach

MCP support

It uses Context7 to look up current Spring Boot documentation: resolve a library ID first, then query docs for the specific task.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/vekzz-dev/opencode-skills --skill java-springboot

After installing, type/java-springbootin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
advanced.md
configuration.md
data-layer.md
dependency-injection.md
logging.md
monitoring.md
project-setup.md
security.md
service-layer.md
testing.md
web-layer.md

Details

From the project README

When to Use

  • Developing Spring Boot applications
  • Need best practices for Spring Boot
  • Configuring Spring Boot projects
  • Working with Spring framework components

Core Principles

  1. Constructor Injection — Always use it for testability. Never @Autowired on fields.
  2. DTOs — Never expose JPA entities to the API layer. Use records or projection interfaces.
  3. Package by Feature — Group by domain (order/, user/), not by layer (controller/, service/).
  4. Validation — Use Bean Validation (@Valid, @NotBlank) on request DTOs.
  5. Transactions — Keep them short and at the service layer with @Transactional.
  6. Logging — Use parameterized logging ({}), never string concatenation.
  7. Security — Never hardcode secrets. Use env vars and @ConfigurationProperties.
  8. Testing — Use the narrowest test slice that gives you confidence.
  9. Configuration — Externalize everything via application.yml and @ConfigurationProperties.
  10. Monitoring — Add Actuator and health checks to every service.

Reference Index

TopicReference
Build tool, starters, package structurereferences/project-setup.md
Constructor injection, Lombok, stereotypesreferences/dependency-injection.md
application.yml, @ConfigurationProperties, profiles, secretsreferences/configuration.md
REST controllers, DTOs, validation, exception handlerreferences/web-layer.md
Business logic, @Transactionalreferences/service-layer.md
Repositories, queries, projectionsreferences/data-layer.md
SLF4J logging patternsreferences/logging.md
Spring Security, JWT, password encodingreferences/security.md
Async, caching, API versioning, paginationreferences/advanced.md
Actuator, health indicatorsreferences/monitoring.md
Test slice quick referencereferences/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 TypeAnnotationUse For
Unit@ExtendWith(MockitoExtension.class)Service logic
Web@WebMvcTestControllers
Data@DataJpaTestRepositories
Integration@SpringBootTestFull flow
Slice@RestClientTestREST clients

Context7 Integration

When you need up-to-date information on Spring Boot:

  1. Resolve the libraryId — Use context7_resolve-library-id with:

    • libraryName: "spring boot" or "spring framework"
    • query: what you're going to do (e.g., "configuration properties", "custom health check")
  2. Query the docs — Use context7_query-docs with:

    • 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

Comments

Markdown supported