rest-api-best-practices
Skill0 starsChanged 3 months agoApache-2.0View on GitHub
Design, implement, document, or review framework-neutral REST/HTTP APIs using current HTTP semantics, predictable resource contracts, secure trust boundaries, compatibility rules, and focused verification. Use for endpoint design, API reviews, OpenAPI contracts, HTTP methods and status codes, resource URLs, errors, pagination, filtering, idempotency, caching, concurrency, versioning, deprecation, authorization, rate limits, or API test plans.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- luckys/agent-skillstheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- luckys/agent-skills★ 5same 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 repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academixSkill
- agent-browserSkill
- ai-engineering-platformSkill
- apocalypseSkill
- aria-apg-reviewSkill
- context-budgetSkill
- crawler-readiness-auditSkill
- data-protection-gateSkill
- decision-criticality-gateSkill
- fact-checkerSkill
- find-skillsSkill
- focus-friendly-outputSkill
- frontend-designSkill
- grill-meSkill
- grill-with-docsSkill
- humanizerSkill
- improve-codebase-architectureSkill
- microsoft-foundrySkill
- output-templatesSkill
- pre-launch-security-gateSkill
- prompt-preflightSkill
- quick-recapSkill
- rag-retrieval-qualitySkill
- rigorous-responseSkill
- security-checklistSkill
- shepherdSkill
- skill-optimizerSkill
- sql-query-correctnessSkill
- system-design-scaleSkill
- tddSkill
- ui-ux-color-contrastSkill
- ui-ux-component-qualitySkill
- ui-ux-design-systemsSkill
- ui-ux-dropdownsSkill
- ui-ux-form-validationSkill
- ui-ux-generationSkill
- ui-ux-loading-statesSkill
- ui-ux-mobile-cssSkill
- ui-ux-typographySkill
- ux-logic-loopSkill
- ux-pattern-reviewSkill
- vercel-react-best-practicesSkill
- visual-flow-storyboardSkill
- visual-pr-reviewSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Verify the published contract and runtime behavior agree.
- Very specific: line 33
Follow HTTP method safety and idempotency semantics.
- Very specific: line 34
Use HTTP status codes and headers as protocol semantics, not decorative metadata inside a 200 body.
- Distinctive: line 36
Use RFC 9457 Problem Details for a new error format unless an established compatible format must be preserved.
- Very specific: line 37
Keep success representations consistent by resource and media type.
- Distinctive: line 40
Prefer additive evolution.
- Distinctive: line 41
Never expose secrets, stack traces, internal queries, or sensitive identifiers in responses or logs.
- Distinctive: line 51
Keep the contract, semantic defect, compatibility impact, fix, and verification together.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
REST API Best Practices
Build the smallest predictable HTTP contract that fits the product. Preserve sound repository conventions; correct conventions that conflict with HTTP semantics, security, or compatibility.
Workflow
- Inspect the existing routes, handlers, schemas, OpenAPI files, shared response/error helpers, authorization boundaries, and contract tests. Trace callers before changing shared behavior.
- State the resource, consumer, operation, trust boundary, compatibility promise, and expected scale. If the interface is mainly commands or workflows, say when HTTP RPC is clearer than forced resource-shaped REST.
- Define the contract before implementation: method, path, request, success response, error response, headers, authorization rule, retry behavior, and compatibility impact.
- Apply the standards-backed checklist. Load only the relevant sections for a narrow task; read it fully for a new API or whole-API review.
- Reuse existing validation, authorization, serialization, pagination, and error infrastructure. Add no framework or dependency unless the current stack cannot express the contract safely.
- Implement shared boundary behavior once, then leave the smallest runnable check that would fail on regression.
- Verify the published contract and runtime behavior agree. Report any deliberate deviation with its consumer-visible consequence.
Non-negotiables
- Follow HTTP method safety and idempotency semantics; do not use
POSTfor every operation. - Use HTTP status codes and headers as protocol semantics, not decorative metadata inside a
200body. - Validate syntax and shape at the boundary; enforce business invariants in the domain; authorize every object, function, and exposed property.
- Use RFC 9457 Problem Details for a new error format unless an established compatible format must be preserved.
- Keep success representations consistent by resource and media type. Do not impose a universal
{success,message,data}wrapper without a demonstrated client need. - Bound collection size and resource consumption. Define stable ordering and pagination behavior.
- Prevent lost updates where concurrent writes matter with validators such as
ETagandIf-Match. - Prefer additive evolution. Introduce a new API version only for a breaking contract change that cannot be migrated compatibly.
- Never expose secrets, stack traces, internal queries, or sensitive identifiers in responses or logs.
- Describe the contract with the repository's existing OpenAPI tooling when present. Do not hand-maintain a second source of truth.
Review Output
Lead with confirmed contract defects, ordered by user or security impact. For each defect, give the endpoint, violated semantic or invariant, consequence, and smallest compatible fix. Separate optional style preferences from correctness issues. End with checks run and unresolved compatibility decisions.
Shared output profile
Compose the review profile from output-templates.
Keep the contract, semantic defect, compatibility impact, fix, and verification together.
Preserve stricter domain rules above, omit empty components, and never fill a component with invented evidence.
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.

