Skip to content
Agentmart
Submit a tool

api-design

Universal standards for RESTful API architecture, RFC 7807 error envelopes, cursor-based pagination, idempotency keys, and schema contracts (Zod, Pydantic…

Skill by arvnfly

IndexedMIT★ 1
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/arvnfly-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

Universal standards for RESTful API architecture, RFC 7807 error envelopes, cursor-based pagination, idempotency keys, and schema contracts (Zod, Pydantic, OpenAPI).

Use cases: design, backend, agent-building

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
Universal standards for RESTful API architecture, RFC 7807 error envelopes, cursor-based pagination, idempotency keys, and schema contracts (Zod, Pydantic, OpenAPI).
License
MIT
Instructions
108 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# API Design Standards & Contract Protocol

When designing, implementing, or reviewing APIs (REST, RPC, or GraphQL), adhere strictly to these architectural standards.

---

## 1. Resource Naming & URI Conventions

1. **Plural Nouns for Collections**:
   - `GET /v1/users` (list users)
   - `POST /v1/users` (create user)
   - `GET /v1/users/{id}` (fetch user)
   - `PATCH /v1/users/{id}` (partial update user)
   - `DELETE /v1/users/{id}` (remove user)
2. **Sub-resources for Relationships**:
   - `GET /v1/organizations/{orgId}/members`
   - `POST /v1/organizations/{orgId}/invitations`
3. **No Verbs in URIs**:
   - Bad: `POST /v1/users/create` or `POST /v1/users/deleteUser`
   - Good: `POST /v1/users` or `DELETE /v1/users/{id}`
   - Action exception: When modeling an operation that does not map to CRUD, use explicit sub-actions:
     `POST /v1/deployments/{id}/rollback`

---

## 2. Standardized Response Formats

### Success Payloads
Always wrap top-level items or return consistent object envelopes:

```json
{
  "data": {
    "id": "usr_99824",
    "email": "user@example.com",
    "role": "admin",
    "createdAt": "2026-10-19T09:00:00Z"
  }
}
```

### RFC 7807 Standard Error Envelope
All 4xx and 5xx responses MUST use RFC 7807 Problem Details structure:

```json
{
  "error": {
    "type": "https://api.example.com/errors/validation-failed",
    "title": "Validation Failed",
    "status": 422,
    "detail": "The payload contains invalid fields.",
    "instance": "/v1/users",
    "invalidParams": [
      {
        "name": "email",
        "reason": "Must be a valid email address format"
      }
    ]
  }
}
```

---

## 3. Idempotency Keys on Mutations

For non-idempotent operations (`POST`), require or support the `Idempotency-Key` header:
1. Client transmits unique UUID v4 in `Idempotency-Key: 7b841a54-7f12-4d2a-89aa-0a0d4c9e88b2`.
2. Server verifies cache/store for previous execution with the identical key:
   - In-progress: Return `HTTP 409 Conflict` with `concurrent_mutation`.
   - Completed: Return identical cached HTTP status and body payload.
   - New key: Execute mutation and record result with TTL (typically 24 hours).

---

## 4. Pagination Protocols

### Cursor-Based Pagination (Default for high-velocity datasets)
```
GET /v1/transactions?limit=25&after=cursor_tx_78829
```

Response payload:
```json
{
  "data": [...],
  "pagination": {
    "hasMore": true,
    "nextCursor": "cursor_tx_78854",
    "limit": 25
  }
}
```

### Offset Pagination (Restricted to low-volume administrative tables)
```
GET /v1/audit-logs?page=2&pageSize=50
```

---

## 5. Schema Validation at Trust Boundaries

1. Every inbound payload must validate against a strict schema (e.g. Zod, Pydantic, Joi) before hitting controllers or handlers.
2. Strip unrecognised properties (`stripUnknown: true` or `extra: 'forbid'`) to prevent prototype pollution and parameter injection.
3. Validate parameter types, string lengths, regex patterns, and numeric ranges.

From arvnfly/VIBE-CODE-SKILLS, MIT.

More from arvnfly/VIBE-CODE-SKILLS

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Oct 19, 2026 (10 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from arvnfly

Cite this page

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