# Spring Boot

> Use when implementing backend Spring Boot 3.3+ applications, services, repositories, and controller layers in Java 21.

- Skill: `sahilkhan30/spring-boot` (Agent Skill)
- Install (CLI): `npx skillmds@latest add sahilkhan30/spring-boot`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sahilkhan30/spring-boot/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: SahilKhan30 (https://skillmd.com/u/sahilkhan30)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/sahilkhan30/spring-boot

---


# Spring Boot 3.3+ (Java 21) Skill

## Purpose
Standardize backend service architecture, Spring Data JPA usage, layer boundaries, and Java 21 features.

---

## 1. Rules of Engagement

### MANDATORY
- Use Java 21 features (Records, Pattern Matching, Sealed Classes).
- Use Spring Data `Pageable` (`org.springframework.data.domain.Pageable`) internally in Repository and Service interfaces.
- Separate DB Entity classes from external REST DTO records.

### CONDITIONAL
- **Virtual Threads**: Enable Virtual Threads (`spring.threads.virtual.enabled=true` in `application.yml`) when high concurrency I/O blocking demands justify it and no thread-local/pinning issues exist.

### MUST NOT
- Expose JPA `@Entity` classes directly in REST API Controller methods.
- Use raw `Thread.sleep()` or un-managed executor pools.

