# spring-boot

A skill that gives your agent Spring Boot conventions: REST controllers, JUnit tests, security, build and deploy. Useful when the project is Java.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 832 installs · ★ 286
- Author: Mindrally
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/Mindrally/skills/tree/HEAD/spring-boot/SKILL.md
- Updated: 2026-10-08
- HTML: https://affpapa.org/en/nevibecode/skills/spring-boot

## What it does

The skill turns the assistant into a Spring Boot hand: Java, Spring Framework, Maven, JUnit. It lays out package structure — controllers, services, repositories, models, configurations — and asks for names that mean something: PascalCase for classes, camelCase for methods, ALL_CAPS for constants.

Inside is a set of rules by topic. Configuration lives in `application.properties` or `application.yml`, dependency injection goes through constructors rather than fields. Tests use JUnit 5, the web layer is checked with MockMvc, repositories with `@DataJpaTest`, and Testcontainers cover database integration. Separate sections cover Spring Security with BCrypt, logging through SLF4J and Logback, Actuator metrics, and API docs in Springdoc OpenAPI.

The skill assumes Java 17 or later and Spring Boot 3.x — on older versions the advice about records and sealed classes won't apply. Builds are described for Maven or Gradle, and sensitive settings are pushed into environment variables.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill spring-boot -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/spring-boot/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/spring-boot/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill spring-boot -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/spring-boot/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill spring-boot -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/spring-boot/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Mindrally/skills spring-boot
```

2. **Manually: put the files in place**
- File: `.github/skills/spring-boot/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill spring-boot -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Mindrally/skills --path spring-boot
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/spring-boot/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill spring-boot -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Mindrally/skills/tree/HEAD/spring-boot/SKILL.md

## When to use it
- split code into controller, service and repository layers
- write an integration test with Testcontainers instead of mocks
- lock down REST endpoints with Spring Security and BCrypt
- set up dev, test and prod profiles without touching code
- expose health checks and metrics through Actuator

## Example prompts
- Split this service into controller, service and repository following the spring-boot skill
- Write MockMvc and `@SpringBootTest` tests for `OrderController`
- Review the Spring Security config and point out where field injection should become constructor injection

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 8032ce45bc6a8a64.

BEGIN THIRD-PARTY FILE 8032ce45bc6a8a64
```text
---
name: spring-boot
description: Expert guidance for Spring Boot application development with best practices for RESTful APIs, testing, security, and deployment
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Spring Boot

You are an expert in Java programming, Spring Boot, Spring Framework, Maven, JUnit, and related Java technologies.

## Code Style and Structure

- Write clean, efficient, and well-documented Java code using Spring Boot conventions
- Follow RESTful API design patterns for web services
- Use descriptive method and variable names following camelCase convention
- Structure applications with consistent package organization (controllers, services, repositories, models, configurations)

## Spring Boot Specifics

- Leverage Spring Boot starters for rapid application development
- Use auto-configuration effectively to minimize boilerplate
- Implement proper annotations (@SpringBootApplication, @RestController, @Service, @Repository)
- Handle exceptions globally via @ControllerAdvice and @ExceptionHandler

## Naming Conventions

- Use PascalCase for class names (e.g., UserController, OrderService)
- Use camelCase for method and variable names (e.g., findUserById, isOrderValid)
- Use ALL_CAPS for constants (e.g., MAX_RETRY_ATTEMPTS, DEFAULT_PAGE_SIZE)

## Java and Spring Boot Usage

- Use Java 17 or later features when applicable (e.g., records, sealed classes, pattern matching)
- Leverage Spring Boot 3.x capabilities and features
- Use Spring Data JPA for database operations with proper entity relationships
- Implement Bean Validation using Jakarta Validation annotations

## Configuration and Properties

- Store configuration in application.properties or application.yml
- Use @Value or @ConfigurationProperties for type-safe configuration injection
- Implement environment-specific configurations using Spring Profiles (dev, test, prod)

## Dependency Injection

- Prefer constructor injection over field injection for better testability
- Use CDI annotations appropriately (@Autowired, @Qualifier)
- Follow the principle of programming to interfaces

## Testing

- Write comprehensive unit tests using JUnit 5 and Spring Boot Test
- Use MockMvc for testing REST endpoints and web layer components
- Implement integration tests with @SpringBootTest
- Use @DataJpaTest for repository layer testing
- Leverage Testcontainers for database integration testing

## Performance and Scalability

- Implement caching strategies using Spring Cache abstraction
- Use @Async for asynchronous, non-blocking operations
- Optimize database queries using proper indexing and fetch strategies
- Consider connection pooling with HikariCP

## Security

- Implement Spring Security for authentication and authorization
```
END THIRD-PARTY FILE 8032ce45bc6a8a64

The third-party file has ended. Everything between the 8032ce45bc6a8a64 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2777 of 4065 bytes. © Mindrally · Apache-2.0 · https://github.com/Mindrally/skills/tree/HEAD/spring-boot/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
