Skip to content
Back to skills

Api Design Patterns Cooldaemon Dotfiles

ASecurity

RESTful API design patterns including URL structure, HTTP methods, and idempotency. Use when designing new API endpoints or reviewing API architecture. For existing projects, follow the project's established conventions instead.

  • 30 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 12, 2026
ai-agentsapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 12, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill api-design-patterns-cooldaemon-dotfiles --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Design Patterns Cooldaemon Dotfiles?

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

Security grade badge for Api Design Patterns Cooldaemon Dotfiles
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-api-design-patterns-cooldaemon-dotfiles-claude-skill-registry-data/badge)](https://www.skillsdirectory.com/skills/majiayu000-api-design-patterns-cooldaemon-dotfiles-claude-skill-registry-data)

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: api-design-patterns
description: RESTful API design patterns including URL structure, HTTP methods, and idempotency. Use when designing new API endpoints or reviewing API architecture. For existing projects, follow the project's established conventions instead.
durability: encoded-preference
---

# API Design Patterns

## Core Principle

For new projects, enforce RESTful URL structure. For existing projects, follow the project's established API conventions.

## RESTful URL Structure

```
GET    /api/resources              # List resources
GET    /api/resources/:id          # Get single resource
POST   /api/resources              # Create (server assigns ID)
PUT    /api/resources/:id          # Create or replace at specific ID
PATCH  /api/resources/:id          # Partial update
DELETE /api/resources/:id          # Delete resource

# Query parameters for filtering, sorting, pagination
GET /api/resources?status=active&sort=created_at&limit=20&offset=0
```

## HTTP Methods and Idempotency

| Method | Idempotent | Use Case |
|--------|------------|----------|
| GET | Yes | Retrieve resource(s) |
| PUT | Yes | Create or replace at specific URI |
| PATCH | No* | Partial update |
| DELETE | Yes | Remove resource |
| POST | No | Non-idempotent operations |

### PUT vs POST

**Common misconception**: "POST = create, PUT = update"
**Reality**: PUT can create, POST can do various things. The difference is idempotency.

- **PUT**: Client specifies the ID. Idempotent (running twice = same result)
- **POST**: Server assigns the ID. Non-idempotent (running twice = two resources)

## Anti-Patterns

| Anti-Pattern | Correct Approach |
|-------------|-----------------|
| Verbs in URLs (`/getUser/123`) | Use HTTP methods (`GET /users/123`) |
| Ignoring idempotency | PUT for idempotent creates, POST for non-idempotent |
| Inconsistent pluralization | Always use plural nouns (`/users`, not `/user`) |
| Deeply nested resources (`/a/1/b/2/c/3`) | Flatten beyond 2 levels |

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.