api-design-principles
Principles and checklists for designing and reviewing REST and GraphQL APIs; use when defining or evaluating API contracts (endpoints/schemas), naming, error models, pagination, versioning, and REST vs. GraphQL trade-offs.
Install / Use
npx skills add aipoch/medical-research-skills --skill api-design-principlesInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Education & ResearchSupported Platforms
Our assessment of api-design-principles
api-design-principles scores 92/100 on our quality scale, 106th of 421 Education & Research skills we index (top 26%).
Its SKILL.md is 6.6 KB long, well organised into 17 sections with 5 code examples: a thorough specification that gives an agent plenty to work with.
With 1,916 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so api-design-principles is actively maintained.
- Our last check on 2026-10-27 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-03. Automated pattern scan on 2026-10-03. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
api-design-principles compared with similar skills
All 4 of these similar skills score higher than api-design-principles; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| api-design-principles (this skill)by aipoch | 92 | 1.9k | 2mo ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 116.8k | 8d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
| last30days-skillby mvanhorn | 100 | 68.0k | today | CLAUDE.md |
Frequently asked questions
- How do I install api-design-principles?
- Run
npx skills add aipoch/medical-research-skills --skill api-design-principles. The install tabs above show the steps for each supported agent. - Which AI agents does api-design-principles work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is api-design-principles safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is api-design-principles still maintained?
- The repository was last updated about 2 months ago, so api-design-principles is actively maintained.
Skill content
View source on GitHubname: api-design-principles description: Principles and checklists for designing and reviewing REST and GraphQL APIs; use when defining or evaluating API contracts (endpoints/schemas), naming, error models, pagination, versioning, and REST vs. GraphQL trade-offs. license: MIT author: AIPOCH
API Design Principles
When to Use
- Designing a new REST API contract for CRUD-style resources and you need consistent resource modeling, naming, and HTTP semantics.
- Designing a new GraphQL schema for multiple clients with different data shapes and you need clear type/field ownership and safe evolution.
- Reviewing an existing API (REST or GraphQL) to identify inconsistencies in naming, error handling, pagination/filtering, or versioning/deprecation.
- Deciding between REST vs. GraphQL (or defining boundaries when mixing both) and documenting trade-offs and constraints.
- Standardizing cross-cutting concerns (authn/authz, rate limiting, observability, long-running operations, idempotency) across multiple services.
Key Features
- End-to-end workflow for API design/review: requirements → style choice → domain modeling → operations → cross-cutting concerns → deliverables.
- REST guidance: resource-oriented modeling, stable identifiers, relationship patterns, and correct HTTP verb usage.
- GraphQL guidance: schema/type modeling, Query vs. Mutation separation, input types for writes, and explicit side-effect handling.
- Cross-cutting design patterns: consistent error model, pagination/filtering/sorting, versioning and deprecation strategy, and operational concerns.
- Review checklist to validate completeness, highlight risks/gaps, and produce actionable follow-ups.
Dependencies
- None (documentation-only skill).
- Reference documents:
references/rest.mdreferences/graphql.mdreferences/review-checklist.md
Example Usage
Goal
Design (or review) an API for managing Projects and Tasks, and produce a contract with examples, error model, pagination, and a checklist summary.
Step 1: Clarify requirements and constraints
- Consumers: Web app + mobile app + internal admin.
- Constraints: p95 latency < 200ms for list endpoints; PII present; audit logging required.
- Core use cases: list projects, view project, create task, update task status, search tasks by status/assignee.
Step 2: Choose API style and boundaries
- Choose REST for resource-oriented CRUD with cacheable reads and straightforward endpoints.
- If GraphQL is later introduced for client-specific views, define boundaries (e.g., GraphQL for read aggregation; REST remains source-of-truth for writes).
Step 3: Produce a REST contract skeleton (runnable examples)
Base URL
https://api.example.com/v1
Resources
projectstasks(scoped under a project)
Endpoints
GET /v1/projectsPOST /v1/projectsGET /v1/projects/{projectId}GET /v1/projects/{projectId}/tasksPOST /v1/projects/{projectId}/tasksPATCH /v1/projects/{projectId}/tasks/{taskId}
List projects (pagination + filtering)
Request
curl -sS -X GET "https://api.example.com/v1/projects?limit=20&cursor=eyJpZCI6IjEwMCJ9&sort=createdAt:desc" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"
Response (200)
{
"data": [
{
"id": "proj_123",
"name": "Roadmap 2026",
"createdAt": "2026-01-10T12:00:00Z"
}
],
"page": {
"limit": 20,
"nextCursor": "eyJpZCI6InByb2pfMTIzIn0="
}
}
Create a task (idempotency)
Request
curl -sS -X POST "https://api.example.com/v1/projects/proj_123/tasks" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: 2b7b1a2e-7f2b-4c2a-9c2b-0b3b7c9d1a11" \
-H "Content-Type: application/json" \
-d '{
"title": "Draft API spec",
"assigneeId": "user_42",
"dueAt": "2026-03-01T00:00:00Z"
}'
Response (201)
{
"data": {
"id": "task_999",
"projectId": "proj_123",
"title": "Draft API spec",
"status": "OPEN",
"assigneeId": "user_42",
"dueAt": "2026-03-01T00:00:00Z",
"createdAt": "2026-02-25T09:00:00Z"
}
}
Error model example
Response (409)
{
"error": {
"code": "CONFLICT",
"message": "A task with the same title already exists in this project.",
"details": {
"field": "title",
"reason": "DUPLICATE"
},
"requestId": "req_01HTZQ8K7Y9M2A3B4C5D6E7F8G"
}
}
Step 4: Run the review checklist
Use references/review-checklist.md to validate:
- Naming consistency (resources, fields, enums)
- HTTP semantics and status codes
- Pagination/filtering/sorting rules
- Error model completeness and stability
- Versioning/deprecation plan
- Security and observability requirements
Expected deliverable format (save to outputs/)
- API style choice + trade-offs
- Contract skeleton (endpoints or schema)
- Request/response (or query/mutation) examples
- Error model + pagination strategy
- Checklist results + risks/gaps
Implementation Details
Recommended workflow (design/review)
-
Clarify requirements and constraints
- Identify domain, core use cases, and consumer types (web/mobile/partners/internal).
- Capture constraints: latency, throughput, consistency, compliance, data sensitivity.
-
Choose API style and boundaries
- REST: best for resource-oriented APIs, cacheable reads, and simple CRUD.
- GraphQL: best for multiple clients with varying data shapes and frequent iteration.
- If mixing, define boundaries to avoid overlapping responsibilities.
-
Domain modeling
- REST: model stable resources (nouns), stable identifiers, and relationships.
- GraphQL: define types and field ownership; use input types for writes.
-
Operation and behavior design
- REST: map operations to HTTP verbs; represent actions via sub-resources or noun-based endpoints when needed.
- GraphQL: separate
Queryvs.Mutation; document side effects explicitly. - Define idempotency (especially for creates) and patterns for long-running tasks when applicable.
-
Cross-cutting concerns
- Authentication/authorization
- Error model (stable codes, actionable messages, request correlation IDs)
- Pagination, filtering, sorting (document defaults and limits)
- Versioning and deprecation strategy
- Observability (logging/metrics/tracing), rate limiting
Reference guides
- REST Principles and Patterns:
references/rest.md - GraphQL Principles and Patterns:
references/graphql.md - Review Checklist:
references/review-checklist.md
Related Skills
taste-skill
116.8kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
last30days-skill
68.0kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
