Designs and implements Spring Data JPA repositories, projections, custom repositories, CQRS read models, entity relationships, and persistence performance fixes for Java 25 and Spring Boot 4.
How this skill is triggered — by the user, by Claude, or both
Slash command
/springboot-architecture:spring-data-jpaThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
assets/custom-repository.javaassets/dto-projection.javaassets/query-repository.javaassets/query-service.javaassets/relationship-patterns.javareferences/cqrs-query-service.mdreferences/custom-repositories.mdreferences/dto-projections.mdreferences/performance-guide.mdreferences/query-patterns.mdreferences/relationships.mdUse 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.
save() blindly when entity state transitions matter; understand persist versus merge behavior.Collect the minimum context first:
Use this table to decide what to load next.
| Pattern | Use when | Read |
|---|---|---|
| Simple repository | Basic CRUD and 1-2 simple lookups | Existing code or none |
@Query repository | Multiple filters, joins, sorting, readable JPQL | references/query-patterns.md |
| DTO projection | Read-only and performance-critical responses | references/dto-projections.md |
| Custom repository | Criteria API, bulk operations, EntityManager logic | references/custom-repositories.md |
| CQRS query service | Separate read and write models, reporting, specialized read paths | references/cqrs-query-service.md |
Use this decision guide:
| Need | Simple | @Query | DTO | Custom | CQRS |
|---|---|---|---|---|---|
| Basic CRUD | Yes | Yes | No | Yes | Yes |
| Custom filters | No | Yes | Yes | Yes | Yes |
| Best read performance | No | Sometimes | Yes | Sometimes | Yes |
| Complex dynamic logic | No | No | No | Yes | Yes |
| Clear read/write split | No | No | Sometimes | Sometimes | Yes |
Load only the references needed for the current task:
references/query-patterns.mdreferences/dto-projections.mdreferences/custom-repositories.mdreferences/cqrs-query-service.mdreferences/relationships.mdreferences/performance-guide.mdUse the bundled templates in assets/ instead of rebuilding the pattern from scratch:
assets/query-repository.javaassets/dto-projection.javaassets/custom-repository.javaassets/query-service.javaassets/relationship-patterns.javaBefore finalizing the change, check:
@ManyToMany has not been introduced when a join entity is more appropriate@Transactional(readOnly = true) where appropriateRead references/performance-guide.md when the task includes:
@Query for joins, readable text blocks, or multiple filters.@ManyToOne over @OneToMany when possible.@ManyToMany as a warning sign; prefer an explicit join entity.When proposing or implementing a persistence change, return:
## Recommended pattern
- Pattern:
- Why:
## Files to change
- `path/to/file`
## References used
- `references/...`
## Risks to verify
- ...
creating-springboot-projectsnpx claudepluginhub p/a-pavithraa-springboot-architecture-plugins-springboot-architectureSpring Data JPA entity design, repository patterns, query methods, JPQL, Flyway/Liquibase migrations, and N+1 avoidance. Apply on Spring Boot projects with spring-boot-starter-data-jpa. Pairs with spring-boot-plugin:spring-conventions and java-foundation:java-conventions. Use this skill to: - Design JPA entities with proper annotations, ID strategy, and lazy loading. - Write JpaRepository interfaces with derived query methods and JPQL @Query. - Avoid N+1 queries using @EntityGraph or JOIN FETCH. - Manage schema evolution with Flyway or Liquibase. - Project query results with Spring Data Projections and DTOs. Do NOT use this skill for: - Service or controller patterns — see spring-boot-plugin:spring-conventions. - Build tool setup — see java-foundation:build-tooling. - Test slices (@DataJpaTest) — see java-foundation:jvm-testing.
Provides rules and guidelines for Spring Data JPA entity, repository, and projection changes. Invoked automatically on JPA-related requests.
Provides JPA/Hibernate patterns for Spring Boot entity design, associations with N+1 prevention, repositories, transactions, auditing, pagination, indexing, performance tuning, and HikariCP pooling. Useful for data layer development and optimization.