database-schema
Skill33 starsChanged 33 days agoMITView on GitHub
Implement and review Cursor BYOK SQLite schema changes. Use when adding or changing tables, columns, indexes, constraints, foreign keys, SQLx migrations, persistence mappings, or database fixtures under server.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- nirholas/memescope-mondaytheir own version, first seen Nov 15, 2026
- leookun/cursor-byokword for word, first seen Oct 8, 2026
- alinaqi/claude-bootstraptheir own version, first seen Oct 8, 2026
- SkillMedev/full-stack-web-devtheir own version, first seen Oct 5, 2026
- alinaqi/maggytheir own version, first seen Jun 12, 2026
- hallucinaut/skillstheir own version, first seen Jun 10, 2026
Other versions7 projects use a version of this.
Word for word · 1
- leookun/cursor-byok★ 3.2k100% same
Edited · 0
None found.
Wrote their own version · 6
- alinaqi/maggy★ 711same name
- alinaqi/claude-bootstrap★ 708same name
- nirholas/memescope-monday★ 17same name
- SkillMedev/full-stack-web-dev★ 1same name
- hallucinaut/skills★ 0same name
- PengEjeen/claude_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 repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cursor-prefix-stabilitySkill
- floating-uiSkill
- frontendSkill
- i18nSkill
- model-selectionSkill
- releaseSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 13 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Treat a schema change as an end-to-end persistence change, not as an isolated SQL edit.
- Distinctive: line 12
Use the existing layers and keep responsibilities in their current directories:
- Distinctive: line 22
Before editing, inspect the complete table definition, every query that reads or writes it, its Rust types, API projections, and relevant …
- Very specific: line 27
Never modify, rename, reorder, or delete a migration that may already have been applied.
- Very specific: line 28
Add the next numbered forward migration, using a descriptive filename such as 0003_add_request_protocol.sql.
- Distinctive: line 30
Only squash or rewrite migration history when the user explicitly asks for a full database reset and accepts that existing databases will …
- Distinctive: line 31
Do not add compatibility views, triggers, shadow fields, or fallback reads.
- Distinctive: line 32
Keep one coherent schema change together.
- Very specific: line 38
Add CHECK, UNIQUE, and foreign-key constraints when they express real invariants.
- Distinctive: line 39
Add an index only for a demonstrated lookup, join, ordering, or uniqueness requirement.
- Distinctive: line 40
Use a transaction for changes that must update multiple tables atomically.
- Distinctive: line 54
Test fixtures, literal struct initializers, snapshots, and mock rows.
- Distinctive: line 58
When a value records the effective behavior of a call, persist the value actually consumed at execution time rather than merely the model …
- Distinctive: line 62
Add focused coverage proportional to the change:
- Distinctive: line 71
Run the narrow tests first, then the repository checks affected by the change.
- Very specific: line 78
If frontend contracts changed, also run from apps/desktop:
- Distinctive: line 84
Do not repair unrelated dirty-worktree changes while validating.
“Common” is measured: kept by at least 6 in 10 of the 6 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
Cursor BYOK Database Schema
Treat a schema change as an end-to-end persistence change, not as an isolated SQL edit. Keep the database, Rust store, API contracts, fixtures, and tests aligned.
Architecture
Use the existing layers and keep responsibilities in their current directories:
server/
├── migrations/ Ordered SQLite/SQLx migrations
├── src/store/ Queries, bindings, row decoding, transactions
├── src/ Domain and API types that consume persisted data
└── tests/ Migration, store, API, and integration coverageBefore editing, inspect the complete table definition, every query that reads or writes it, its Rust types, API projections, and relevant fixtures. Search by the table name and affected field names; do not infer the persistence path from one file.
Migration rules
server/src/store/sqlite.rsruns embedded SQLx migrations fromserver/migrations.- Never modify, rename, reorder, or delete a migration that may already have been applied. SQLx records its checksum; changing an applied file causes startup failure with
migration ... was previously applied but has been modified. - Add the next numbered forward migration, using a descriptive filename such as
0003_add_request_protocol.sql. - A fresh database must reach the current schema by applying all migrations in order. Do not duplicate a new column or table in both the initial migration and a later migration.
- Only squash or rewrite migration history when the user explicitly asks for a full database reset and accepts that existing databases will no longer start. Do not infer that permission from a development-only workflow.
- Do not add compatibility views, triggers, shadow fields, or fallback reads. Migrate once, then make the application consume the new schema directly.
- Keep one coherent schema change together. Split unrelated changes into separate migrations.
SQLite design
- Choose nullability from domain meaning. Use
NULLfor genuinely unknown historical data; use a default only when it is correct for every existing row. - Store booleans as constrained integers, for example
INTEGER NOT NULL DEFAULT 0 CHECK (enabled IN (0, 1)). - Add
CHECK,UNIQUE, and foreign-key constraints when they express real invariants. ChooseON DELETEbehavior deliberately. - Add an index only for a demonstrated lookup, join, ordering, or uniqueness requirement. Match its leading columns to actual query shapes.
- Use a transaction for changes that must update multiple tables atomically.
- SQLite supports only limited
ALTER TABLE. For an unsupported constraint, type, or destructive column change, create the replacement table with the final schema, copy and transform data, replace the old table, and recreate required indexes and foreign keys in one migration. - Preserve timestamps, identifiers, and existing semantic values during table rebuilds. Do not silently manufacture domain data.
Application changes
Trace every changed field through the full path that applies:
- Migration SQL and constraints.
- Rust domain/request/response structs.
- SQL column lists, placeholders,
.bind(...)order, row decoding, and update statements. - Transactions and repository/store methods.
- API serialization and frontend TypeScript types when the field is exposed.
- UI creation, editing, listing, and details when requested by the product behavior.
- Test fixtures, literal struct initializers, snapshots, and mock rows.
List SQL columns explicitly. Keep selected-column order, row decoding, insert columns, and bind order visibly aligned. Avoid SELECT * because schema additions can silently invalidate positional decoding assumptions.
When a value records the effective behavior of a call, persist the value actually consumed at execution time rather than merely the model or provider default. Keep absent, defaulted, and explicitly supplied values distinguishable when that distinction matters.
Verification
Add focused coverage proportional to the change:
- A fresh database applies every migration.
- A database at the previous migration upgrades successfully and preserves existing rows.
- Store create/read/update paths round-trip the new fields.
- Defaults, nullability, uniqueness, checks, and foreign keys behave as designed.
- Multi-table writes roll back atomically on failure.
- API and frontend types expose the same semantics when applicable.
Run the narrow tests first, then the repository checks affected by the change. At minimum for server schema work, run:
cargo fmt --all -- --check
cargo test --workspaceIf frontend contracts changed, also run from apps/desktop:
npm run checkDo not repair unrelated dirty-worktree changes while validating. Report any pre-existing failure separately from failures caused by the schema change.
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.

