add-migration
Skill36 starsChanged 19 days agoMITView on GitHub
Add a database change to TRouteAI the safe way (an additive SQL migration and its database module). Use when a change needs a new table, column or index, or new stored data.
17 other projects use a version of this.
Adopted by
Most recently taken up by
- M0xoo/wisptheir own version, first seen Nov 29, 2026
- bInference-Lab/bInferencetheir own version, first seen Nov 29, 2026
- WispAgents/wisptheir own version, first seen Nov 29, 2026
- Kangentic/kangentictheir own version, first seen Nov 24, 2026
- andy-dendy-repo/governtheir own version, first seen Nov 16, 2026
- Krzysztof318/MailFathomtheir own version, first seen Nov 15, 2026
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- OpenAEV-Platform/openaev★ 1.9ksame name
- c9s/bbgo★ 1.7ksame name
- Pipelex/pipelex★ 951same name
- earlyaidopters/claudeclaw★ 171same name
- Kangentic/kangentic★ 154same name
- fathomise/MailFathom★ 22same name
- Krzysztof318/MailFathom★ 22same name
- WispAgents/wisp★ 17same name
- andy-dendy-repo/govern★ 2same name
- bInference-Lab/bInference★ 2same name
7 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 repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-dashboard-pageSkill
- add-providerSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Check it on a copy, never on real data:
“Common” is measured: kept by at least 6 in 10 of the 15 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
Add a database change
Change wanted: $ARGUMENTS
The one rule: migrations only add. New tables, new columns, new indexes. Never DROP, never
rename a table or a column, never change what an existing column means. During an update the old
and the new version share one SQLite file for a moment, and a rollback runs old code on the new
schema. If the change seems to need a rename or a removal, stop and propose an additive design
(a new column, the old one left in place).
- Find the next number:
ls src/lib/db/migrations | tail -3. Files are namedNNN_short_name.sqland run in name order, so keep three digits. Two files with the same number stop the app at start. - Write the migration as plain SQL that can run twice without harm:
CREATE TABLE IF NOT EXISTS …,CREATE INDEX IF NOT EXISTS …,ALTER TABLE … ADD COLUMN …with a default so existing rows stay valid. Copy the style of the newest file in the folder. - Use SQL every driver runs. The app works on better-sqlite3, on Node's built-in
node:sqliteand on sql.js. No extension functions, no driver-specific syntax. - Database code goes in
src/lib/db/<module>.ts(copy a small one such asfeatureFlags.ts): importgetDbInstancefrom./core, export small functions, and addexport * from "./db/<module>"tosrc/lib/localDb.ts. Routes never contain SQL. - Secrets stored in the database go through
encryptConnectionFields()(src/lib/db/encryption.ts) or the secrets module. Never store a credential in plain text and never log one.
Check it on a copy, never on real data:
- Fresh database: start the app with
DATA_DIR=$(mktemp -d)and a spare port; it must start without a migration error. - Existing database: start the previous build once in a temporary data folder, then start the
new build on the same folder. The migration must apply, and a backup must appear in
db_backups/inside that folder. - Then the old build must still start on the migrated folder (the rollback case).
Finish with the verify skill and say which of the three starts you ran.
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.

