Agent skill
api-design
Design RESTful APIs with best practices. Use when creating new endpoints, designing API contracts, or reviewing API structures.
Install this agent skill to your Project
npx add-skill https://github.com/neokn/dotClaude/tree/main/skills/api-design
SKILL.md
API Design Skill
Help design consistent, well-structured RESTful APIs.
Principles
URL Structure
- Use nouns for resources:
/users,/orders - Use plural forms:
/usersnot/user - Nest for relationships:
/users/{id}/orders - Keep URLs shallow (max 2-3 levels)
HTTP Methods
- GET: Read (idempotent, cacheable)
- POST: Create
- PUT: Full update (idempotent)
- PATCH: Partial update
- DELETE: Remove (idempotent)
Status Codes
- 200: Success
- 201: Created
- 204: No Content (successful DELETE)
- 400: Bad Request (client error)
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 409: Conflict
- 422: Unprocessable Entity (validation)
- 500: Server Error
Response Format
{
"data": { ... },
"meta": {
"page": 1,
"total": 100
},
"errors": [
{ "field": "email", "message": "Invalid format" }
]
}
Pagination
- Use cursor-based for large datasets
- Use offset-based for simple cases
- Always include:
page,per_page,total,next_cursor
Versioning
- URL prefix:
/v1/users - Header:
Accept: application/vnd.api+json; version=1
Checklist for New Endpoints
- Clear resource naming
- Correct HTTP method
- Appropriate status codes
- Input validation
- Error response format
- Authentication required?
- Rate limiting needed?
- Documentation updated
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
testing-patterns
Write effective tests with proper structure and coverage. Use when writing unit tests, integration tests, or improving test quality.
git-guardrails-claude-code
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
scaffold-exercises
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
Didn't find tool you were looking for?