Install
$ agentstack add skill-viknesh20-20-claude-code-tool-kit-api-design ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
API Design
Existing API Patterns
!find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.java" -o -name "*.rb" -o -name "*.cs" \) -path "*/route*" -o -path "*/controller*" -o -path "*/handler*" -o -path "*/endpoint*" -o -path "*/api*" 2>/dev/null | grep -v node_modules | grep -v vendor | grep -v .git | head -20
!find . -name "openapi*" -o -name "swagger*" -o -name "*.graphql" -o -name "*.gql" -o -name "schema.*" 2>/dev/null | grep -v node_modules | head -10
Design Process
Step 1: Understand the Domain
- Identify the resource(s) being modeled
- Define the data model with all fields and types
- Map relationships between resources
- Identify the consumers (frontend, mobile, third-party)
Step 2: Design Endpoints (REST)
For each resource, define:
| Method | Endpoint | Description | Auth | |--------|----------|-------------|------| | GET | /api/v1/{resources} | List all (paginated) | Required | | GET | /api/v1/{resources}/:id | Get single by ID | Required | | POST | /api/v1/{resources} | Create new | Required | | PUT | /api/v1/{resources}/:id | Full update | Required | | PATCH | /api/v1/{resources}/:id | Partial update | Required | | DELETE | /api/v1/{resources}/:id | Delete | Required |
Step 3: Define Schemas
For each endpoint, define:
- Request body (JSON schema with types, required fields, validation rules)
- Response body (JSON schema with all fields)
- URL parameters (path params, query params for filtering/sorting/pagination)
- Headers (Content-Type, Authorization, custom headers)
Step 4: Error Handling
Standard error response format:
{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Human-readable description",
"details": []
}
}
Standard HTTP status codes:
200OK — successful GET/PUT/PATCH201Created — successful POST204No Content — successful DELETE400Bad Request — validation errors401Unauthorized — missing/invalid auth403Forbidden — insufficient permissions404Not Found — resource doesn't exist409Conflict — duplicate or state conflict422Unprocessable Entity — valid JSON but semantic errors429Too Many Requests — rate limited500Internal Server Error — unexpected failure
Step 5: Pagination, Filtering, Sorting
Pagination (cursor or offset):
GET /api/v1/users?page=2&per_page=20
GET /api/v1/users?cursor=abc123&limit=20
Filtering:
GET /api/v1/users?status=active&role=admin
Sorting:
GET /api/v1/users?sort=created_at&order=desc
Step 6: Generate Specification
Output an OpenAPI 3.0 spec (YAML) or GraphQL schema as appropriate for the project.
Design Principles
- Use plural nouns for resource names (
/usersnot/user) - Use kebab-case for multi-word endpoints (
/user-profiles) - Version the API (
/api/v1/) - Be consistent with existing patterns in the project
- Follow REST constraints: stateless, cacheable, uniform interface
- Design for the consumer, not the database schema
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: viknesh20-20
- Source: viknesh20-20/claude-code-tool-kit
- License: MIT
- Homepage: https://viknesh20-20.github.io/claude-code-tool-kit/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.