api-endpoint
Skill2 starsChanged 4 months agoMITView on GitHub
Add or change a backend API endpoint on this product, keeping Pydantic as the single contract authority and regenerating the TypeScript client. Use when asked to add an endpoint, expose data to the frontend, change a request or response shape, or wire a new backend capability into a page.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Univers42/claude-deal-with-the-deviltheir own version, first seen Oct 4, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Univers42/claude-deal-with-the-devil★ 4same 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 repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- db-migrationSkill
- deploySkill
- featureSkill
- frontend-craftSkill
- frontend-pageSkill
- product-shapingSkill
- reviewSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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 12
Read AGENTS.md first. The contract flows one way: Pydantic → OpenAPI → generated TS.
- Very specific: line 33
one per authorization case: no token → 401, wrong role → 403, wrong owner → 403/404 (per docs/SECURITY.md), correct → 2xx
- Very specific: line 42
Commit the frontend/src/generated/ diff as part of this change.
- Very specific: line 46
Never a hand-written interface, never a raw fetch().
- Distinctive: line 59
Never an exception string or SQL fragment.
- Distinctive: line 63
If the endpoint seems to need a queue, a cache, a second data store, or logic in the frontend — stop and propose it per the stop condition …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Add an API endpoint
Read AGENTS.md first. The contract flows one way: Pydantic → OpenAPI → generated TS.
Nothing downstream is written by hand.
Steps
- Schemas — request and response models in
backend/app/schemas/. Declare types, ranges, lengths and enums here; validation is Pydantic's job, not the handler's. - Route —
backend/app/api/<resource>.py, registered on the router inmain.py. Keep it thin: parse, authorize, delegate, return. Always set an explicitresponse_modelso OpenAPI is accurate and internal fields can't leak. - Logic —
backend/app/services/<resource>.py. This is the testable seam. Business rules in a route handler are a defect. - Authorization — on the route, stated explicitly. Firebase established who; you decide may they. Never trust a user ID from the request body.
- Tests —
backend/tests/:- service behaviour (the happy path and the interesting edge)
- the route
- one per authorization case: no token → 401, wrong role → 403, wrong owner → 403/404
(per
docs/SECURITY.md), correct → 2xx
Regenerate
./scripts/generate-api-clientCommit the
frontend/src/generated/diff as part of this change. A schema change without a regenerated client is incomplete, andverify.shwill fail on the drift check.- Frontend — a TanStack Query hook in
frontend/src/api/using the generated types. Never a hand-written interface, never a rawfetch(). ./scripts/verify.sh
Conventions
- Plural noun resources:
/api/projects,/api/projects/{project_id}. - Verbs live in HTTP methods.
POST /api/projects/{id}/archiveis fine for a real state transition;POST /api/doProjectStuffis not. - List endpoints paginate by default, with a hard maximum page size. An unbounded list is an outage with a delay fuse.
- UTC ISO-8601 timestamps. IDs opaque to the frontend.
- Errors follow the contract in
docs/ARCHITECTURE.md: machine-readable code + safe message. Never an exception string or SQL fragment.
Stop
If the endpoint seems to need a queue, a cache, a second data store, or logic in the frontend —
stop and propose it per the stop condition in AGENTS.md.
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.

