Skip to content
Agentmart
Submit a tool

api-design

Use when designing REST or GraphQL APIs, defining endpoints, request/response shapes, error responses, pagination, versioning, authentication, or OpenAPI specs.

Skill by UgochukwuChidera

IndexedGPL-3.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ugochukwuchidera-api-design

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when designing REST or GraphQL APIs, defining endpoints, request/response shapes, error responses, pagination, versioning, authentication, or OpenAPI specs. Covers RESTful conventions, GraphQL patterns, pagination strategies, idempotency, rate limiting, and API documentation.

Use cases: design, backend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/api-design

What's inside

Skill name
api-design
Description
Use when designing REST or GraphQL APIs, defining endpoints, request/response shapes, error responses, pagination, versioning, authentication, or OpenAPI specs. Covers RESTful conventions, GraphQL patterns, pagination strategies, idempotency, rate limiting, and API documentation.
License
GPL-3.0
Instructions
172 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

## Git Delegation Rule

**HARD RULE**: NEVER run git commands. Delegate ALL git operations to `git-wrangler`.



# API Design

## RESTful Conventions

### URL Structure
```
GET    /api/v1/users              → list users
POST   /api/v1/users              → create user
GET    /api/v1/users/:id          → get user
PATCH  /api/v1/users/:id          → partial update
PUT    /api/v1/users/:id          → full replacement (rare)
DELETE /api/v1/users/:id          → delete user
GET    /api/v1/users/:id/orders   → sub-resource collection
```

Rules:
- **Plural nouns** for resources (`/users`, not `/user`).
- **Lowercase kebab-case** for multi-word (`/order-items`, not `/orderItems`).
- **No verbs** in URLs — use HTTP methods to express intent.
- **Version prefix** (`/v1/`, `/v2/`) for breaking changes, not `Accept` header or query param.

### HTTP Methods
| Method | Safe | Idempotent | Body |
|--------|------|------------|------|
| GET    | ✅   | ✅         | ❌   |
| POST   | ❌   | ❌         | ✅   |
| PUT    | ❌   | ✅         | ✅   |
| PATCH  | ❌   | ❌         | ✅   |
| DELETE | ❌   | ✅         | ❌   |

### Status Codes — Be Precise
```
200 OK           → successful GET, PUT, PATCH
201 Created      → successful POST (include Location header)
204 No Content   → successful DELETE
400 Bad Request  → malformed syntax, missing required fields
401 Unauthorized → missing or invalid auth credentials
403 Forbidden    → authenticated but not allowed
404 Not Found    → resource doesn't exist
409 Conflict     → version conflict, duplicate, state mismatch
422 Unprocessable → semantic validation failure
429 Too Many Requests → rate limited
500 Internal     → unexpected server error
502/503/504      → upstream/gateway issues
```

## Request/Response Design

### Request Body (POST/PATCH)
```json
{
  "email": "user@example.com",
  "name": "string",
  "optional_field": "omit if null"
}
```
- Accept JSON (`application/json`). Accept `application/x-www-form-urlencoded` for simple forms only.
- Use **snake_case** for JSON keys (widest interop). camelCase is acceptable if frontend-dominated.
- **Never** accept raw IDs from clients for creation — generate on server or use idempotency keys.

### Response Envelope (Pagination)
```json
{
  "data": [
    { "id": "1", "name": "Alice" }
  ],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 142,
    "total_pages": 8,
    "next": "/api/v1/users?page=2&per_page=20",
    "prev": null
  }
}
```

### Error Response
```json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Email is required",
    "details": [
      { "field": "email", "code": "required", "message": "must not be blank" }
    ],
    "request_id": "req_abc123"
  }
}
```

## Pagination

### Cursor-based (preferred for lists)
```
GET /api/v1/users?cursor=eyJpZCI6IjQyIn0&limit=20
Response:
{
  "data": [...],
  "next_cursor": "eyJpZCI6Ijc3In0=",
  "has_more": true
}
```
- Stable under insertion — cursor points to an item, not an offset.
- Encode cursor as base64 of `{ id, sort_value }`.
- Use `limit`, not `per_page` (less ambiguous).

### Offset-based (OK for small/admin UIs)
```
GET /api/v1/users?page=1&per_page=20
```
- Unstable — inserting a row shifts all pages.
- Avoid for real-time feeds.

From UgochukwuChidera/Opencode-Agents, GPL-3.0.

More from UgochukwuChidera/Opencode-Agents

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jul 6, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
GPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from UgochukwuChidera

Cite this page

api-design skill. Agent Mart. https://agentmart.dev/skills/ugochukwuchidera-api-design (last updated 2026-10-24)