api-conventions
Skill3 starsChanged 8 months agoApache-2.0View on GitHub
API development conventions and patterns. Applies when writing or modifying API routes, MCP tools, or CLI commands -- covers authentication, ownership enforcement, error responses, and route organization.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- willdady/platypustheir own version, first seen Oct 2, 2026
- mx-space/coretheir own version, first seen Sep 13, 2026
- TheDecipherist/claude-code-mastery-project-starter-kittheir own version, first seen Jun 26, 2026
- CodeWithBehnam/cc-docstheir own version, first seen Mar 15, 2026
- onejaejae/skillstheir own version, first seen Feb 27, 2026
- maxyeh0817/Forgetheir own version, first seen Feb 25, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- mx-space/core★ 564same name
- TheDecipherist/claude-code-mastery-project-starter-kit★ 338same name
- willdady/platypus★ 114same name
- maxyeh0817/Forge★ 34same name
- CodeWithBehnam/cc-docs★ 2same name
- lodetomasi/claude-code-training-lab★ 2same name
- onejaejae/skills★ 2same 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 repository21 other files it gives its agents.
- framework/CLAUDE.mdCLAUDE.md
- auditSkill
- dep-auditSkill
- hygiene-auditSkill
- review-prSkill
- dashboard-conventionsSkill
- db-migrationSkill
- doc-architectureSkill
- fix-issueSkill
- new-endpointSkill
- new-mcp-toolSkill
- test-allSkill
- deploySkill
- deploy-statusSkill
- incidentSkill
- dreamSkill
- brainstormSkill
- debateSkill
- exec-planSkill
- launch-reviewSkill
- plan-featuresSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
All endpoints require valid authentication (Bearer token, session cookie, or API key)
- Very specific: line 13
Use dependency injection for auth (e.g., Depends(get_current_user) in FastAPI)
- Distinctive: line 31
Every endpoint that accesses a user's resource must verify ownership
- Distinctive: line 32
Use the dependency injection pattern for ownership checks
- Distinctive: line 33
Never allow cross-user resource access
- Distinctive: line 49
All middleware must be async (if using async framework)
“Common” is measured: kept by at least 6 in 10 of the 4 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
API Development Conventions
These conventions apply when working on the API layer (routes, MCP tools, CLI commands).
Authentication
- All endpoints require valid authentication (Bearer token, session cookie, or API key)
- Use dependency injection for auth (e.g.,
Depends(get_current_user)in FastAPI) - Provide both required and optional auth dependencies where appropriate
- Rate limit registration and auth endpoints to prevent brute-force
- Resource ownership is enforced -- users can only access their own resources
Route Organization
- One route file per resource domain:
routes_users.py,routes_orders.py, etc. - Each route file defines a router (e.g.,
APIRouterin FastAPI) - Routers are registered in the main app file
Error Responses
422-- Validation errors (malformed input)404-- Resource not found429-- Rate limits (pass through from upstream with reset timing)503-- Upstream service unavailability- Error messages must be specific and actionable, not generic
Resource Ownership
- Every endpoint that accesses a user's resource must verify ownership
- Use the dependency injection pattern for ownership checks
- Never allow cross-user resource access
MCP Server (if applicable)
- Tools mirror REST API functionality
- Each tool has a clear description to help LLMs understand when to use it
- Include example parameter values in descriptions
- Return strings for LLM consumption
CLI (if applicable)
- Commands organized by resource domain
- Consistent flag naming across commands
- Help text on every command and argument
Middleware
- Security middleware for headers, CORS, CSP
- Rate limiting middleware
- All middleware must be async (if using async framework)
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.

