302-frameworks-spring-boot-rest — скилл для Claude Code: REST API
Скилл для проектирования и разбора REST API на Spring Boot: методы, коды ответов, DTO, версионирование, пагинация, ошибки по RFC 7807.
npx skills add jabrena/plinth --skill 302-frameworks-spring-boot-rest -a claude-codeЧто делает 302-frameworks-spring-boot-rest
Скилл ведёт агента по правилам дизайна REST в Spring Boot: семантика HTTP-методов, устройство URI ресурсов, коды состояния, тонкие контракты DTO. Отдельно разобраны версионирование через URI, заголовок или media type, согласование контента с JSON по умолчанию и vendor media types, а также ISO-8601 с офсетом в JSON-контрактах.
Внутри — рабочий процесс из четырёх шагов: прочитать references/302-frameworks-spring-boot-rest.md, оценить контекст проекта, внести минимальный набор изменений и прогнать проверку. Перед правками скилл требует собрать проект через ./mvnw compile или mvn compile, а после — выполнить ./mvnw clean verify или mvn clean verify. Если сборка падает, работа останавливается: сначала чините компиляцию, иначе агент просто не тронет код. При размытой постановке скилл останавливается и задаёт уточняющий вопрос.
Темы покрытия: пагинация, сортировка и фильтрация через Page/Pageable с ограничениями, Bean Validation на границе с @Valid/@Validated и ответом 400, идемпотентность POST через Idempotency-Key и 409 при коллизии, конкурентность на ETag с If-Match/If-None-Match, кэширование, заголовки Deprecation и Sunset, безопасность API, contract-first OpenAPI через OpenAPI Generator, @ControllerAdvice и problem details.
Какие задачи решает
- разложить контроллеры и DTO по правилам REST без лишних полей в контракте
- добавить ответы об ошибках в формате RFC 7807 через controller advice
- настроить пагинацию и сортировку с ограничением размера страницы
- защитить создание ресурса от повторных POST через Idempotency-Key
- проставить заголовки Deprecation и Sunset при выводе версии из оборота
Примеры запросов агенту
- Проверь мои Spring Boot контроллеры на соответствие REST-практикам и покажи проблемные места
- Добавь в проект problem details для ошибок и настрой @ControllerAdvice
- Переделай пагинацию в списке заказов на Page/Pageable с ограничением размера страницы
Как установить 302-frameworks-spring-boot-rest
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 302-frameworks-spring-boot-rest -a claude-code2Вручную: положить файлы
~/.claude/skills/302-frameworks-spring-boot-rest/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/302-frameworks-spring-boot-rest/
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 302-frameworks-spring-boot-rest -a codex2Вручную: положить файлы
.agents/skills/302-frameworks-spring-boot-rest/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 302-frameworks-spring-boot-rest -a cursor2Вручную: положить файлы
.cursor/skills/302-frameworks-spring-boot-rest/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install jabrena/plinth 302-frameworks-spring-boot-rest2Вручную: положить файлы
.github/skills/302-frameworks-spring-boot-rest/SKILL.md1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 302-frameworks-spring-boot-rest -a gemini-cli2Командой платформы
gemini skills install https://github.com/jabrena/plinth --path skills/302-frameworks-spring-boot-restВручную: положить файлы
.devin/skills/302-frameworks-spring-boot-rest/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 302-frameworks-spring-boot-rest -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о 302-frameworks-spring-boot-rest
Как установить 302-frameworks-spring-boot-rest в Claude?
Выполните npx skills add jabrena/plinth --skill 302-frameworks-spring-boot-rest -a claude-code. Скилл появится в ~/.claude/skills/302-frameworks-spring-boot-rest/SKILL.md.
Что делает 302-frameworks-spring-boot-rest?
Помогает агенту проектировать, проверять и улучшать REST API на Spring Boot: методы и URI, коды ответов, DTO, версионирование, пагинация, валидация, идемпотентность, кэширование и обработка ошибок.
Что нужно, чтобы скилл сработал?
Проект на Spring Boot с Maven: перед изменениями скилл требует успешной сборки через ./mvnw compile или mvn compile, а после правок — ./mvnw clean verify или mvn clean verify.
Исходный текст
SKILL.md · Apache-2.0
--- name: 302-frameworks-spring-boot-rest description: Use when you need to design, review, or improve REST APIs with Spring Boot — including HTTP methods, resource URIs, status codes, DTOs, versioning, deprecation and sunset headers, content negotiation (JSON and vendor media types), ISO-8601 instants in DTOs, pagination/sorting/filtering, Bean Validation at the boundary, idempotency, ETag concurrency, HTTP caching, error handling, security, contract-first OpenAPI (OpenAPI Generator), controller advice, and problem details for errors. This should trigger for requests such as Review Java code for Spring Boot REST API; Apply best practices for Spring Boot REST API in Java code; Design Spring Boot REST controllers and DTOs; Add Problem Details error responses in Spring Boot REST; Improve pagination validation or idempotency in Spring APIs. Part of Plinth Toolkit license: Apache-2.0 metadata: author: Juan Antonio Breña Moral version: 0.19.0 --- # Java REST API Design Principles Apply REST API design principles for Spring Boot applications. **What is covered in this Skill?** - HTTP methods (GET, POST, PUT, PATCH, DELETE) — semantic consistency - Resource URI design - HTTP status codes - Request/response DTOs with lean contracts - API versioning (URI, header, or media type — applied consistently) - Bean Validation at the boundary (@Valid/@Validated on controller inputs, 400 on failure) - Pagination, sorting, and filtering (Page/Pageable with caps) - ISO-8601 instants with offset (OffsetDateTime, Instant) in JSON contracts - Content negotiation (JSON default; vendor media types when meaningful) - Idempotency-Key support for POST creates; 409 Conflict for collisions - ETag concurrency with If-Match/If-None-Match; 412 Precondition Failed / 304 Not Modified - HTTP caching discipline (Cache-Control, ETag, Last-Modified) - Deprecation and sunset headers (Deprecation, Sunset, Link rel="successor-version)" - Error handling - API security (TLS, authentication, authorization, input validation) - API contract: OpenAPI file as source of truth for API-first (OpenAPI Generator) - Controller advice and problem details (RFC 7807) **Scope:** Apply recommendations based on the reference rules and good/bad code examples. ## Constraints Before applying any REST API changes, ensure the project compiles. If compilation fails, stop immediately. After applying improvements, run full verification. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **SAFETY**: If compilation fails, stop immediately - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements - **BEFORE APPLYING**: Read the reference for detailed rules and good/bad patterns - **EDGE CASE**: If request scope is ambiguous, stop and ask a clarifying question before applying changes - **EDGE CASE**: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance ## When to use this skill - Review Java code for Spring Boot REST API - Apply best practices for Spring Boot REST API in Java code - Design Spring Boot REST controllers and DTOs - Add Problem Details error responses in Spring Boot REST - Improve pagination validation or idempotency in Spring APIs ## Workflow 1. **Read reference and assess project context** Read `references/302-frameworks-spring-boot-rest.md` and inspect the current project setup before proposing changes. 2. **Gather scope and decide target improvements** Identify requested outcomes, constraints, and the minimum safe set of changes to apply. 3. **Apply framework-aligned changes** Implement or refactor configuration/code following the reference patterns and project conventions. 4. **Run verification and report results** Execute appropriate build/tests and summarize what changed, what was verified, and any follow-up actions. ## Reference For detailed guidance, examples, and constraints, see [references/302-frameworks-spring-boot-rest.md](references/302-frameworks-spring-boot-rest.md).
© Juan Antonio Breña Moral · Apache-2.0 · jabrena/plinth