agentsclimarketplace

Api design

Skill crochee/dotfiles/skills/api-design

Use when designing REST or GraphQL endpoints, defining request/response schemas, or establishing API versioning and authentication conventions.From its SKILL.md

Install
npx -y skills add crochee/dotfiles --skill api-design

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.4 KB, as published. Nobody here has run it

API Design Patterns

Conventions and best practices for designing consistent, developer-friendly REST APIs.

When to Use

  • Designing new API endpoints, reviewing existing API contracts
  • Adding pagination, filtering, or sorting
  • Implementing error handling for APIs
  • Planning API versioning strategy

See references/status-codes.md for complete status code reference.

Resource Design

URL Structure

# Resources are nouns, plural, lowercase, kebab-case
GET    /api/v1/users
GET    /api/v1/users/:id
POST   /api/v1/users
PUT    /api/v1/users/:id
PATCH  /api/v1/users/:id
DELETE /api/v1/users/:id

# Sub-resources for relationships
GET    /api/v1/users/:id/orders

# Actions (use verbs sparingly)
POST   /api/v1/orders/:id/cancel
POST   /api/v1/auth/login

Naming Rules

GOODBAD
/api/v1/team-members/api/v1/getUsers (verb)
/api/v1/orders?status=active/api/v1/user (singular)
/api/v1/users/123/orders/api/v1/team_members (snake_case)

HTTP Methods and Status Codes

MethodIdempotentSafeUse For
GETYesYesRetrieve resources
POSTNoNoCreate resources, trigger actions
PUTYesNoFull replacement
PATCHNo*NoPartial update
DELETEYesNoRemove resource

See references/status-codes.md for complete status code reference with examples.

Response Format

Success Response

{
  "data": {
    "id": "abc-123",
    "email": "[email protected]",
    "name": "Alice"
  }
}

Collection Response (Pagination)

{
  "data": [...],
  "meta": { "total": 142, "page": 1, "per_page": 20 },
  "links": { "self": "...", "next": "..." }
}

Error Response

{
  "error": {
    "code": "validation_error",
    "message": "Request validation failed",
    "details": [{ "field": "email", "message": "Must be valid email" }]
  }
}

See references/response-formats.md for envelope variants and field-level error formatting.

Pagination

Use CaseType
Admin dashboards, small datasetsOffset
Infinite scroll, feeds, large datasetsCursor
Search results (users expect page numbers)Offset

See references/pagination.md for implementation details.

Filtering and Sorting

# Filtering
GET /api/v1/orders?status=active&customer_id=abc-123
GET /api/v1/products?price[gte]=10&price[lte]=100

# Sorting (prefix - for descending)
GET /api/v1/products?sort=-created_at,price

# Sparse fieldsets
GET /api/v1/users?fields=id,name,email

Authentication

# Bearer token
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

# API key (server-to-server)
X-API-Key: sk_live_abc123

See references/auth-patterns.md for authorization patterns.

Rate Limiting

TierLimitWindow
Anonymous30/minPer IP
Authenticated100/minPer user
Premium1000/minPer API key

Versioning

/api/v1/users
/api/v2/users

Rule: Non-breaking changes don't need new version. Breaking changes require new version.

See references/versioning.md for deprecation timeline and breaking change guidelines.

References

Checklist

  • Resource URL follows naming (plural, kebab-case, no verbs)
  • Correct HTTP method used
  • Appropriate status codes returned
  • Input validated with schema
  • Error responses follow standard format
  • Pagination for list endpoints
  • Authentication required
  • Authorization checked
  • Rate limiting configured
  • No internal details leaked

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.