add-model
Skill11 starsChanged 22 days agoApache-2.0View on GitHub
Add or change a database table in a create-bun-api project (SQLite via bun:sqlite) using an append-only migration and a typed repository. Use when asked to add a model, table, column, index, or relation, or to persist new data.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- theopenco/llmgatewaytheir own version, first seen Nov 6, 2026
- whitecircle/halotheir own version, first seen Oct 9, 2026
- guoqingbao/vllm.rstheir own version, first seen Oct 8, 2026
- autogluon/tabarenatheir own version, first seen Oct 8, 2026
- Ame-Al/ametheir own version, first seen Oct 8, 2026
- netbox-community/netboxtheir own version, first seen Oct 8, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- simstudioai/sim★ 30ksame name
- netbox-community/netbox★ 22ksame name
- theopenco/llmgateway★ 1.7ksame name
- Pipelex/pipelex★ 949same name
- whitecircle/halo★ 851same name
- adaline/gateway★ 606same name
- giselles-ai/giselle★ 560same name
- autogluon/tabarena★ 363same name
- guoqingbao/vllm.rs★ 345same name
- BerriAI/litellm-skills★ 84same name
3 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-endpointSkill
- create-bun-apiSkill
- verify-and-debugSkill
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 11 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 15
Use COLLATE NOCASE for case-insensitive unique text such as emails.
“Common” is measured: kept by at least 6 in 10 of the 11 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 or change a model
- Append a migration to
src/db/migrations.tswith the next id (000N_<verb>_<table>). Never edit, reorder, or delete a migration that may already have run somewhere. SQL conventions:
- Ids are
INTEGER PRIMARY KEY AUTOINCREMENT. Columns aresnake_case. - Timestamps:
TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')). - Foreign keys are enforced. Write
REFERENCES users(id) ON DELETE CASCADEand index every foreign key column. - Use
COLLATE NOCASEfor case-insensitive unique text such as emails. - One migration may contain several statements.
{ id: "0002_create_notes", sql: ` CREATE TABLE notes ( id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, title TEXT NOT NULL, created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) ); CREATE INDEX notes_user_id ON notes (user_id); `, },- Ids are
- Changing an existing table:
ALTER TABLE … ADD COLUMN(nullable or with aDEFAULT) andALTER TABLE … RENAME COLUMNwork directly. Dropping a column or changing its type or constraints needs a table rebuild. Follow references/table-rebuild.md exactly: withoutdisableForeignKeys: true, the rebuild silently deletes child rows. - Repository (
src/modules/<name>/<name>.repository.ts):- Prepare each statement once with
db.query<Row, Params>(sql), using$namedparameters. Pass the object without the$({ userId }for$userId). The database runs in strict mode and throws on a missing parameter. - Map
snake_caserows tocamelCasedomain objects in onetoX()function. Never return secrets such as password hashes. - For unique violations, check
error.code === "SQLITE_CONSTRAINT_UNIQUE"and returnnull; the service then throwsconflict().
- Prepare each statement once with
- Test through the HTTP routes with
createTestApp(). It gives a fresh in-memory database with every migration applied. Add a direct test insrc/db/migrations.test.tsonly for migrations that move data. - Run
bun run verify.
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.

