All skills
davila7 avatar

/api-patterns

@1deb97c

API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.

Use this Skill: https://skilld.dev/gh/davila7/claude-code-templates/api-patterns

This session only. Nothing lands on disk.

rest.md

≈320 tokens on demand. Your agent reads this file only when SKILL.md points to it.

REST Principles

Resource-based API design - nouns not verbs.

Resource Naming Rules

Principles:
├── Use NOUNS, not verbs (resources, not actions)
├── Use PLURAL forms (/users not /user)
├── Use lowercase with hyphens (/user-profiles)
├── Nest for relationships (/users/123/posts)
└── Keep shallow (max 3 levels deep)

HTTP Method Selection

Method Purpose Idempotent? Body?
GET Read resource(s) Yes No
POST Create new resource No Yes
PUT Replace entire resource Yes Yes
PATCH Partial update No Yes
DELETE Remove resource Yes No

Status Code Selection

Situation Code Why
Success (read) 200 Standard success
Created 201 New resource created
No content 204 Success, nothing to return
Bad request 400 Malformed request
Unauthorized 401 Missing/invalid auth
Forbidden 403 Valid auth, no permission
Not found 404 Resource doesn't exist
Conflict 409 State conflict (duplicate)
Validation error 422 Valid syntax, invalid data
Rate limited 429 Too many requests
Server error 500 Our fault

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides comprehensive API design and security documentation along with a Python-based endpoint validator. It is generally well-constructed but contains a potential surface for indirect prompt injection because the validation script analyzes untrusted project files.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    10/12 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 1deb97c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 19 hours ago.

Activeupdated 8 months ago
What it can do
Reads files Edits files
All 5 allowed tools
ReadWriteEditGlobGrep

README badge

README badge for davila7/claude-code-templates/api-patterns