rest-api-conventions

REST API design conventions reference. An extension skill for api-architect that provides URL naming, HTTP method mapping, status code selection, pagination/filtering/sorting patterns, HATEOAS, and versioning strategies. Use when designing RESTful APIs involving 'REST conventions', 'URL design', 'HTTP status codes', 'pagination', 'API versioning', 'HATEOAS', etc. Note: GraphQL design and actual server implementation are outside the scope of this skill.

495 stars

Best use case

rest-api-conventions is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

REST API design conventions reference. An extension skill for api-architect that provides URL naming, HTTP method mapping, status code selection, pagination/filtering/sorting patterns, HATEOAS, and versioning strategies. Use when designing RESTful APIs involving 'REST conventions', 'URL design', 'HTTP status codes', 'pagination', 'API versioning', 'HATEOAS', etc. Note: GraphQL design and actual server implementation are outside the scope of this skill.

Teams using rest-api-conventions should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/rest-api-conventions/SKILL.md --create-dirs "https://raw.githubusercontent.com/revfactory/harness-100/main/en/18-api-designer/.claude/skills/rest-api-conventions/skill.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/rest-api-conventions/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How rest-api-conventions Compares

Feature / Agentrest-api-conventionsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

REST API design conventions reference. An extension skill for api-architect that provides URL naming, HTTP method mapping, status code selection, pagination/filtering/sorting patterns, HATEOAS, and versioning strategies. Use when designing RESTful APIs involving 'REST conventions', 'URL design', 'HTTP status codes', 'pagination', 'API versioning', 'HATEOAS', etc. Note: GraphQL design and actual server implementation are outside the scope of this skill.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# REST API Conventions — RESTful API Design Conventions Reference

A reference of naming rules, status codes, and pagination patterns used by the api-architect agent when designing REST APIs.

## Target Agent

`api-architect` — Directly applies the conventions in this skill to API designs.

## URL Naming Rules

### Basic Principles
| Rule | Correct Example | Incorrect Example |
|------|----------------|-------------------|
| Plural nouns | `/users` | `/user`, `/getUsers` |
| Lowercase kebab-case | `/user-profiles` | `/userProfiles`, `/User_Profiles` |
| No verbs (use methods for CRUD) | `POST /orders` | `POST /createOrder` |
| Hierarchical relationships | `/users/{id}/orders` | `/getUserOrders` |
| No trailing slash | `/users` | `/users/` |
| No file extensions | `/users` (use Accept header) | `/users.json` |

### Resource URL Patterns

| Operation | Method | URL | Example |
|-----------|--------|-----|---------|
| List retrieval | GET | `/resources` | `GET /products` |
| Single retrieval | GET | `/resources/{id}` | `GET /products/123` |
| Create | POST | `/resources` | `POST /products` |
| Full update | PUT | `/resources/{id}` | `PUT /products/123` |
| Partial update | PATCH | `/resources/{id}` | `PATCH /products/123` |
| Delete | DELETE | `/resources/{id}` | `DELETE /products/123` |

### Relationship Resources
```
GET  /users/{userId}/orders           -- User's order list
GET  /users/{userId}/orders/{orderId} -- User's specific order
POST /users/{userId}/orders           -- Create order for user
```

### Non-CRUD Actions (RPC-Style Permitted)
```
POST /orders/{id}/cancel        -- Cancel order
POST /users/{id}/verify-email   -- Verify email
POST /reports/generate          -- Generate report
POST /cart/checkout             -- Proceed to checkout
```

## HTTP Status Code Selection Guide

### Success (2xx)
| Code | Meaning | When to Use |
|------|---------|-------------|
| 200 | OK | GET, PUT, PATCH success |
| 201 | Created | POST resource creation success (include Location header) |
| 204 | No Content | DELETE success, no response body |

### Client Errors (4xx)
| Code | Meaning | When to Use |
|------|---------|-------------|
| 400 | Bad Request | Malformed request, validation failure |
| 401 | Unauthorized | Authentication required (missing/expired token) |
| 403 | Forbidden | Authenticated but not authorized |
| 404 | Not Found | Resource does not exist |
| 405 | Method Not Allowed | HTTP method not permitted |
| 409 | Conflict | Resource conflict (duplicate creation, etc.) |
| 422 | Unprocessable Entity | Format is correct but violates business rules |
| 429 | Too Many Requests | Rate limit exceeded |

### Server Errors (5xx)
| Code | Meaning | When to Use |
|------|---------|-------------|
| 500 | Internal Server Error | Unexpected server error |
| 502 | Bad Gateway | Upstream service error |
| 503 | Service Unavailable | Maintenance/overload (include Retry-After header) |

## Pagination Patterns

### Offset-Based (Traditional)
```
GET /products?page=2&limit=20

Response:
{
  "data": [...],
  "pagination": {
    "page": 2,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  }
}
```
- Pros: Simple implementation, random page access
- Cons: Performance degradation with large datasets (OFFSET)

### Cursor-Based (Recommended)
```
GET /products?cursor=eyJpZCI6MTIzfQ&limit=20

Response:
{
  "data": [...],
  "pagination": {
    "nextCursor": "eyJpZCI6MTQzfQ",
    "hasMore": true
  }
}
```
- Pros: Excellent performance with large datasets, safe for real-time data
- Cons: No total count or random page access

### Selection Criteria
| Scenario | Recommendation |
|----------|---------------|
| Admin dashboard (page numbers needed) | Offset |
| Infinite scroll | Cursor |
| Real-time feed | Cursor |
| 1M+ records | Cursor |

## Filtering/Sorting/Search Patterns

### Filtering
```
GET /products?category=electronics&price_min=10000&price_max=50000&status=active
```

### Sorting
```
GET /products?sort=price&order=asc
GET /products?sort=-created_at,+name    (prefix style: - descending, + ascending)
```

### Search
```
GET /products?q=keyboard                (full-text search)
GET /products?name=keyboard             (specific field)
```

### Field Selection (Sparse Fieldsets)
```
GET /products?fields=id,name,price      (only needed fields)
```

## Error Response Standard Format

### RFC 7807 (Problem Details)
```json
{
  "type": "https://api.example.com/errors/validation",
  "title": "Validation Error",
  "status": 422,
  "detail": "The request data is invalid",
  "instance": "/products",
  "errors": [
    {
      "field": "price",
      "code": "INVALID_RANGE",
      "message": "Price must be greater than 0"
    }
  ]
}
```

## Versioning Strategies

| Strategy | Method | Pros | Cons |
|----------|--------|------|------|
| **URL Path** | `/v1/users` | Clear, simple routing | URL changes |
| **Header** | `Accept: application/vnd.api+json;version=1` | Clean URLs | Harder to debug |
| **Query** | `/users?version=1` | Can be optional | Complex caching |

**Recommended**: URL Path (`/v1/`) — Most intuitive and widely adopted

### Version Deprecation Policy
- New version released -> Maintain old version for 12 months
- Deprecation headers: `Deprecation: true`, `Sunset: 2025-12-31`
- Provide migration guide

## Response Envelope Pattern

### Single Resource Response
```json
{
  "data": { "id": 1, "name": "Product" },
  "meta": { "requestId": "abc-123" }
}
```

### List Response
```json
{
  "data": [{ "id": 1 }, { "id": 2 }],
  "pagination": { "page": 1, "limit": 20, "total": 150 },
  "meta": { "requestId": "abc-123" }
}
```

## Idempotency

| Method | Idempotent | Safe | Description |
|--------|-----------|------|-------------|
| GET | Yes | Yes | Returns the same result |
| PUT | Yes | No | Same data repeated yields the same result |
| DELETE | Yes | No | Re-deleting an already deleted resource returns 404 |
| PATCH | No | No | Can make relative changes (counter++) |
| POST | No | No | May create duplicates -> Idempotency-Key recommended |

Related Skills

compound-interest-simulator

495
from revfactory/harness-100

and simulation and basis asset nature example tool. 'investment-advisor' and 'tax-strategist' agent investment revenue simulationand retirement specialist designto do when this skill's official, scenario comparison, retirement goal total must be utilized. ' total', 'asset nature example', 'retirement specialist simulation' etc. However, budget design tax total is outside this skill's scope.

sustainability-audit

495
from revfactory/harness-100

Full audit pipeline for ESG/sustainability where an agent team collaborates to generate environmental, social, and governance assessments along with an integrated report and improvement plan. Use this skill for requests such as 'run an ESG audit', 'write a sustainability report', 'ESG assessment', 'carbon emissions calculation', 'ESG rating diagnosis', 'governance review', 'social responsibility assessment', 'GRI report', 'TCFD disclosure', 'ESG improvement plan', and other ESG/sustainability tasks. Also supports assessment of specific pillars (E/S/G) only or improving existing reports. However, actual on-site audit execution, third-party verification certificate issuance, ESG rating agency score changes, and carbon credit trading are outside the scope of this skill.

materiality-assessment

495
from revfactory/harness-100

ESG materiality assessment matrix. Referenced by the esg-reporter and improvement-planner agents when evaluating ESG issue materiality and setting priorities. Use for 'materiality assessment', 'importance analysis', or 'Materiality Matrix' requests. Stakeholder surveys and external certification are out of scope.

ghg-protocol

495
from revfactory/harness-100

GHG Protocol detailed guide. Referenced by the environmental-analyst agent when calculating and reporting greenhouse gas emissions. Use for 'GHG Protocol', 'carbon emissions', 'Scope 1/2/3', or 'carbon footprint' requests. Carbon credit trading and CDM project execution are out of scope.

citation-standards

495
from revfactory/harness-100

Academic citation and reference standards guide. Referenced by the paper-writer and submission-preparer agents when composing citations and references. Use for 'citation format', 'APA', or 'references' requests. Original paper retrieval and professional database access are out of scope.

academic-paper

495
from revfactory/harness-100

Full research pipeline for academic paper writing where an agent team collaborates to generate research design, experiment protocols, analysis, manuscript writing, and submission preparation. Use this skill for requests such as 'write an academic paper', 'research paper writing', 'help me write a paper', 'design a study', 'run statistical analysis', 'prepare journal submission', 'manuscript writing', 'research methodology design', 'hypothesis testing', 'academic writing', and other academic research paper tasks. Also supports analysis, rewriting, and submission preparation when existing data or drafts are available. However, actual data collection execution, official IRB submission, journal system login and upload, and running actual statistical software are outside the scope of this skill.

product-copy-formulas

495
from revfactory/harness-100

Product copy formula library. Referenced by the detail-page-writer and marketing-manager agents when writing purchase-driving copy. Use for 'product copy', 'marketing copy', or 'ad copy' requests. Ad placement and design mockup creation are out of scope.

ecommerce-launcher

495
from revfactory/harness-100

Full launch pipeline for e-commerce products where an agent team collaborates to generate product planning, detail pages, pricing strategy, marketing, and CS setup all at once. Use this skill for requests such as 'launch an e-commerce product', 'prepare a product launch', 'register a product on Naver Smart Store', 'launch on Coupang', 'create a detail page', 'develop a pricing strategy', 'create a marketing plan', 'launch prep', 'product planning brief', 'e-commerce CS manual', and other e-commerce product launch tasks. Also supports supplementing pricing/marketing/CS even when existing briefs or detail pages are provided. However, actual platform API integration (automated product registration), payment system development, logistics system integration, and real-time order management are outside the scope of this skill.

conversion-optimization

495
from revfactory/harness-100

Purchase conversion optimization framework. Referenced by the detail-page-writer and pricing-strategist agents when designing detail pages and pricing with a conversion focus. Use for 'conversion rate optimization', 'CRO', or 'purchase psychology' requests. A/B testing tool setup and funnel automation are out of scope.

real-estate-analyst

495
from revfactory/harness-100

Real estate investment analysis pipeline. An agent team collaborates to produce market research, location analysis, profitability analysis, risk assessment, and investment reports. Use this skill for requests such as 'analyze this real estate', 'apartment investment analysis', 'studio apartment yield', 'real estate market research', 'location analysis', 'real estate investment report', 'buy vs lease', 'reconstruction investment analysis', 'commercial property yield analysis', and other general real estate investment analysis tasks. Actual purchase contracts, brokerage services, interior design, and property management are outside the scope of this skill.

location-scoring

495
from revfactory/harness-100

Location scoring scorecard. Referenced by the location-analyst agent for systematic real estate location evaluation. Use for requests involving 'location analysis', 'location assessment', or 'commercial area analysis'. On-site inspections and surveying are out of scope.

cap-rate-calculator

495
from revfactory/harness-100

Real estate yield calculator. Reference formulas and models used by the profitability-analyst agent for quantitative investment return analysis. Use for requests involving 'Cap Rate', 'yield analysis', 'DCF', or 'cash flow analysis'. Tax advisory and loan underwriting are out of scope.