springboot-repository-service

Generates Spring Data JPA repositories and transactional service layers for Spring Boot CRUD modules.

1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/codjeremias-cell/Orquestrador-fable --skill springboot-repository-service-codjeremias-cell
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: springboot-repository-service
Source: https://github.com/codjeremias-cell/Orquestrador-fable/tree/main/skills/springboot-repository-service
Command: npx skills add https://github.com/codjeremias-cell/Orquestrador-fable --skill springboot-repository-service-codjeremias-cell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing the data and business-logic layer of a Spring Boot CRUD by hand invites subtle bugs: N+1 queries from missing join fetch, non-atomic multi-step writes, and JPA entities leaking out of the module. This Skill generates the repository and service layer of an entity following validated conventions so those mistakes never ship. ## Core Features & Use Cases - Repository generation: Creates a JpaRepository interface with derived methods, @Query text blocks using join fetch to prevent N+1, and interface projections for lean batch reads. - Service layer generation: Builds a @Service with constructor injection, @Transactional(readOnly = true) on reads, atomic write transactions, and record-based return types so the JPA entity never escapes the module. - Project-style mirroring: Adapts to the target project's conventions (Lombok, custom exceptions, package layout) while preserving invariants like anti-N+1 fetching and transaction boundaries. - Use Case: Ask it to create the repository and service for a Course entity with filtered listing and approval operations, and receive both classes plus a DB_URL-gated @SpringBootTest verified with mvn test. ## Quick Start Use the springboot-repository-service skill to create the repository and service layer for my Course entity with filtered listing and approval operations.

Frequently Asked Questions about springboot-repository-service

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Spring Data JPA repository and service layer for an entity?▼

Provide the existing JPA entity, the desired operations, and the read records the service should return. The skill generates a JpaRepository interface with derived methods or @Query text blocks, plus a @Service class with constructor injection and transactional methods.

How do I prevent N+1 queries in Spring Data JPA?▼

Use join fetch in @Query whenever a query returns an entity and accesses one of its @ManyToOne associations. Without it, each returned row triggers an extra query. The skill applies this invariant automatically in every custom query it writes.

Should a Spring Boot service return JPA entities or DTOs?▼

A service should never return the JPA entity outside its module; it should map results to a Java record before returning. Returning entities risks lazy-loading exceptions outside transactions and couples upper layers to the domain model.

Can I use Lombok @RequiredArgsConstructor instead of a manual constructor?▼

Yes, if the target project already uses Lombok, the skill mirrors that house style and declares the divergence. The invariant is constructor-based injection itself, not the absence of Lombok, and other rules like join fetch and readOnly transactions still apply.

How are service tests run without a database connection?▼

Tests use @SpringBootTest gated by @EnabledIfEnvironmentVariable with DB_URL, so they run against a real Postgres only when the variable is set. A plain mvn test without the database skips them with a declared SKIP rather than a fake pass.

When should I not use this Spring Boot repository skill?▼

Do not use it before the entity and its columns exist, since generation without the confirmed entity is blocked. For entity and migration creation use the entity skill, and for controllers or Thymeleaf screens use the controller skill instead.