
Spring Boot Crud Patterns
Generate layered Spring Boot CRUD APIs from JSON entity specs with correct HTTP semantics, validation, and repository adapters.
Overview
spring-boot-crud-patterns is an agent skill for the Build phase that generates layered Spring Boot CRUD features from JSON specs with REST status codes, validation, and repository adapters.
Install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill spring-boot-crud-patternsWhat is this skill?
- JSON entity spec drives domain, persistence, service, DTO, and REST layers
- Python generate_crud_boilerplate.py script with package and templates-dir flags
- HTTP conventions: POST 201, GET 200, PUT/PATCH 200, DELETE 204
- Jakarta validation on request DTOs; Spring Data adapters behind feature repositories
- Example Product feature skeleton lists nine layered files from model through controller
- Documented REST status codes: POST 201, GET 200, PUT/PATCH 200, DELETE 204
- Product feature skeleton spans nine Java layers from domain model to REST controller
Adoption & trust: 1.2k installs on skills.sh; 271 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have entity shapes in mind but lack a consistent Spring Boot folder layout, HTTP conventions, and codegen path your agent can repeat for every new resource.
Who is it for?
Indie backend developers on Spring Boot who want spec-driven CRUD scaffolding with hexagonal-style adapters.
Skip if: GraphQL-only APIs, reactive WebFlux stacks without adaptation, or teams forbidding codegen in favor of hand-written controllers only.
When should I use this skill?
When scaffolding Spring Boot REST CRUD for entities defined in JSON specs or when aligning new resources to the skill’s layered Product feature structure.
What do I get? / Deliverables
You receive generated domain, persistence, service, DTO, and controller files aligned to the skill’s CRUD reference, ready to wire into your Spring Boot app.
- Generated feature package with model, repository, service, DTOs, and controller
- CRUD endpoints following documented HTTP status conventions
Recommended Skills
Journey fit
Backend entity APIs are created during core product construction after validation and before ship hardening. The skill targets domain models, JPA persistence, services, DTOs, and REST controllers—the backend slice of Build.
How it compares
A spec-driven CRUD generator skill, not a Spring Security hardening or deployment playbook.
Common Questions / FAQ
Who is spring-boot-crud-patterns for?
Solo builders and small teams using agent-assisted Java development who need repeatable REST CRUD modules in Spring Boot.
When should I use spring-boot-crud-patterns?
Use it in Build → backend when defining new JPA entities and REST endpoints, especially when you can express the model in the skill’s JSON spec format.
Is spring-boot-crud-patterns safe to install?
It includes a local Python generator script—review generated code and the Security Audits panel on this Prism page before running in CI or production repos.
SKILL.md
READMESKILL.md - Spring Boot Crud Patterns
{ "entity": "Order", "id": { "name": "id", "type": "Long", "generated": true }, "fields": [ { "name": "orderNumber", "type": "String" }, { "name": "total", "type": "BigDecimal" } ], "relationships": [ { "type": "ONE_TO_MANY", "name": "items", "target": "OrderItem", "mappedBy": "order" } ] } { "entity": "Product", "id": { "name": "id", "type": "Long", "generated": true }, "fields": [ { "name": "name", "type": "String" }, { "name": "price", "type": "BigDecimal" }, { "name": "inStock", "type": "Boolean" } ] } # CRUD Reference (Quick) - Status codes: POST 201, GET 200, PUT/PATCH 200, DELETE 204. - Validation: jakarta.validation annotations on DTOs. - Repositories: feature-scoped interfaces + Spring Data adapters. # Product Feature Examples (Skeleton) Feature structure: - domain/model/Product.java - domain/repository/ProductRepository.java - infrastructure/persistence/ProductEntity.java - infrastructure/persistence/ProductJpaRepository.java - infrastructure/persistence/ProductRepositoryAdapter.java - application/service/ProductService.java - presentation/dto/ProductRequest.java - presentation/dto/ProductResponse.java - presentation/rest/ProductController.java # CRUD Generator Usage Quick start: ``` python skills/spring-boot-crud-patterns/scripts/generate_crud_boilerplate.py \ --spec skills/spring-boot-crud-patterns/assets/specs/product.json \ --package com.example.product \ --output ./generated \ --templates-dir skills/spring-boot-crud-patterns/templates [--lombok] ``` Spec (JSON/YAML): - entity: PascalCase name (e.g., Product) - id: { name, type (Long|UUID|...), generated: true|false } - fields: array of { name, type } - relationships: optional (currently model as FK ids in fields) What gets generated: - REST controller at /v1/{resources} with POST 201 + Location header - Pageable list endpoint returning PageResponse<T> - Application mapper (application/mapper/${Entity}Mapper) for DTO↔Domain - Exception types: ${Entity}NotFoundException, ${Entity}ExistException + ${Entity}ExceptionHandler - GlobalExceptionHandler with validation + DataIntegrityViolationException→409 DTOs: - Request excludes id when id.generated=true - Response always includes id JPA entity: - `@`Id with `@`GeneratedValue(IDENTITY) for numeric generated ids Notes: - Provide all templates in templates/ (see templates/README.md) - Use --lombok to add Lombok annotations without introducing blank lines between annotations # Spring Docs Pointers - Spring Boot Reference Guide - Spring Data JPA Reference - Validation (Jakarta Validation) package $package.presentation.rest; $lombok_common_imports import org.springframework.http.ResponseEntity; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import jakarta.validation.Valid; import $package.application.service.Create${entity}Service; import $package.application.service.Get${entity}Service; import $package.application.service.Update${entity}Service; import $package.application.service.Delete${entity}Service; import $package.application.service.List${entity}Service; import $package.presentation.dto.$EntityRequest; import $package.presentation.dto.$EntityResponse; import $package.presentation.dto.PageResponse; import org.springframework.data.domain.Pageable; @RestController$controller_annotations_block @RequestMapping("$base_path") public class ${entity}Controller { private final Create${entity}Service createService; private final Get${entity}Service getService; private final Update${entity}Service updateService; private final Delete${entity}Service deleteService; private final List${entity}Service listService; $controller_constructor @PostMapping public ResponseEntity<$EntityResponse> create(@RequestBody @Valid $EntityRequest request) { $EntityResponse created = createService.create(request); return ResponseEntity.status(HttpStatus.CREATED)