api-conventions
Skill114 starsChanged 2 months agoMITView on GitHub
Response-body conventions for the Platypus backend API — the `error` key for failures, the `message` key for 2xx status messages, and when to throw a typed error instead of returning a response. Use when adding or changing a backend route or its tests.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- mx-space/coretheir own version, first seen Sep 13, 2026
- TheDecipherist/claude-code-mastery-project-starter-kittheir own version, first seen Jun 26, 2026
- justnau1020/claude-ostheir own version, first seen Mar 30, 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
- maxyeh0817/Forge★ 34same name
- justnau1020/claude-os★ 3same 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 repository38 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/humanizer/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-api-endpointSkill
- ask-mattSkill
- better-auth-best-practicesSkill
- codebase-designSkill
- code-reviewSkill
- database-schema-changesSkill
- diagnosing-bugsSkill
- docs-auditSkill
- domain-modelingSkill
- form-conventionsSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- humanizerSkill
- implementSkill
- improve-codebase-architectureSkill
- platypus-toolsSkill
- pre-release-checkSkill
- prototypeSkill
- researchSkill
- resolving-merge-conflictsSkill
- setup-matt-pocock-skillsSkill
- shadcnSkill
- tddSkill
- teachSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- wayfinderSkill
- wizardSkill
- writing-for-agentsSkill
- writing-great-skillsSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
0
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
- Very specific: line 18
Never message on a 4xx/5xx — that is the one crossing the codebase does not make.
“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 Response Conventions
The two keys
error carries a failure. message carries a 2xx status line for an
operation that has no resource to return.
return c.json({ error: "Workspace not found" }, 404);
return c.json({ message: "Board deleted" });Never message on a 4xx/5xx — that is the one crossing the codebase does not
make.
A delete or action with nothing to return answers 200 { message } — never a
bodiless 204, and never { success: true }.
The error seam
Five cross-cutting failures are thrown, not returned. A single onError
seam maps each to its status and emits the same { error } body, so a domain
rule states its message once instead of once per caller:
| Throw | Becomes |
NotFoundError | 404 |
ValidationError | 400 |
LockedError | 403 |
ConflictError | 409 |
UnsupportedError | 501 |
A Postgres unique violation also maps to 409 — detect it through the shared
helper rather than re-reading the driver's error shape. So does a foreign-key
violation, as a backstop only: a delete guarded by a restrict reference
should throw a ConflictError naming what still uses the row first.
if (!row) throw new NotFoundError("Card not found");
throw new ValidationError("Invalid user assignee");A resource referenced in the request body that isn't in this Organization, or
isn't Shared, is a NotFoundError (404) naming what couldn't be used — not a
422, and no extra detail fields beside error.
Throwing is what lets one rule serve more than one surface: the Kanban rules
answer both the HTTP routes and the Agent tool set from a single place. Reach
for the seam whenever the failure is one of those five; a 4xx that only one
route can produce still answers inline with c.json({ error }, status). Both
are current and roughly equally common — the seam is not a migration you
should finish.
Test assertions
Assert against the key the response actually uses:
expect(body.error).toBe("Invalid user assignee");
expect(await res.json()).toEqual({ message: "Board deleted" });A service test covering a thrown failure asserts the error, not a body:
await expect(fn()).rejects.toThrow(NotFoundError);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.

