agentleFS
AaqibhafeezkhanAaqibhafeezkhan/skillself/skills/spring-boot-endpoint/SKILL.md

spring-boot-endpoint

Skill0 starsChanged 4 days agoMITView on GitHub

The skill scaffolds a Spring Boot REST feature across controller, service, repository, DTO, mapper, exception handling and tests; use it when adding a Java endpoint or implementing a complete backend resource.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 11 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when asked to add a Spring Boot REST endpoint, implement a Java backend feature, scaffold a CRUD resource, or create a …

    line 13
  2. Very specific:

    Read references/layout.md and match the repository's existing naming and layering conventions.

    line 27
  3. Distinctive:

    Add a mapper that avoids leaking persistence entities through the API.

    line 32
  4. Distinctive:

    Add centralized exception mapping with stable error response fields and correct HTTP status codes.

    line 33
  5. Distinctive:

    Add unit tests for service behavior and web-layer tests for validation, success and error responses.

    line 34
  6. Distinctive:

    Run the repository's actual formatter, compile and test commands.

    line 35
  7. Distinctive:

    Ask for the persistence technology if no existing repository pattern is visible.

    line 45
  8. Distinctive:

    Keep a caller-provided ID out of create DTOs unless the business contract requires client-generated identifiers.

    line 46
  9. Distinctive:

    Do not create a duplicate exception framework when one exists.

    line 48
  10. Distinctive:

    Do not put business rules in controllers.

    line 53
  11. Distinctive:

    Do not return JPA entities directly.

    line 54
  12. Distinctive:

    Do not invent dependencies, package names or authorization policy.

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Purpose

Generate a complete layered Spring Boot feature with consistent controller, service, repository, DTO, mapper, exception handling and tests.

When to use

Use this skill when asked to add a Spring Boot REST endpoint, implement a Java backend feature, scaffold a CRUD resource, or create a controller-service-repository implementation.

Inputs needed

  • Resource name and business behavior.
  • Request and response fields with types and validation rules.
  • Existing package root and persistence technology when extending a repository.
  • Authentication and authorization requirements for the endpoint.

Step-by-step procedure

  1. Inspect existing build files, Java version, package layout, API conventions and test framework.
  2. Read references/layout.md and match the repository's existing naming and layering conventions.
  3. Define request/response DTOs separately from persistence entities and expose only approved fields.
  4. Implement a controller that validates input and delegates business behavior to a service.
  5. Implement a service that owns transaction boundaries and domain rules.
  6. Implement a repository using the project's persistence abstraction and explicit query boundaries.
  7. Add a mapper that avoids leaking persistence entities through the API.
  8. Add centralized exception mapping with stable error response fields and correct HTTP status codes.
  9. Add unit tests for service behavior and web-layer tests for validation, success and error responses.
  10. Run the repository's actual formatter, compile and test commands; return only complete files and observed results.

Exact output format

Return sections in this order: Assumptions, File tree, Complete source files, Tests, Commands and results. Under Complete source files, use one heading per path and include the entire file. Include the controller, service implementation, repository interfaces, DTOs, mapper, domain types, exception handler and tests that the feature requires. Under Commands and results, list exact commands and observed exit codes.

Edge cases

  • Ask for the persistence technology if no existing repository pattern is visible.
  • Keep a caller-provided ID out of create DTOs unless the business contract requires client-generated identifiers.
  • Distinguish missing resources from validation failures and conflicts.
  • Do not create a duplicate exception framework when one exists.

Do not

  • Do not put business rules in controllers.
  • Do not return JPA entities directly.
  • Do not invent dependencies, package names or authorization policy.

Worked example summary

A POST /api/v1/orders feature accepts a validated customer ID and line items, creates an order in a service transaction, persists it through a repository and returns an order response DTO. Tests cover valid creation, invalid quantity, unknown customer and duplicate idempotency key.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.