Skip to content

decebals/claude-code-java / skills/spring-boot-patterns

spring-boot-patterns

Unverified

Spring Boot best practices and patterns. Use when creating controllers, services or repositories, or when the user asks about Spring Boot layering, wiring, configuration or exception handling. For JPA and Hibernate behaviour, use jpa-patterns instead.

FileKindSize
README.mdmarkdown1.3 KB
SKILL.mdskill md12.5 KB
# Spring Boot Patterns

**Load**: `view .claude/skills/spring-boot-patterns/SKILL.md`

---

## Description

Best practices and patterns for Spring Boot applications. Covers project structure, layered architecture, DTOs, exception handling, configuration, and testing.

---

## Use Cases

- "Create a REST controller for products"
- "Add service layer for user management"
- "Setup global exception handling"
- "How should I structure this Spring Boot project?"

---

## Examples

```
> view .claude/skills/spring-boot-patterns/SKILL.md
> "Create UserController with CRUD endpoints"
→ Generates controller following REST conventions with proper status codes
```

---

## Patterns Covered

| Layer | Topics |
|-------|--------|
| Controller | REST conventions, validation, status codes |
| Service | Interface + Impl, transactions, mappers |
| Repository | JPA queries, derived methods, optimization |
| DTO | Request/Response records, MapStruct |
| Exception | Custom exceptions, global handler |
| Config | Properties, profiles, validation |
| Testing | MockMvc, Mockito, Testcontainers |

---

## Notes / Tips

- Use constructor injection (Lombok `@RequiredArgsConstructor`)
- Default `@Transactional(readOnly = true)` at service class level
- Never expose entities directly - use DTOs
- Prefer records for DTOs (Java 17+)
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 195kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 192kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 192kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 192kUpdated Claude CodeCodexVerifiedInstall