Individual skill

add-model

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.

skills/add-model/SKILL.md

Read pinned source

Source commit fab932074b6834948af8313220804b174e5b4c64

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
Yes
Observed behavior
Instructions only
Last checked
Nov 4, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
11
Repository last updated
Oct 21, 2026
License
Apache-2.0

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Add or change a model

1. **Append a migration** to `src/db/migrations.ts` with the next id (`000N_<verb>_<table>`). Never edit,
   reorder, or delete a migration that may already have run somewhere.
2. **SQL conventions:**
   - Ids are `INTEGER PRIMARY KEY AUTOINCREMENT`. Columns are `snake_case`.
   - Timestamps: `TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))`.
   - Foreign keys are enforced. Write `REFERENCES users(id) ON DELETE CASCADE` and index every
     foreign key column.
   - Use `COLLATE NOCASE` for case-insensitive unique text such as emails.
   - One migration may contain several statements.

   ```ts
   {