Agent skill

rest-patterns

Quick reference for RESTful API design patterns, HTTP semantics, caching, and rate limiting. Triggers on: rest api, http methods, status codes, api design, endpoint design, api versioning, rate limiting, caching headers.

Stars 232
Forks 15

Install this agent skill to your Project

npx add-skill https://github.com/aiskillstore/marketplace/tree/main/skills/0xdarkmatter/rest-patterns

SKILL.md

REST Patterns

Quick reference for RESTful API design patterns and HTTP semantics.

HTTP Methods

Method Purpose Idempotent Cacheable
GET Retrieve resource(s) Yes Yes
POST Create new resource No No
PUT Replace entire resource Yes No
PATCH Partial update Maybe No
DELETE Remove resource Yes No

Essential Status Codes

Code Name Use
200 OK Success with body
201 Created POST success (add Location header)
204 No Content Success, no body
400 Bad Request Invalid syntax
401 Unauthorized Not authenticated
403 Forbidden Not authorized
404 Not Found Resource doesn't exist
422 Unprocessable Validation error
429 Too Many Requests Rate limited
500 Server Error Internal failure

Resource Design

http
GET    /users              # List
POST   /users              # Create
GET    /users/{id}         # Get one
PUT    /users/{id}         # Replace
PATCH  /users/{id}         # Update
DELETE /users/{id}         # Delete

# Query parameters
GET /users?page=2&limit=20          # Pagination
GET /users?sort=created_at:desc     # Sorting
GET /users?role=admin               # Filtering

Security Checklist

  • HTTPS/TLS only
  • OAuth 2.0 or JWT for auth
  • Validate all inputs
  • Rate limit per client
  • CORS headers configured
  • No sensitive data in URLs
  • Use no-store for sensitive responses

Common Mistakes

Mistake Fix
Verbs in URLs /getUsers/users
Deep nesting Flatten or use query params
200 for errors Use proper 4xx/5xx
No pagination Always paginate collections
Missing rate limits Protect against abuse

Quick Reference

Task Pattern
Paginate ?page=2&limit=20
Sort ?sort=field:asc
Filter ?status=active
Sparse fields ?fields=id,name
Include related ?include=orders

When to Use

  • Designing new API endpoints
  • Choosing HTTP methods and status codes
  • Implementing caching headers
  • Setting up rate limiting
  • Structuring error responses

Additional Resources

For detailed patterns, load:

  • ./references/status-codes.md - Complete status code reference with examples
  • ./references/caching-patterns.md - Cache-Control, ETag, CDN patterns
  • ./references/rate-limiting.md - Rate limiting strategies and headers
  • ./references/response-formats.md - Errors, versioning, bulk ops, HATEOAS

Expand your agent's capabilities with these related and highly-rated skills.

aiskillstore/marketplace

perigon-backend

Perigon ASP.NET Core + EF Core + Aspire conventions

232 15
Explore
aiskillstore/marketplace

perigon-agent

Pointers for Copilot/agents to apply Perigon conventions

232 15
Explore
aiskillstore/marketplace

perigon-angular

Angular 21+ standalone/Material/signal conventions for Perigon WebApp

232 15
Explore
aiskillstore/marketplace

fastapi-mastery

Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation, Pydantic models, or FastAPI-specific features.

232 15
Explore
aiskillstore/marketplace

context7-efficient

Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.

232 15
Explore
aiskillstore/marketplace

browser-use

Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction.

232 15
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results