api-change
Skill2 starsChanged 20 days agoMITView on GitHub
Change the HTTP API contract of this repo. Use when adding or changing an endpoint, a request or response schema, or a typed error in src/contract, or a handler in src/server/api/handlers.ts.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- cubetribe/ClaudeCode_GodMode-Ontheir own version, first seen Oct 13, 2026
- software-mansion/smeltertheir own version, first seen Oct 8, 2026
- seshachalam-yv/etcd-druid-skillstheir own version, first seen Apr 21, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- software-mansion/smelter★ 740same name
- cubetribe/ClaudeCode_GodMode-On★ 53same name
- seshachalam-yv/etcd-druid-skills★ 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 repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- add-featureSkill
- add-pageSkill
- auth-changeSkill
- database-changeSkill
- shadcnSkill
- upgrade-prerelease-depsSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
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
- Very specific: line 20
Put a new endpoint that needs a session in a group behind the Authentication middleware (as MyPosts in src/contract/posts.ts), with a path …
- Very specific: line 30
Run pnpm codegen to regenerate openapi.json and src/sdk/.
- Very specific: line 33
Test, cheapest layer first (read tests/api/AGENTS.md): every handler branch in tests/api/ through clientAs(...) (handlers.ts is in the 100% …
“Common” is measured: kept by at least 6 in 10 of the 3 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 change
The contract in src/contract generates openapi.json, which generates src/sdk. The three are committed
together and must agree; the running API and the tests must agree with all three.
Steps
- Edit the contract in
src/contract/: schemas, endpoints, tagged errors (Schema.TaggedErrorwithhttpApiStatus). Constants the UI also needs (limits, lengths) go insrc/contract/limits.ts, which stays free of Effect so client bundles do not pull in the schema runtime. A user-supplied string that is stored or looked up in Postgres starts its checks withisFreeOfNul(src/contract/stored-text.ts): Postgres text cannot hold U+0000, and without the check a NUL answers 500 instead of 400. An id is a brand fromsrc/contract/ids.ts(PostId,UserId), neverSchema.String: a lint rule rejects that, and the compiler then refuses one kind of id where another is expected. A new table adds its brand there. - Put a new endpoint that needs a session in a group behind the
Authenticationmiddleware (asMyPostsinsrc/contract/posts.ts), with a path under/api/me/(a comment on a post isPOST /api/me/posts/{postId}/comments, notPOST /api/posts/{postId}/comments):tests/unit/openapi-rules.test.tsfails otherwise. A public endpoint is a deliberate edit toPUBLIC_OPERATIONSintests/api/public-operations.test.ts, which expects 401 without a session from every other operation. Add endpoints to the contract, never as raw Start server routes: a lint rule allows onlysrc/routes/api/$.tsandsrc/routes/api/auth/$.ts. - Implement the handler in
src/server/api/handlers.ts(a new group joinsApiHandlersthere) and any repository method it needs (for examplesrc/server/posts/repo.ts). Keep the in-memory repository oftests/api/harness.tsin step with the real one. A change to stored data follows thedatabase-changeskill first. - Run
pnpm codegento regenerateopenapi.jsonandsrc/sdk/. Never edit either by hand. - Map every new error tag to a message in
src/lib/api-error.ts. Its error union is derived from the generated SDK, sopnpm typecheckfails until the switch indescribeApiErrorhandles the new tag. - Test, cheapest layer first (read
tests/api/AGENTS.md): every handler branch intests/api/throughclientAs(...)(handlers.tsis in the 100% coverage gate), including each declared status, because the contract-coverage check after a fullverify:appfails on a declared status no test provoked. A repository method also gets a query budget intests/db/<feature>-query-budget.test.ts.tests/api/database-down.test.tsandtests/api/public-operations.test.tscover a new operation without edits (tests/api/operations.ts).
Done when
pnpm check:drift contractandpnpm checkpass.openapi.json,src/sdk/and their sources are in the same commit.- For a change a user can reach:
pnpm build && pnpm verify:apppasses.
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.

