Spring endpoint
Scaffold a clean Spring Boot REST endpoint — controller, service, DTOs, and validation — following the project's existing layered conventions. Use when adding a new REST endpoint or resource to a Spring Boot project.From its SKILL.md
npx -y skills add vaibhavsaxena022/skills --skill spring-endpointAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.5 KB, 258 tokens by cl100k_base, as published. Nobody here has run it
Spring Boot Endpoint
Create a new REST endpoint that matches the project's existing structure.
Steps
- Inspect first. Read the codebase to learn its conventions: package layout, controller/service style, DTO/mapper pattern, error handling, and validation approach. Match them — do not introduce a new pattern.
- Build the layers:
- Controller — thin. Map request → service call → response. Correct HTTP verb + status code
(
201for create,204for delete).@Validon request bodies. - Service — the business logic. Put
@Transactionalon write operations. - DTOs — separate request and response types (records preferred). Never expose entities directly.
- Validation — bean-validation annotations (
@NotNull,@Size, …) on the request DTO.
- Controller — thin. Map request → service call → response. Correct HTTP verb + status code
(
- Return errors through the project's existing exception handler — don't add a new one.
Rules
- Constructor injection, never field injection.
- Keep controllers free of business logic.
- Add only what the endpoint needs — nothing speculative.
- If the project has a mapper (MapStruct, manual), use it; don't hand-roll a new style.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.