db-migration
Skill16 starsChanged 5 months agoMITView on GitHub
Make a database schema change safely — edit schema.ts, generate the migration, review the SQL, apply it. Use for any change under src/db/.
27 other projects use a version of this.
Adopted by
Most recently taken up by
- chatquill/claude-code-websitestheir own version, first seen Nov 22, 2026
- mohitkale/wordpress-devkittheir own version, first seen Nov 15, 2026
- chrysogonus/prompt-maker-studiotheir own version, first seen Nov 15, 2026
- ricci-labs/twisetheir own version, first seen Nov 8, 2026
- aniketshukla1/sdlc-kittheir own version, first seen Nov 8, 2026
- globalmpc/backendskillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use api-endpoint, add-api-endpoint and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
tadoEngSkillapi-endpoint
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.
Also in 4 projects that use this
dream-horizon-orgSkilladd-api-endpoint
Step-by-step workflow for adding a new REST API endpoint to pulse-server. Use when creating a new backend endpoint, route, resource, or API in backend/server/.
Also in 3 projects that use this
SentrySkillwrite-tests
Write tests following project conventions. Use when adding new tests or modifying existing ones.
Also in 3 projects that use this
Microsoft AzureSkillgit-workflow
Squad branching model: dev-first workflow with insiders preview channel
Also in 3 projects that use this
Microsoft AzureSkilldesign
Design rules and conventions for the API Center Portal. Use when editing detail pages, card components, badges, layout, navigation, sidebars, or headers. Covers badge styling, metadata placement, page navigation patterns, and layout alignment.
Also in 3 projects that use this
AnthropicSkilldebug
Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.
Also in 3 projects that use this
- +1 more from Azure
Other versions27 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 27
- dipu-bd/lightnovel-crawler★ 2.6ksame name
- lncrawl/lightnovel-crawler★ 2.6ksame name
- openmeterio/openmeter★ 2.5ksame name
- F3-Nation/f3-nation★ 211same name
- hiromaily/go-crypto-wallet★ 128same name
- nrjdalal/zerostarter★ 65same name
- globalmpc/backendskills★ 63same name
- xin-lai/CodeSpirit★ 56same name
- NicholasFlemmer/styx-app★ 32same name
- chrysogonus/prompt-maker-studio★ 7same name
17 more not listed
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 repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/billing.mdcCursor rule
- .cursor/rules/core.mdcCursor rule
- add-ai-providerSkill
- add-featureSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 23 edited versions we read keep these.
1
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
- Distinctive: line 16
Every foreign key gets an index.
- Very specific: line 27
Run pnpm test — the ledger suite will catch schema drift in credit tables.
- Very specific: line 29
Commit src/db/schema.ts and the new drizzle/ files together.
- Very specific: line 34
Run drizzle-kit push against anything but a throwaway local DB — this repo uses generated, committed migrations.
“Common” is measured: kept by at least 6 in 10 of the 23 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
Database migration
Applied migrations are immutable history. This skill exists so nobody ever "just edits the SQL file".
Steps
- Ask the user first. Schema changes are on the ASK FIRST list in AGENTS.md. Describe the change and why.
- Edit
src/db/schema.tsonly. Conventions:- Every foreign key gets an index.
- Timestamps:
createdAtwithdefaultNow(), timezone-aware. - Money in integer cents; credits in integers.
- Enums via
pgEnum, named<table>_<column>.
- Generate:
pnpm db:generate. Never write migration SQL by hand. - Read the generated file in
drizzle/. Confirm: no unintendedDROP, correct column types/defaults, indexes present. Column renames often generate drop+create — if data must survive, say so and write the migration plan out for the user before applying. - Apply locally:
pnpm db:migrate(Postgres running viadocker compose up -d). - Run
pnpm test— the ledger suite will catch schema drift in credit tables. - Commit
src/db/schema.tsand the newdrizzle/files together.
Never
- Edit or delete an existing file in
drizzle/. - Run
drizzle-kit pushagainst anything but a throwaway local DB — this repo uses generated, committed migrations. - Touch
credit_transactionssemantics (signed integer amounts, UNIQUEidempotencyKey) without reading.claude/rules/billing.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.

