Skip to main content
skill CX Codex

java-spring-development — Claude Code skill: Spring Boot 3.x

Teaches the agent to build enterprise apps with Spring Boot 3.x and Java 17+: layered architecture, REST APIs, Spring Data JPA, Spring Security, and tests.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill java-spring-development -a claude-code
Open on GitHub

What java-spring-development does

The skill sets guidelines for Spring Boot 3.x development with Java 17+ features (records, sealed classes, pattern matching). Inside: project structure (controllers, services, repositories, models, configurations), dependency injection patterns (constructor injection, @RequiredArgsConstructor with Lombok), REST API design with proper status codes and DTOs, Spring Data JPA setup (lazy loading, pagination, custom queries), schema migrations via Flyway or Liquibase. Adds sections on Spring Security (BCrypt, CORS, roles), input validation, testing (JUnit 5, Mockito, @SpringBootTest, MockMvc, test containers), caching (Redis, Caffeine), async processing (@Async), logging (SLF4J, Logback, correlation IDs), and monitoring with Spring Boot Actuator.

The agent follows SOLID, designs for microservices, uses Springdoc OpenAPI for docs. Tests follow Given-When-Then; migrations are versioned and never modified after application.

What it helps with

  • Build a REST API with versioning, DTOs, and error handling
  • Configure Spring Security with roles, BCrypt, and CORS
  • Write a JPA repository with pagination and custom queries
  • Add Redis caching with TTL and eviction strategy
  • Cover business logic with Mockito unit tests

Example prompts for the agent

  • Create a controller at /api/orders with pagination and DTO validation
  • Set up Spring Security: JWT tokens, ADMIN and USER roles
  • Add a Flyway migration for the payments table with a foreign key to orders

How to install java-spring-development

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill java-spring-development -a claude-code

2Manually: put the files in place

~/.claude/skills/java-spring-development/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/java-spring-development/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about java-spring-development

How to install java-spring-development in Claude Code?

Run npx skills add Mindrally/skills --skill java-spring-development -a claude-code, the file will appear at ~/.claude/skills/java-spring-development/SKILL.md.

What does java-spring-development do?

Teaches the agent to build Spring Boot 3.x applications: layered structure, REST APIs, Spring Data JPA, Spring Security, tests, caching, migrations, and Actuator monitoring.

Which Java version does the skill require?

Java 17 and above — the skill uses records, sealed classes, and pattern matching from newer language versions.

Source text

SKILL.md · Apache-2.0
---
name: java-spring-development
description: Java Spring Boot development guidelines with best practices for building robust, secure, and maintainable enterprise applications
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Java Spring Development Best Practices

## Core Principles

- Write clean, efficient, and well-documented Java code with accurate Spring Boot examples
- Use Spring Boot 3.x with Java 17+ features (records, sealed classes, pattern matching)
- Prefer constructor injection over field injection for better testability
- Follow SOLID principles and RESTful API design patterns
- Design for microservices architecture suitability

## Project Structure

Organize code using the standard layered pattern:

```
project/
├── controllers/     # REST controllers
├── services/        # Business logic
├── repositories/    # Data access layer
├── models/          # Domain entities and DTOs
└── configurations/  # Spring configurations
```

## Dependency Injection

- Use constructor injection for required dependencies
- Leverage `@RequiredArgsConstructor` with Lombok for cleaner code
- Keep constructors simple and avoid logic in them
- Use `@Qualifier` when multiple implementations exist

## REST API Design

- Use appropriate HTTP methods (GET, POST, PUT, DELETE, PATCH)
- Return proper HTTP status codes
- Implement consistent error response format
- Use DTOs to control API contract
- Version APIs when needed

## Data Access

### Spring Data JPA
- Define proper entity relationships (@OneToMany, @ManyToOne, etc.)
- Use lazy loading appropriately to avoid N+1 queries
- Implement pagination for large result sets
- Use query methods and @Query for custom queries

### Database Migrations
- Use Flyway or Liquibase for schema migrations
- Version migration scripts properly
- Never modify existing migrations
- Test migrations in development before production

## Security

### Spring Security
- Implement authentication and authorization properly
- Use BCrypt for password encoding
- Configure CORS appropriately
- Protect endpoints based on roles/permissions
- Use HTTPS in production

### Secure Coding
- Validate all user inputs
- Sanitize data to prevent injection attacks
- Avoid exposing sensitive information in responses
- Use parameterized queries

## Testing

### Unit Testing
- Use JUnit 5 for unit tests
- Mock dependencies with Mockito
- Test business logic thoroughly
- Follow Given-When-Then pattern

### Integration Testing
- Use @SpringBootTest for integration tests
- Use MockMvc for web layer testing
- Test database operations with test containers
- Test security configurations

## Performance

### Caching
- Use Spring Cache abstraction
- Configure appropriate cache providers (Redis, Caffeine)
- Set proper TTL for cached data
- Implement cache eviction strategies

### Async Processing
- Use @Async for non-blocking operations
- Configure thread pools appropriately
- Handle exceptions in async methods
- Consider using reactive patterns for high concurrency

## Logging and Monitoring

### Logging
- Use SLF4J with Logback
- Log at appropriate levels
- Include correlation IDs for tracing
- Avoid logging sensitive data

### Monitoring
- Use Spring Boot Actuator for health and metrics
- Export metrics to monitoring systems
- Set up proper health checks
- Monitor application performance

## API Documentation

- Use Springdoc OpenAPI for API documentation
- Document all endpoints with descriptions
- Include request/response examples
- Keep documentation up to date with code

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

All skills for Backend and APIs →

From the same set236

sequelize A skill that gives your agent rules for writing Sequelize code: models, associations, migrations and queries. Useful for Node.js projects on a relational database. CX Codex +1 942installs nestjs-clean-typescript Guides Claude Code to write clean NestJS APIs using TypeScript, MikroORM, class-validator, and Jest testing conventions. CX Codex +1 940installs gcp-development A rule set for building on Google Cloud: Cloud Functions, Cloud Run, Firestore, BigQuery and Terraform. Useful when your agent writes GCP code or infrastructure. CX Codex +1 937installs django-python A skill that steers your agent through Django work: MVT structure, ORM over raw SQL, class-based views and view-level error handling. CX Codex +1 933installs security-best-practices A skill providing security principles for backend and microservice development. It helps agents enforce strict input validation, protect APIs, and prevent sensitive data leaks. CX Codex +1 930installs flutter Enforces Flutter and Dart standards: feature-first clean architecture, state management with Riverpod or BLoC, and strict limits on widget tree depth. CX Codex +1 925installs drupal-development This skill guides agents through Drupal 10 module work using Drupal conventions and PHP practices. Use it when building services, forms, routes, or schema updates. CX Codex +1 911installs supabase Guides AI agents on Supabase backend patterns, PostgreSQL schemas, Row Level Security policies, and Deno Edge Functions. CX Codex +1 910installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor