Skip to content
Back to skills

Senior Api Design

ASecurity

Use when designing, reviewing, documenting, or evolving API contracts for REST, GraphQL, gRPC, webhooks, or events, including resource modeling, naming, HTTP methods and status codes, error formats, pagination, filtering, idempotency, versioning and deprecation, authentication, rate limits, or OpenAPI/AsyncAPI specs.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentsapi

Works with

  • cursor
  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 26, 2026

npx -y skills add a365ngay/CogniRouter --skill senior-api-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Senior Api Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Senior Api Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a365ngay-senior-api-design/badge)](https://www.skillsdirectory.com/skills/a365ngay-senior-api-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: senior-api-design
description: Use when designing, reviewing, documenting, or evolving API contracts for REST, GraphQL, gRPC, webhooks, or events, including resource modeling, naming, HTTP methods and status codes, error formats, pagination, filtering, idempotency, versioning and deprecation, authentication, rate limits, or OpenAPI/AsyncAPI specs.
---

# Senior API Design

## Role

Design APIs that are consistent, hard to misuse, evolvable without breaking clients, and documented as a contract.

## Before Designing

1. Read existing API conventions (naming, casing, error format, pagination, auth, versioning) and any OpenAPI, GraphQL schema, or proto files.
2. Identify consumers, their use cases, expected volume, and compatibility requirements.
3. Treat any change to a published contract as potentially breaking until proven otherwise.

## Design Rules

- Model resources and operations from consumer use cases; use consistent nouns, casing, and identifiers across the API.
- Use HTTP methods and status codes by their semantics (201 with Location on create, 204 on empty success, 400/422 validation, 401 vs 403, 404, 409 conflict, 429 rate limit). Use one documented error format (for example RFC 9457 problem details) with machine-readable codes.
- Paginate every list (cursor-based for large or changing sets), with bounded page sizes and documented filtering and sorting.
- Make unsafe operations safe to retry with idempotency keys; make webhooks signed, retried with backoff, and idempotent for receivers.
- Evolve additively: new optional fields and endpoints are compatible; removing or renaming fields, changing types, or tightening validation is breaking and needs versioning and a deprecation period.
- Specify authentication, authorization scopes, rate limits, and timeouts. Never put secrets or personal data in URLs.
- For GraphQL, bound query depth and cost and avoid N+1 resolvers; for gRPC, never reuse or renumber proto field numbers.

## Verification

Keep the spec (OpenAPI, schema, proto) in sync with the implementation and validate it with the project's linter (Spectral, buf, graphql-inspector). Add contract or API tests for status codes, error bodies, and pagination.

## Review Checklist

- Is the contract consistent with the rest of the API?
- Is every change backward compatible, or versioned with a deprecation plan?
- Are errors, pagination, and idempotency defined?
- Is the spec accurate and validated?

Files in this skill

  • SKILL.md2.4 KB
  • agents/openai.yaml204 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.