be-api-review
Audit REST API contracts for HTTP semantics, versioning, and consistency. Use when asked to check a controller, an endpoint or an API's design.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- be-api-review
- description
- Audit REST API contracts for HTTP semantics, versioning, and consistency. Use when asked to check a controller, an endpoint or an API's design.
- allowed-tools
- Read, Glob, Grep
- argument-hint
- [controller-path]
- user-invocable
- true
03 SKILL.md 正文
REST API Contract Audit
Audit REST controllers for HTTP semantics, URL patterns, status codes, and consistency.
Instructions
Step 0: Validate Configuration
- Read
.claude/backend-springboot-plugin.json - If missing, tell the user to run
/backend-springboot-plugin:be-initfirst and stop
Step 1: Determine Scope
- If argument provided: audit the specified controller file or directory
- If no argument: find all
@RestControllerclasses in{sourceDir}/{basePackage}/
Step 2: Scan for Issues
Check each controller against these rules:
HTTP Method Semantics
| Method | Expected Use | Expected Status |
|---|---|---|
@PostMapping |
Create new resource | 201 Created |
@GetMapping |
Read resource(s) | 200 OK |
@PutMapping |
Full resource replace | 200 OK |
@PatchMapping |
Partial update | 200 OK |
@DeleteMapping |
Remove resource | 204 No Content |
Flag violations:
- POST used for reads
- GET used for mutations
- Missing
@ResponseStatuswhen status differs from 200
URL Patterns
- URLs must be kebab-case:
/hr/employees, not/hr/Employeesor/hr/employee_list - Resources must be plural:
/employees, not/employee - Nested resources:
/{domain}/{resources}/{id}/{sub-resources} - No verbs in URLs: use HTTP methods instead of
/employees/create - No trailing slashes
Request/Response DTOs
- POST/PUT body should use a Command record (from
command/package) - GET response should use a View record (from
view/package) - Path variables for resource identifiers:
@PathVariable UUID id - Query parameters for filtering/pagination:
@RequestParam
Exception Handling
- Controllers should have
@ExceptionHandlermethods for domain exceptions - Or use a global
@ControllerAdvice - Each domain exception must map to a specific HTTP status code
- Missing exception handlers leave exceptions as 500 Internal Server Error
Pagination
- List endpoints should accept
pageandsizeparameters - Maximum page size should be enforced (capped at a reasonable limit like 20)
- Response should include pagination metadata (total count, current page)
Consistency
- All controllers in the same domain should follow the same patterns
- Naming should match the naming conventions table in
${CLAUDE_PLUGIN_ROOT}/skills/be-spring-shared/SKILL.md - Controller should be a
recordclass (for CQRS architecture)
Step 3: Report
Display findings in the working language:
API Contract Audit
==================
Controllers reviewed: {count}
Endpoints reviewed: {count}
Issues:
{severity} | {controller}:{method} | {rule} — {description}
Suggestion: {fix}
Endpoint Summary:
{method} {url} → {status} {response type}
04 同仓库更多 Skills
hp-shared
Shared conventions for every homepage-plugin agent and skill — stack, code conventions, state-file writes, check commands and how to report them. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
fe-shared
Shared conventions for every frontend-react-plugin agent and skill — code conventions, state files and locks, accepted deviations, design principles, build working directory, router-mode command matrix, TypeScript check. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
be-spring-shared
Shared conventions for every backend-springboot-plugin agent and skill — tech stack, CQRS architecture, naming, coding standards, TDD, commit and build rules, state files. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
pp-translate
Use after directly editing the working language spec to sync changes to other supported languages.
pp-sync-stitch
Use when wireframes were manually edited on the Stitch website and need to be re-fetched to the local project.
pp-sync-notion
Use when a specification needs to be published or re-synced to Notion after finalization or manual edits.