rest-api-design · aj-geddes — Claude Code skill: design REST APIs
This skill gives your agent rules for resource naming, HTTP methods, status codes and versioning when you build new endpoints or clean up old ones.
npx skills add aj-geddes/useful-ai-prompts --skill rest-api-design -a claude-codeWhat rest-api-design does
The skill loads into your agent and steers REST API structure: resources are nouns in plural, methods and status codes match the operation, collections get pagination, filtering and sorting. It ships a quick start with good and bad endpoint names plus reference guides in references/: resource naming, request examples, query parameters, response formats, HTTP status codes, versioning, authentication, rate limiting headers and OpenAPI documentation. One file walks through a complete Express.js example.
It earns its place when an API has drifted — singular and plural mixed in the same route tree, errors returned with a 200. The skill lists what to avoid: verbs in paths, nesting past two levels, internal IDs leaking into responses. Dates should follow ISO 8601.
The reference guides are separate files, so if the agent never opens references/, you get only the general advice from the main file. Install runs through npx skills add; GitHub Copilot uses gh skill install instead.
What it helps with
- sketch endpoint structure for a new service
- rename resources and strip verbs out of paths
- pick proper status codes instead of 200 on every error
- add pagination, filtering and sorting to collections
- write an OpenAPI spec and plan API versioning
Example prompts for the agent
- Design a REST API for orders: resources, methods, status codes
- Review the endpoints in
routes/and flag naming violations - Write an OpenAPI spec for the current routes and add pagination
How to install rest-api-design
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill rest-api-design -a claude-code2Manually: put the files in place
~/.claude/skills/rest-api-design/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/rest-api-design/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill rest-api-design -a codex2Manually: put the files in place
.agents/skills/rest-api-design/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill rest-api-design -a cursor2Manually: put the files in place
.cursor/skills/rest-api-design/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts rest-api-design2Manually: put the files in place
.github/skills/rest-api-design/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill rest-api-design -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/rest-api-designManually: put the files in place
.devin/skills/rest-api-design/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill rest-api-design -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about rest-api-design
How do I install rest-api-design in Claude?
Run npx skills add aj-geddes/useful-ai-prompts --skill rest-api-design -a claude-code. The skill lands in ~/.claude/skills/rest-api-design/SKILL.md.
What does rest-api-design do?
It guides the agent through REST API design: resource naming, HTTP methods, status codes, versioning, authentication and OpenAPI documentation.
How is it different from just asking the agent?
It pulls from the guides in references/, from request examples to a full Express.js walkthrough, so answers stay specific instead of generic.
Source text
SKILL.md · MIT
---
name: rest-api-design
description: >
Design RESTful APIs following best practices for resource modeling, HTTP
methods, status codes, versioning, and documentation. Use when creating new
APIs, designing endpoints, or improving existing API architecture.
---
# REST API Design
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Design REST APIs that are intuitive, consistent, and follow industry best practices for resource-oriented architecture.
## When to Use
- Designing new RESTful APIs
- Creating endpoint structures
- Defining request/response formats
- Implementing API versioning
- Documenting API specifications
- Refactoring existing APIs
## Quick Start
Minimal working example:
```
✅ Good Resource Names (Nouns, Plural)
GET /api/users
GET /api/users/123
GET /api/users/123/orders
POST /api/products
DELETE /api/products/456
❌ Bad Resource Names (Verbs, Inconsistent)
GET /api/getUsers
POST /api/createProduct
GET /api/user/123 (inconsistent singular/plural)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [Resource Naming](references/resource-naming.md) | Resource Naming, HTTP Methods & Operations |
| [Request Examples](references/request-examples.md) | Request Examples |
| [Query Parameters](references/query-parameters.md) | Query Parameters |
| [Response Formats](references/response-formats.md) | Response Formats |
| [HTTP Status Codes](references/http-status-codes.md) | HTTP Status Codes, API Versioning, Authentication & Security, Rate Limiting Headers |
| [OpenAPI Documentation](references/openapi-documentation.md) | OpenAPI Documentation |
| [Complete Example: Express.js](references/complete-example-expressjs.md) | const express = require("express"); |
## Best Practices
### ✅ DO
- Use nouns for resources, not verbs
- Use plural names for collections
- Be consistent with naming conventions
- Return appropriate HTTP status codes
- Include pagination for collections
- Provide filtering and sorting options
- Version your API
- Document thoroughly with OpenAPI
- Use HTTPS
- Implement rate limiting
- Provide clear error messages
- Use ISO 8601 for dates
### ❌ DON'T
- Use verbs in endpoint names
- Return 200 for errors
- Expose internal IDs unnecessarily
- Over-nest resources (max 2 levels)
- Use inconsistent naming
- Forget authentication
- Return sensitive data
- Break backward compatibility without versioning
© aj-geddes · MIT · aj-geddes/useful-ai-prompts
Similar skills
Everything for Backend and APIs →rest-api-design by other authors comes first.