Agent skill

REST API Conventions

by rrezartprebreza in rrezartprebreza/spring-boot-skills

A skill your agent uses when generating REST controllers, DTOs, success response contracts, pagination, HTTP status mapping, or API versioning.

MITAuto-check passedBackend & APIs

Install REST API Conventions

skills CLI
$ npx skills add rrezartprebreza/spring-boot-skills --skill rest-api-conventions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rrezartprebreza/spring-boot-skills rest-api-conventions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rrezartprebreza/spring-boot-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spring-boot-3/rest-api-conventions .claude/skills/rest-api-conventions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rest-api-conventions
GitHub stars
298
Token cost
~1.5k tokens
SKILL.md length
343 words
Files
7
Skills in repo
51
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when generating REST controllers, DTOs, success response contracts, pagination, HTTP status mapping, or API versioning.

  • Generating REST controllers
  • SKILL.md covers Project Contract, ApiResponse Wrapper, HTTP Status Mapping and URL Conventions, plus 3 more sections
  • Runs Java scripts from its folder
  • Success response contracts

What it does

REST API Conventions is an agent skill from rrezartprebreza/spring-boot-skills. Use when generating REST controllers, DTOs, success response contracts, pagination, HTTP status mapping, or API versioning. For RFC 9457 exception and error response formatting, use problem-details-rfc9457 unless the project explicitly requires a legacy error envelope.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files (for example `agents/openai.yaml`).

It sits in Backend & APIs, covering REST APIs and Backend development. It works with Spring Boot. The repository describes itself as: Production-grade Claude Code and Codex skills for Spring Boot developers. The licence is MIT.

When your agent uses it

  • Generating REST controllers
  • Success response contracts
  • HTTP status mapping

Example prompts

  • “/rest-api-conventions”

What it can do on your machine

Read from SKILL.md and the folder at commit f0c06a0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Java), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

REST API Conventions loads about 1.5k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 343 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rrezartprebreza/spring-boot-skills at commit f0c06a0, republished under its MIT licence (© rrezartprebreza). 343 words, ~1,473 tokens.

Download SKILL.mdSave it as .claude/skills/rest-api-conventions/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
rest-api-conventions
description
Use when generating REST controllers, DTOs, success response contracts, pagination, HTTP status mapping, or API versioning. For RFC 9457 exception and error response formatting, use problem-details-rfc9457 unless the project explicitly requires a legacy error envelope.

REST API Conventions

Project Contract

Inspect existing controllers, tests and OpenAPI before choosing a response contract. Preserve the project's IDs, response shape and versioning strategy. Do not migrate unrelated endpoints while adding one route. The envelope below is an optional convention for a project that uses it; plain success DTOs are equally valid. A 204 response has no body.

Success and error formats are independent: an existing success envelope can coexist with RFC 9457 errors. Use one consistent error policy; choose the legacy error examples below only when the project already requires that format.

Example success envelope:

json
{
  "success": true,
  "data": { },
  "error": null,
  "timestamp": "2026-04-13T10:00:00Z"
}

Error response:

json
{
  "success": false,
  "data": null,
  "error": {
    "code": "ORDER_NOT_FOUND",
    "message": "Order with id 123 not found",
    "details": []
  },
  "timestamp": "2026-04-13T10:00:00Z"
}

ApiResponse Wrapper

java
@JsonInclude(JsonInclude.Include.NON_NULL)
public record ApiResponse<T>(
    boolean success,
    T data,
    ApiError error,
    Instant timestamp
) {
    public static <T> ApiResponse<T> ok(T data) {
        return new ApiResponse<>(true, data, null, Instant.now());
    }

    public static <T> ApiResponse<T> error(String code, String message) {
        return new ApiResponse<>(false, null, new ApiError(code, message, List.of()), Instant.now());
    }
}

public record ApiError(String code, String message, List<String> details) {}

HTTP Status Mapping

ScenarioStatus
GET — found200
POST — created resource201
PUT/PATCH — updated200
DELETE — deleted204 (no body)
Validation failure400
Unauthenticated401
Forbidden403
Not found404
Conflict (duplicate)409
Unhandled server error500

URL Conventions

  • Plural nouns for resources: /orders, /users, /products
  • Kebab-case for multi-word: /order-items, not /orderItems
  • Versioning in path: /api/v1/orders
  • Nested resources max 2 levels: /orders/{id}/items ✅, /orders/{id}/items/{itemId}/notes ❌ — flatten to /order-item-notes/{id}
  • IDs: preserve the existing ID type. UUIDs are an option, not an authorization mechanism.
GET    /api/v1/orders              → list (paginated)
POST   /api/v1/orders              → create
GET    /api/v1/orders/{id}         → get one
PUT    /api/v1/orders/{id}         → full update
PATCH  /api/v1/orders/{id}         → partial update
DELETE /api/v1/orders/{id}         → delete
GET    /api/v1/orders/{id}/items   → nested resource

Pagination

json
{
  "success": true,
  "data": {
    "content": [...],
    "page": 0,
    "size": 20,
    "totalElements": 150,
    "totalPages": 8,
    "last": false
  }
}

Query params: ?page=0&size=20&sort=createdAt,desc

Use Spring Data Pageable in controllers:

java
@GetMapping
public ApiResponse<PageResponse<OrderResponse>> list(Pageable pageable) {
    return ApiResponse.ok(PageResponse.from(orderService.findAll(pageable).map(OrderResponse::from)));
}

Cap the page size. A bare Pageable accepts ?size=100000 from any client — one request can drag your whole table into memory. Spring's default cap is 2000, still too high for most APIs:

yaml
spring:
  data:
    web:
      pageable:
        default-page-size: 20
        max-page-size: 100   # requests above this are silently clamped

The compiled PageResponse fixes the JSON pagination contract. Mapping entities to DTOs alone does not stabilize Spring Data PageImpl serialization. Spring Data's org.springframework.data.web.PagedModel is another option when its shape fits the API. Validate sort fields against an allowlist and add an ID tie-breaker to non-unique sorts.

Legacy Envelope Exception Handler

java
@RestControllerAdvice
@RequiredArgsConstructor
public class GlobalExceptionHandler {

    @ExceptionHandler(EntityNotFoundException.class)
    public ResponseEntity<ApiResponse<Void>> handleNotFound(EntityNotFoundException ex) {
        return ResponseEntity.status(404).body(ApiResponse.error("NOT_FOUND", ex.getMessage()));
    }

    @ExceptionHandler(MethodArgumentNotValidException.class)
    public ResponseEntity<ApiResponse<Void>> handleValidation(MethodArgumentNotValidException ex) {
        List<String> details = ex.getBindingResult().getFieldErrors().stream()
            .map(e -> e.getField() + ": " + e.getDefaultMessage()).toList();
        return ResponseEntity.status(400)
            .body(new ApiResponse<>(false, null, new ApiError("VALIDATION_FAILED", "Invalid input", details), Instant.now()));
    }

    @ExceptionHandler(Exception.class)
    public ResponseEntity<ApiResponse<Void>> handleGeneric(Exception ex) {
        return ResponseEntity.status(500).body(ApiResponse.error("INTERNAL_ERROR", "An unexpected error occurred"));
    }
}

Gotchas

  • Agent imposes a new envelope - preserve the existing success contract.
  • Agent invents competing error handlers - use the project's established error contract.
  • Agent puts exception handlers in controllers — always use @RestControllerAdvice
  • Agent changes ID types while adding an endpoint - retain the existing ID scheme.
  • Agent accepts unbounded Pageable — set spring.data.web.pageable.max-page-size or one request can pull the whole table
  • Agent serializes PageImpl directly - map entities to DTOs, then wrap in PageResponse.

© rrezartprebreza, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files in skills/spring-boot-3/rest-api-conventions of rrezartprebreza/spring-boot-skills.

  • SKILL.md
  • agents/openai.yaml
  • examples/bad-controller.java
  • examples/good-controller.java
  • templates/ApiResponse.java
  • templates/GlobalExceptionHandler.java
  • templates/PageResponse.java

Open the folder on GitHubat commit f0c06a0

Compare with similar skills

REST API Conventions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

REST API Conventions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
REST API Conventions this skillrrezartprebreza/spring-boot-skills298—~1.5kAutomated safety check: PassMIT
Dr Jskilljdubois/dr-jskill342—~4.6kAutomated safety check: NotesApache-2.0
Grails Developer Guideapache/grails-core2.9k—~4.9kAutomated safety check: PassApache-2.0
Spring Boot Skillpiomin/sample-spring-modulith144—~668Automated safety check: PassNone
Progensivaprasadreddy/sivalabs-agent-skills188—~2.7kAutomated safety check: NotesMIT
Spring Boot Crud Patternsgiuseppe-trisciuoglio/developer-kit356—~2.5kAutomated safety check: NotesMIT

Similar skills

  • Dr Jskill

    jdubois/dr-jskill

    Creates Java + Spring Boot projects: Web applications, full-stack apps with Vue.js or Angular or React or vanilla JS, PostgreSQL, REST APIs, and Docker.

    342 GitHub stars~4.6k tokensUpdated 10 days ago
    Backend & APIsAuto-check: notes
  • Grails Developer Guide

    apache/grails-core

    Guides building Grails web applications and REST APIs with GORM, controllers, services, views, plugins and Spock and Geb testing.

    2.9k GitHub stars~4.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Spring Boot Skill

    piomin/sample-spring-modulith

    Build Spring Boot 4.x applications following the best practices.

    144 GitHub stars~668 tokensUpdated 14 days ago
    Backend & APIsAuto-check passed
  • Progen

    sivaprasadreddy/sivalabs-agent-skills

    A skill your agent uses when the user wants to create/generate/scaffold a new Spring Boot project (Maven or Gradle, REST API / Web App / Spring Boot + Angular full stack).

    188 GitHub stars~2.7k tokensUpdated 4 days ago
    Backend & APIsAuto-check: notes
  • Spring Boot Crud Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides and generates complete CRUD workflows for Spring Boot 3 services.

    356 GitHub stars~2.5k tokensUpdated 29 days ago
    Backend & APIsAuto-check: notes
  • Spring Boot architecture patterns, REST API design, layered services, data access, caching, async processing, and logging.

    276k GitHub starsUsed in 5 repos~2.5k tokens
    Backend & APIsAuto-check passed

More from rrezartprebreza/spring-boot-skills

All 51 skills in this repo
  • AI Observability

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when adding Spring AI-specific model observations, token usage, latency, externally configured cost attribution, advisor telemetry, or protected prompt and completion logging.

    298 GitHub stars~1.6k tokensUpdated 18 days ago
    Auto-check passed
  • API Versioning

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when versioning Spring MVC or WebFlux APIs in Spring Boot 3 / Spring Framework 6.

    298 GitHub stars~516 tokensUpdated 18 days ago
    Auto-check passed
  • API Versioning

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when versioning Spring MVC or WebFlux APIs in Spring Boot 4 / Spring Framework 7.

    298 GitHub stars~643 tokensUpdated 18 days ago
    Auto-check passed
  • Container Native Deployment

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when packaging a Spring Boot 3 application as an OCI image or GraalVM native executable.

    298 GitHub stars~781 tokensUpdated 18 days ago
    Auto-check passed
  • Container Native Deployment

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when packaging Spring Boot 4 as an OCI image, JVM container, AOT application, or GraalVM native executable.

    298 GitHub stars~706 tokensUpdated 18 days ago
    Auto-check passed
  • Domain Driven Design

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when evolving aggregate invariants, value objects or domain events in an existing DDD-style Spring Boot 3 application, or when DDD is explicitly requested.

    298 GitHub stars~2.1k tokensUpdated 18 days ago
    Auto-check passed

Works with

Categories

Questions about REST API Conventions

What does REST API Conventions do?

A skill your agent uses when generating REST controllers, DTOs, success response contracts, pagination, HTTP status mapping, or API versioning. REST API Conventions is an agent skill from rrezartprebreza/spring-boot-skills. Use when generating REST controllers, DTOs, success response contracts, pagination, HTTP status mapping, or API versioning.

When should I use REST API Conventions?

REST API Conventions fits situations like: generating REST controllers; success response contracts; HTTP status mapping.

How do I install REST API Conventions in Claude Code?

Run `npx skills add rrezartprebreza/spring-boot-skills --skill rest-api-conventions -a claude-code`. Or copy the skill folder (skills/spring-boot-3/rest-api-conventions in rrezartprebreza/spring-boot-skills) into .claude/skills/rest-api-conventions in your project. Claude Code loads it when a task matches its description.

How do I install REST API Conventions in Codex?

Run `npx skills add rrezartprebreza/spring-boot-skills --skill rest-api-conventions -a codex`. Or copy the skill folder (skills/spring-boot-3/rest-api-conventions in rrezartprebreza/spring-boot-skills) into .agents/skills/rest-api-conventions in your project. Codex loads it when a task matches its description.

Can I use REST API Conventions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rrezartprebreza/spring-boot-skills --skill rest-api-conventions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rest-api-conventions, .gemini/skills/rest-api-conventions, .github/skills/rest-api-conventions and .opencode/skills/rest-api-conventions in your project.

What does REST API Conventions need to run?

Going by SKILL.md and its folder, REST API Conventions needs Java for the scripts in its folder.

Does REST API Conventions access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is REST API Conventions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does REST API Conventions use?

REST API Conventions is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does REST API Conventions use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to REST API Conventions?

Skills that share tags, products or a category with REST API Conventions: Dr Jskill (jdubois/dr-jskill, 342 stars), Grails Developer Guide (apache/grails-core, 2.9k stars), Spring Boot Skill (piomin/sample-spring-modulith, 144 stars) and Progen (sivaprasadreddy/sivalabs-agent-skills, 188 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains REST API Conventions?

rrezartprebreza (a GitHub user) maintains it in rrezartprebreza/spring-boot-skills, which has 298 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on September 21, 2026.

Source: rrezartprebreza/spring-boot-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.