rest-api
Skill15 starsChanged 42 days agoMITView on GitHub
Expert REST API architecture assistance covering HTTP semantics, OpenAPI/Swagger specifications, idempotent methods, hypermedia (HATEOAS), and pagination patterns. Use when designing web APIs, structuring resource endpoints, standardizing error formats, or implementing RESTful conventions.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- AnyOrgName/php-skillstheir own version, first seen Nov 8, 2026
- Abdox-menara/guard-skillstheir own version, first seen Aug 24, 2026
- cusyio/agentic-software-engineering_detheir own version, first seen Jul 18, 2026
- aborroy/aiup-alfrescotheir own version, first seen Jun 22, 2026
- cusyio/agentic-software-engineeringtheir own version, first seen Jun 21, 2026
- yiweiwan/skillstheir own version, first seen May 12, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- aborroy/aiup-alfresco★ 14same name
- AnyOrgName/php-skills★ 4same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- yiweiwan/skills★ 1same name
- Abdox-menara/guard-skills★ 0same name
- cusyio/agentic-software-engineering★ 0same name
- cusyio/agentic-software-engineering_de★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- sagaSkill
- serverlessSkill
- service-meshSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 94
Solution: Use monotonic cursor identifiers (e.g.
- Very specific: line 123
Use Nouns for Resource URIs: Use /api/v1/orders rather than action verbs like /api/v1/getOrders or /api/v1/createOrder.
- Distinctive: line 125
Document with OpenAPI 3.1: Generate automated Swagger docs, SDK clients, and request validation schemas from OpenAPI specs.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
REST API
Representational State Transfer (REST) is the architectural style for distributed hypermedia systems. It relies on stateless, client-server, cacheable communications protocols (mostly HTTP).
When to Use
- Universal Public Web APIs: Building open, standardized APIs intended for third-party developers, webhooks, and partner integrations.
- HTTP Caching & CDN Optimization: Maximizing cacheability using standard HTTP response headers (
Cache-Control,ETag,Last-Modified). - Resource-Oriented CRUD Operations: Designing intuitive resource hierarchies with standard HTTP semantics (GET, POST, PUT, PATCH, DELETE).
- Stateless Integration: Delivering scalable stateless APIs consumed effortlessly by any HTTP client on any platform.
Quick Start
// Express.js Example
app.get("/users/:id", async (req, res) => {
const user = await db.find(req.params.id);
if (!user) return res.status(404).json({ error: "Not Found" });
// HATEOAS (Hypermedia As The Engine Of Application State) - optional but "True REST"
res.json({
...user,
links: {
self: `/users/${user.id}`,
orders: `/users/${user.id}/orders`,
},
});
});Core Concepts
HTTP Semantics & Idempotency
Different HTTP verbs carry formal idempotency and safety guarantees:
| Method | Safe | Idempotent | Usage |
GET | Yes | Yes | Retrieve resource representation |
POST | No | No | Create new resource or trigger action |
PUT | No | Yes | Replace resource entirely |
PATCH | No | No / Yes | Partially update resource |
DELETE | No | Yes | Remove resource |
Standardized Error Representations (RFC 7807 / 9457)
Returns machine-readable application/problem+json error responses:
{
"type": "https://api.example.com/errors/invalid-payment",
"title": "Invalid Payment Source",
"status": 422,
"detail": "The payment card provided has expired.",
"instance": "/orders/415/payments"
}Content Negotiation & ETag Caching
Validates whether cached client data is still fresh without resending full payloads:
app.get("/api/v1/users/:id", async (req, res) => {
const user = await db.getUser(req.params.id);
const etag = crypto
.createHash("md5")
.update(JSON.stringify(user))
.digest("hex");
if (req.headers["if-none-match"] === etag) {
return res.status(304).end(); // Not Modified
}
res.setHeader("ETag", etag);
res.setHeader(
"Cache-Control",
"public, max-age=60, stale-while-revalidate=300",
);
res.json(user);
});Common Patterns
Cursor-Based Pagination
Problem: Offset-based pagination (OFFSET 10000) degrades database performance and skips items on concurrent writes.
Solution: Use monotonic cursor identifiers (e.g. created_at + id).
// GET /api/v1/posts?cursor=2026-09-27T10:00:00Z&limit=20
app.get("/api/v1/posts", async (req, res) => {
const { cursor, limit = 20 } = req.query;
const posts = await db
.select()
.from(postsTable)
.where(
cursor ? lt(postsTable.createdAt, new Date(cursor as string)) : undefined,
)
.orderBy(desc(postsTable.createdAt))
.limit(Number(limit) + 1);
const hasMore = posts.length > Number(limit);
const data = hasMore ? posts.slice(0, -1) : posts;
const nextCursor = hasMore
? data[data.length - 1].createdAt.toISOString()
: null;
res.json({ data, pagination: { hasMore, nextCursor } });
});Best Practices
Do:
- Use Nouns for Resource URIs: Use
/api/v1/ordersrather than action verbs like/api/v1/getOrdersor/api/v1/createOrder. - Implement Idempotency Keys on Mutating Requests: Require
Idempotency-Keyheaders on POST/PATCH requests to prevent duplicate charges. - Document with OpenAPI 3.1: Generate automated Swagger docs, SDK clients, and request validation schemas from OpenAPI specs.
- Implement Monotonic Cursor Pagination: Use
limitandstarting_aftercursor pagination for high-volume datasets.
Don't:
- Return HTTP 200 with
{ "error": "..." }: Always return correct HTTP status codes (400,401,403,404,422,500). - Break API contracts without versioning: Prefix endpoints with
/v1/or use header versioning when introducing breaking changes. - Expose raw internal database column names: Map private column names to clean, camelCased JSON fields.
Troubleshooting
| Error | Cause | Solution |
405 Method Not Allowed | Sending POST to a GET-only endpoint. | Check HTTP verb. |
415 Unsupported Media Type | Sending XML when JSON expected. | Set Content-Type: application/json. |
CORS Error | Browser blocking cross-origin request. | Set Access-Control-Allow-Origin headers on server. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

