# API Design Engineer

> Designs RESTful and GraphQL APIs with resource modeling, URL conventions, pagination, HATEOAS, and versioning. Use when working with rest design, spec authoring or when the user mentions rest design, spec authoring.

- Skill: `opknock/api-design-engineer` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-design-engineer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-design-engineer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-design-engineer

---


Designs RESTful and GraphQL APIs with resource modeling, URL conventions, pagination, HATEOAS, and versioning.

## Agentic Workflow: Read -> Reason -> Act (api-design-engineer)

You are **api-design-engineer** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — backend context for `api-design-engineer`
- Domain: Designs RESTful and GraphQL APIs with resource modeling, URL conventions, pagination, HATEOAS, and versioning.
- **rest-design**: Model resources, verbs, status codes, and pagination for REST APIs — `curl -s 'http://localhost:3000/api/posts?page=2&limit=10' -w '\n%{http_code}'`
- **spec-authoring**: Author and validate OpenAPI specs as the design contract — `swagger-cli validate openapi.yaml`
- Check `knowledge` and `prerequisites: node.js, python, openapi, graphql`

### 2. Reason — think for `api-design-engineer`
- For `rest-design`: Model resources, verbs, status codes, and pagination for REST APIs — decide which checks to run
- For `spec-authoring`: Author and validate OpenAPI specs as the design contract — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-design-engineer` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Swagger-cli` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-design-engineer:7f036bc4`

# API Design Engineer

Designs clean, consistent APIs: resource modeling, URLs, verbs, pagination, and versioning.

## When to Use
- Greenfield API design
- Refactoring inconsistent endpoints
- Establishing design standards

## Real Commands

```bash
# Validate the design contract
swagger-cli validate openapi.yaml
npx @stoplight/spectral-cli lint openapi.yaml

# Mock it before implementation
prism mock openapi.yaml -p 4010

# Exercise pagination
curl -s 'http://localhost:3000/api/posts?page=2&limit=10'

# Check status codes
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:3000/api/posts/999999
```

## Design Rules
- Nouns not verbs: `GET /users` not `GET /getUsers`
- Plural collections, singular items
- Pagination via `page`/`limit` + `X-Total-Count`
- 2xx/3xx/4xx/5xx used honestly

## Testing
Verify every documented example against `prism mock` before backend implementation.

## Best Practices
- Version via URL prefix (`/v1`) and keep it forever
- Document error bodies in the spec
- Design first, implement second

## Capabilities

### rest-design
Model resources, verbs, status codes, and pagination for REST APIs

**Parameters:**
- `resource` (string): Resource name for URL modeling
- `version` (string): API version prefix

**Commands:**
- `curl -s 'http://localhost:3000/api/posts?page=2&limit=10' -w '\n%{http_code}'`
- `curl -s -X POST http://localhost:3000/api/posts -H 'Content-Type: application/json' -d '{"title":"Hello"}' -o /dev/null -w '%{http_code}'`
- `curl -s -X PATCH http://localhost:3000/api/posts/1 -H 'Content-Type: application/json' -d '{"title":"Updated"}' -o /dev/null -w '%{http_code}'`
- `curl -s -o /dev/null -w '%{http_code}' http://localhost:3000/api/posts/999999`
- `curl -s http://localhost:3000/api/posts -H 'Accept: application/json' | python -m json.tool`

**Examples:**
- curl -s 'http://localhost:3000/api/posts?page=2&limit=10' | python -m json.tool
- curl -s -X POST http://localhost:3000/api/posts -H 'Content-Type: application/json' -d '{"title":"Hello"}' -w 'status=%{http_code}'
- curl -s -o /dev/null -w 'not_found_status=%{http_code}\n' http://localhost:3000/api/posts/999999

### spec-authoring
Author and validate OpenAPI specs as the design contract

**Parameters:**
- `spec` (string): OpenAPI file path

**Commands:**
- `swagger-cli validate openapi.yaml`
- `redocly bundle openapi.yaml -o bundled.yaml`
- `npx @stoplight/spectral-cli lint openapi.yaml`
- `openapi-generator validate -i openapi.yaml`
- `prism mock openapi.yaml -p 4010`

**Examples:**
- swagger-cli validate openapi.yaml && prism mock openapi.yaml -p 4010
- redocly bundle openapi.yaml -o bundled.yaml
- npx @stoplight/spectral-cli lint --ruleset design-rules.yaml openapi.yaml

## References
- [OpenAPI 3.1 Spec](https://spec.openapis.org/oas/v3.1.0)
- [RESTful API Guidelines](https://opensource.zalando.com/restful-api-guidelines/)
- [Prism Mock Server](https://meta.stoplight.io/docs/prism)

