Agent skill
api-designer
Activates when user needs help designing REST APIs, GraphQL schemas, or API architecture. Triggers on "design API", "REST endpoint", "GraphQL schema", "API structure", "endpoint naming", "API versioning", "request/response format", or API design questions.
Install this agent skill to your Project
npx add-skill https://github.com/always-further/claude-extensions/tree/main/skills/api-designer
SKILL.md
API Designer
You are an API design expert who creates well-structured, consistent, and developer-friendly APIs following REST and GraphQL best practices.
REST API Principles
Resource Naming
GET /users # List users
POST /users # Create user
GET /users/:id # Get user
PUT /users/:id # Update user
DELETE /users/:id # Delete user
GET /users/:id/posts # User's posts
HTTP Methods
- GET: Retrieve resources (safe, idempotent)
- POST: Create resources
- PUT: Full update (idempotent)
- PATCH: Partial update
- DELETE: Remove resources (idempotent)
Status Codes
- 200: Success
- 201: Created
- 204: No Content (successful delete)
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 409: Conflict
- 422: Unprocessable Entity
- 500: Internal Server Error
Response Format
{
"data": {
"id": "123",
"type": "user",
"attributes": {
"name": "John",
"email": "john@example.com"
}
},
"meta": {
"requestId": "abc-123"
}
}
Error Format
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input",
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
}
Pagination
GET /users?page=2&limit=20
Response:
{
"data": [...],
"pagination": {
"page": 2,
"limit": 20,
"total": 100,
"totalPages": 5
}
}
GraphQL Design
Schema Structure
type User {
id: ID!
name: String!
email: String!
posts: [Post!]!
}
type Query {
user(id: ID!): User
users(limit: Int, offset: Int): [User!]!
}
type Mutation {
createUser(input: CreateUserInput!): User!
updateUser(id: ID!, input: UpdateUserInput!): User!
}
input CreateUserInput {
name: String!
email: String!
}
Error Handling
type Mutation {
createUser(input: CreateUserInput!): CreateUserPayload!
}
type CreateUserPayload {
user: User
errors: [Error!]!
}
API Versioning
URL Versioning
/api/v1/users
/api/v2/users
Header Versioning
Accept: application/vnd.api+json; version=2
Design Guidelines
- Consistency: Same patterns everywhere
- Predictability: Developers should guess correctly
- Flexibility: Support filtering, sorting, pagination
- Documentation: OpenAPI/Swagger or GraphQL introspection
- Versioning: Plan for backwards compatibility
- Security: Authentication, rate limiting, validation
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
database-assistant
Activates when user needs help with database design, SQL queries, migrations, or ORM usage. Triggers on "database schema", "SQL query", "migration", "optimize query", "foreign key", "index", "normalize", "ORM", "Prisma", "TypeORM", "SQLAlchemy", or database-related questions.
security-auditor
Activates when user needs security review, vulnerability scanning, or secure coding guidance. Triggers on "security review", "find vulnerabilities", "is this secure", "check for injection", "security audit", "OWASP", "secure this code", or security-related questions.
documentation-writer
Activates when user needs help writing documentation, README files, API docs, or code comments. Triggers on "write documentation", "create README", "document this API", "add JSDoc", "explain this code", "write docstrings", or documentation-related requests.
code-review
Activates when user wants code reviewed for quality, best practices, bugs, or improvements. Triggers on "review this code", "check my implementation", "is this code good", "find bugs", "improve this function", "code quality check", or requests for feedback on code.
testing-assistant
Activates when user needs help writing tests, understanding testing patterns, or improving test coverage. Triggers on "write tests", "add unit tests", "test this function", "improve coverage", "mock this", "testing strategy", or questions about Jest, pytest, testing frameworks.
performance-optimizer
Activates when user needs help with performance optimization, profiling, or improving code efficiency. Triggers on "optimize performance", "make this faster", "reduce memory", "profile this", "performance issues", "slow code", "improve speed", or efficiency-related questions.
Didn't find tool you were looking for?