Agent skill

Cursor BYOK Database Schema

by leookun in leookun/cursor-byok

Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.

MITAuto-check passedDatabases

Install Cursor BYOK Database Schema

skills CLI
$ npx skills add leookun/cursor-byok --skill database-schema -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install leookun/cursor-byok database-schema --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/leookun/cursor-byok.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/database-schema .claude/skills/database-schema && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
database-schema
GitHub stars
3.2k
Token cost
~1.3k tokens
SKILL.md length
631 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.

  • Works in 7 steps: Migration SQL and constraints. → Rust domain/request/response structs. → SQL column lists, placeholders,… → …
  • Adding a table or column to the server database
  • SKILL.md covers Architecture, Migration rules, SQLite design and Application changes, plus 1 more section
  • Calls cargo and npm

What it does

A schema change is treated as an end-to-end persistence change, not a lone SQL edit. Before editing, the agent reads the whole table definition, every query that reads or writes it, its Rust types, API projections and fixtures, searching by table and field names rather than inferring the path from one file. Migrations are embedded SQLx files in server/migrations, run from server/src/store/sqlite.rs.

The migration rules are strict. An applied migration is never modified, renamed, reordered or deleted, since SQLx checksums it and startup fails, so each change is a new numbered forward migration with a descriptive name. A fresh database must reach the current schema by applying all migrations in order, with no duplicated columns. History is rewritten only if you explicitly ask for a full reset. No compatibility views, triggers, shadow fields or fallback reads are added, and unrelated changes get separate migrations.

The SQLite design guidance covers choosing nullability from domain meaning, booleans stored as constrained integers, CHECK, UNIQUE and foreign-key constraints only for real invariants with a deliberate ON DELETE choice, indexes only for demonstrated query needs, and transactions for multi-table changes. The excerpt is cut off after that.

When your agent uses it

  • Adding a table or column to the server database
  • Writing a new SQLx migration
  • Adding indexes, constraints or foreign keys
  • Reviewing a schema change for alignment with store code and fixtures

Example prompts

  • “Add a request_protocol column to the requests table with a new migration.”
  • “Review my new migration for nullability, defaults and indexes.”
  • “Add a unique constraint to the sessions table and update the store code and fixtures.”

Requirements

  • The cursor-byok repository with its server folder

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Migration SQL and constraints.
  2. Rust domain/request/response structs.
  3. SQL column lists, placeholders, .bind(...) order, row decoding, and update statements.
  4. Transactions and repository/store methods.
  5. API serialization and frontend TypeScript types when the field is exposed.
  6. UI creation, editing, listing, and details when requested by the product behavior.
  7. Test fixtures, literal struct initializers, snapshots, and mock rows.

What it can do on your machine

Read from SKILL.md and the folder at commit 9a8fde2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cursor BYOK Database Schema loads about 1.3k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 631 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from leookun/cursor-byok at commit 9a8fde2, republished under its MIT licence (© leookun). 631 words, ~1,288 tokens.

Download SKILL.mdSave it as .claude/skills/database-schema/SKILL.md (or your agent's skills folder).
name
database-schema
description
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.

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:

text
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 coverage

Before 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.rs runs embedded SQLx migrations from server/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 NULL for 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. Choose ON DELETE behavior 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.
Show full SKILL.md (246 more words)Show less

Application changes

Trace every changed field through the full path that applies:

  1. Migration SQL and constraints.
  2. Rust domain/request/response structs.
  3. SQL column lists, placeholders, .bind(...) order, row decoding, and update statements.
  4. Transactions and repository/store methods.
  5. API serialization and frontend TypeScript types when the field is exposed.
  6. UI creation, editing, listing, and details when requested by the product behavior.
  7. 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:

bash
cargo fmt --all -- --check
cargo test --workspace

If frontend contracts changed, also run from apps/desktop:

bash
npm run check

Do not repair unrelated dirty-worktree changes while validating. Report any pre-existing failure separately from failures caused by the schema change.

© leookun, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/database-schema of leookun/cursor-byok.

Open the folder on GitHubat commit 9a8fde2

Compare with similar skills

Cursor BYOK Database Schema next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cursor BYOK Database Schema compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cursor BYOK Database Schema this skillleookun/cursor-byok3.2k—~1.3kAutomated safety check: PassMIT
Golang Databaseunxed/f42402 repos~2.9kAutomated safety check: PassMIT
DB Migrationskurealnum/dotfiles290—~820Automated safety check: PassNone
DB ContextSilvioBaratto/optimizer176—~6.4kAutomated safety check: NotesCustom licence
SQLsendou-ink/sendou.ink297—~423Automated safety check: PassAGPL-3.0
Database MigrationRain-kl/OpenFlare288—~1.3kAutomated safety check: PassApache-2.0

Similar skills

  • Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…

    240 GitHub starsUsed in 2 repos~2.9k tokens
    DatabasesAuto-check passed
  • DB Migrations

    kurealnum/dotfiles

    A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…

    290 GitHub stars~820 tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • DB Context

    SilvioBaratto/optimizer

    Complete knowledge of the optimizer PostgreSQL database: 57 ingestion tables, schema, relationships, live row counts, query patterns, and conventions.

    176 GitHub stars~6.4k tokensUpdated yesterday
    DatabasesAuto-check: notes
  • SQL

    sendou-ink/sendou.ink

    Help write, debug, and explore SQLite database queries using Kysely.

    297 GitHub stars~423 tokensUpdated today
    DatabasesAuto-check passed
  • Database Migration

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改数据库表结构、索引、初始化数据、系统配置 seed、模板 seed、默认管理员、goose SQL 迁移、internal/infra/persistence/migrator、ClickHouse 分析库 DDL 或数据库升级流程时必须使用。本技能指导在 internal/infra/persistence/migrator/goose 下编写…

    288 GitHub stars~1.3k tokensUpdated today
    DatabasesAuto-check passed
  • Database Marchat

    Cod-e-Codes/marchat

    Changes marchat SQL schema and queries across SQLite, PostgreSQL, and MySQL using dialect helpers.

    137 GitHub stars~985 tokensUpdated 4 days ago
    DatabasesAuto-check passed

More from leookun/cursor-byok

  • Cursor BYOK Prefix Stability

    leookun/cursor-byok

    Guides changes to the cursor-byok server so provider conversation history stays append-only and each turn's history remains an exact prefix of the next, protecting prefix caches.

    3.2k GitHub stars~1.3k tokensUpdated 9 days ago
    Auto-check passed
  • Cursor BYOK Frontend Guide

    leookun/cursor-byok

    Sets the rules for building the Cursor BYOK desktop app's React and Tauri frontend, especially its HTTP boundary and component state architecture.

    3.2k GitHub stars~1.9k tokensUpdated 9 days ago
    Auto-check passed
  • Model Selection Component

    leookun/cursor-byok

    Standardizes how a desktop app's UI lets a person choose one or more already-configured AI models, through a single grouped dropdown component.

    3.2k GitHub stars~1.3k tokensUpdated 9 days ago
    Auto-check passed
  • Cursor BYOK Desktop Release

    leookun/cursor-byok

    Guides releases of the Cursor BYOK desktop app on GitHub, with strict rules on who may publish and how version tags, updater manifests and signing are handled.

    3.2k GitHub stars~1.3k tokensUpdated 9 days ago
    Auto-check passed
  • Desktop i18n for Cursor BYOK

    leookun/cursor-byok

    Rules for localizing the Cursor BYOK desktop app: the global t() function, complete locale catalogs, system-language selection and the scan-and-check commands.

    3.2k GitHub stars~508 tokensUpdated 9 days ago
    Auto-check passed
  • Floating UI Overlays

    leookun/cursor-byok

    Rules for building dropdowns, popovers, tooltips and menus in the desktop app with @floating-ui/dom, covering portals, positioning, dismissal and ARIA state.

    3.2k GitHub stars~496 tokensUpdated 9 days ago
    Auto-check passed

Works with

Categories

Questions about Cursor BYOK Database Schema

What does Cursor BYOK Database Schema do?

Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned. A schema change is treated as an end-to-end persistence change, not a lone SQL edit. Before editing, the agent reads the whole table definition, every query that reads or writes it, its Rust types, API projections and fixtures, searching by table and field names rather than inferring the path from one file.

When should I use Cursor BYOK Database Schema?

Cursor BYOK Database Schema fits situations like: adding a table or column to the server database; writing a new SQLx migration; adding indexes, constraints or foreign keys; reviewing a schema change for alignment with store code and fixtures.

How do I install Cursor BYOK Database Schema in Claude Code?

Run `npx skills add leookun/cursor-byok --skill database-schema -a claude-code`. Or copy the skill folder (.agents/skills/database-schema in leookun/cursor-byok) into .claude/skills/database-schema in your project. Claude Code loads it when a task matches its description.

How do I install Cursor BYOK Database Schema in Codex?

Run `npx skills add leookun/cursor-byok --skill database-schema -a codex`. Or copy the skill folder (.agents/skills/database-schema in leookun/cursor-byok) into .agents/skills/database-schema in your project. Codex loads it when a task matches its description.

Can I use Cursor BYOK Database Schema in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add leookun/cursor-byok --skill database-schema -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-schema, .gemini/skills/database-schema, .github/skills/database-schema and .opencode/skills/database-schema in your project.

What does Cursor BYOK Database Schema need to run?

Going by SKILL.md and its folder, Cursor BYOK Database Schema needs the command-line tools its instructions call (cargo and npm). Our summary lists: The cursor-byok repository with its server folder.

Does Cursor BYOK Database Schema access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Cursor BYOK Database Schema safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cursor BYOK Database Schema use?

Cursor BYOK Database Schema is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cursor BYOK Database Schema use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cursor BYOK Database Schema?

Skills that share tags, products or a category with Cursor BYOK Database Schema: Golang Database (unxed/f4, 240 stars), DB Migrations (kurealnum/dotfiles, 290 stars), DB Context (SilvioBaratto/optimizer, 176 stars) and SQL (sendou-ink/sendou.ink, 297 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cursor BYOK Database Schema?

leookun (a GitHub user) maintains it in leookun/cursor-byok, which has 3,151 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on September 28, 2026.

Source: leookun/cursor-byok on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.