specwright/templates/skills/dev-team/architect/api-designing/SKILL.md
# API Designing Skill > Skill: API Designing > Role: Architect > Created: 2026-01-09 > Version: 1.0.0 ## Purpose Designs RESTful, GraphQL, or other API architectures that are intuitive, consistent, scalable, and maintainable. Ensures APIs follow industry best practices and project conventions. ## When to Activate This Skill **Trigger Conditions:** - New API endpoint design - API versioning requirements - API documentation needs - Breaking change evaluation - API performance optimization - T
npx skillsauth add michsindlinger/specwright specwright/templates/skills/dev-team/architect/api-designingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Skill: API Designing Role: Architect Created: 2026-01-09 Version: 1.0.0
Designs RESTful, GraphQL, or other API architectures that are intuitive, consistent, scalable, and maintainable. Ensures APIs follow industry best practices and project conventions.
Trigger Conditions:
Context Signals:
[TECH_STACK_SPECIFIC]
[TECH_STACK_SPECIFIC]
[TECH_STACK_SPECIFIC]
[TECH_STACK_SPECIFIC]
[MCP_TOOLS]
<!-- Populated during skill creation based on: 1. User's installed MCP servers 2. User's selection for this skill Recommended for this skill (examples): - http - Test API endpoints - openapi - Generate and validate OpenAPI specs - [TECH_STACK_SPECIFIC] - Framework-specific API tools Note: Skills work without MCP servers, but functionality may be limited -->Scenario: Design API for blog posts with comments
Design:
[TECH_STACK_SPECIFIC]
RESOURCES:
/api/v1/posts
/api/v1/posts/:id
/api/v1/posts/:id/comments
/api/v1/posts/:id/comments/:comment_id
ENDPOINTS:
GET /api/v1/posts # List all posts (paginated)
POST /api/v1/posts # Create new post
GET /api/v1/posts/:id # Get single post
PUT /api/v1/posts/:id # Update post
DELETE /api/v1/posts/:id # Delete post
GET /api/v1/posts/:id/comments # List post comments
POST /api/v1/posts/:id/comments # Create comment
DELETE /api/v1/posts/:id/comments/:id # Delete comment
RESPONSE FORMAT:
{
"data": {
"id": "123",
"type": "post",
"attributes": {
"title": "API Design Best Practices",
"content": "...",
"published_at": "2026-01-09T10:00:00Z"
},
"relationships": {
"author": { "id": "456", "type": "user" },
"comments": { "count": 5 }
}
},
"meta": {
"timestamp": "2026-01-09T10:00:00Z"
}
}
Scenario: Standardize error responses across API
Design:
[TECH_STACK_SPECIFIC]
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The request could not be processed",
"details": [
{
"field": "email",
"message": "Email is already taken",
"code": "UNIQUENESS_VIOLATION"
}
],
"request_id": "req_abc123xyz",
"timestamp": "2026-01-09T10:00:00Z"
}
}
STATUS CODES:
200 - Success
201 - Created
204 - No Content
400 - Bad Request (validation errors)
401 - Unauthorized (authentication required)
403 - Forbidden (insufficient permissions)
404 - Not Found
422 - Unprocessable Entity (business logic error)
429 - Too Many Requests (rate limited)
500 - Internal Server Error
Scenario: Implement consistent pagination across list endpoints
Design:
[TECH_STACK_SPECIFIC]
REQUEST:
GET /api/v1/posts?page=2&per_page=20&sort=-published_at
RESPONSE:
{
"data": [...],
"pagination": {
"current_page": 2,
"per_page": 20,
"total_pages": 10,
"total_count": 200,
"links": {
"first": "/api/v1/posts?page=1&per_page=20",
"prev": "/api/v1/posts?page=1&per_page=20",
"next": "/api/v1/posts?page=3&per_page=20",
"last": "/api/v1/posts?page=10&per_page=20"
}
}
}
QUERY PARAMETERS:
- page: Page number (default: 1)
- per_page: Items per page (default: 25, max: 100)
- sort: Sort field, prefix with - for descending
- filter[field]: Filter by field value
Scenario: Plan API versioning for backward compatibility
Strategy:
[TECH_STACK_SPECIFIC]
VERSIONING APPROACH: URL-based versioning
- /api/v1/resources
- /api/v2/resources
VERSION LIFECYCLE:
1. Active: Current stable version (v2)
2. Deprecated: Previous version (v1) - 6 month sunset period
3. Sunset: Removed after deprecation period
BREAKING CHANGES (require new version):
- Removing fields from response
- Changing field types
- Modifying required parameters
- Changing authentication mechanism
NON-BREAKING CHANGES (same version):
- Adding optional parameters
- Adding new endpoints
- Adding fields to response
- Adding new status codes
DEPRECATION PROCESS:
1. Announce deprecation 6 months in advance
2. Add deprecation headers to v1 responses:
Deprecation: true
Sunset: 2026-07-09T00:00:00Z
Link: /api/v2/migration-guide
3. Update documentation with migration guide
4. Monitor v1 usage and contact heavy users
5. Remove v1 after sunset date
Scenario: Design GraphQL API alternative
Design:
[TECH_STACK_SPECIFIC]
# Schema
type Post {
id: ID!
title: String!
content: String!
publishedAt: DateTime!
author: User!
comments(first: Int, after: String): CommentConnection!
}
type CommentConnection {
edges: [CommentEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type Query {
post(id: ID!): Post
posts(
first: Int = 25
after: String
filter: PostFilter
sort: PostSort
): PostConnection!
}
type Mutation {
createPost(input: CreatePostInput!): CreatePostPayload!
updatePost(id: ID!, input: UpdatePostInput!): UpdatePostPayload!
deletePost(id: ID!): DeletePostPayload!
}
# Error handling
type Error {
message: String!
path: [String!]
code: String!
}
# Response wrapper
type CreatePostPayload {
post: Post
errors: [Error!]
}
1. GATHER: Understand feature requirements
2. IDENTIFY: Resources and operations needed
3. DESIGN: Endpoint structure and hierarchy
4. DEFINE: Request/response schemas
5. SPECIFY: Authentication and authorization
6. DOCUMENT: API specification
7. VALIDATE: Design against best practices
8. REVIEW: With stakeholders and developers
tools
Session Handoff: Erstellt eine vollständige Zusammenfassung der aktuellen Session für einen sauberen Kontextwechsel. NUR bei explizitem Aufruf (/session-handoff). NICHT automatisch auslösen. Geeignet wenn der User die Session resetten will, den Kontext aufräumen will, oder bei ~120k Tokens angelangt ist.
development
Pre-Mortem Risk Analysis: Strukturierte Prospective-Hindsight-Übung um launch-blocking Risiken vor Commitment aufzudecken. Team stellt sich vor, das Produkt sei 14 Tage nach Launch gefloppt, und arbeitet rückwärts. Klassifiziert Risiken in Tigers (echt), Paper Tigers (hypothetisch), Elephants (unausgesprochen). Nutze diesen Skill vor Build-Commitment, bei zu hoher Stakeholder-Confidence, vor Major-Releases, oder wenn das Team vage Sorgen nicht artikulieren kann. Trigger: /pre-mortem, 'pre-mortem', 'risk analysis', 'was könnte schiefgehen', 'risiken vor launch'.
testing
Six-Sigma Atomicity Validator for create-spec stories
tools
UX pattern definition guidance for navigation, user flows, interactions, and accessibility