spring-data-jpa
Installation
SKILL.md
Spring Data JPA Implementation
Purpose
Use this skill when the task is specifically about persistence design or implementation in a Spring Boot codebase. This skill adds value through aggregate-root guidance, query-pattern selection, CQRS read-model decisions, and the bundled repository and relationship templates.
Critical rules
- Never create repositories for every entity. Create repositories only for aggregate roots.
- Never rely on long derived query method names when the query has become non-trivial.
- Never use
save()blindly when entity state transitions matter; understand persist versus merge behavior. - Prefer projections or dedicated query services for read-heavy paths.
- Keep transaction boundaries in the service layer unless the existing architecture intentionally does otherwise.
Workflow
Step 1: Identify the persistence problem
Collect the minimum context first: