Cursor BYOK Database Schema
leookun/cursor-byok
Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.
A skill your agent uses when adding or modifying a SQL query against the SQLite store — symptoms include "add a method to Store", "new column on nodes", "expose X via the store", "add an index"…
$ npx skills add radimsem/remindb --skill add-store-query -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install radimsem/remindb add-store-query --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/radimsem/remindb.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/add-store-query .claude/skills/add-store-query && rm -rf skills-srcUse ~/.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/
Install the "add-store-query" agent skill from https://github.com/radimsem/remindb/tree/dev/.claude/skills/add-store-query into .claude/skills/add-store-query/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-store-query", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/radimsem/remindb/tree/dev/.claude/skills/add-store-queryType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add radimsem/remindb --skill add-store-query -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install radimsem/remindb add-store-query --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/radimsem/remindb.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/add-store-query .agents/skills/add-store-query && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "add-store-query" agent skill from https://github.com/radimsem/remindb/tree/dev/.claude/skills/add-store-query into .agents/skills/add-store-query/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-store-query", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add radimsem/remindb --skill add-store-query -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install radimsem/remindb add-store-query --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/radimsem/remindb.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/add-store-query .cursor/skills/add-store-query && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "add-store-query" agent skill from https://github.com/radimsem/remindb/tree/dev/.claude/skills/add-store-query into .cursor/skills/add-store-query/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-store-query", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/radimsem/remindb.git --path .claude/skills/add-store-query--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add radimsem/remindb --skill add-store-query -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install radimsem/remindb add-store-query --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/radimsem/remindb.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/add-store-query .gemini/skills/add-store-query && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "add-store-query" agent skill from https://github.com/radimsem/remindb/tree/dev/.claude/skills/add-store-query into .gemini/skills/add-store-query/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-store-query", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install radimsem/remindb add-store-queryInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add radimsem/remindb --skill add-store-query -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/radimsem/remindb.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/add-store-query .github/skills/add-store-query && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "add-store-query" agent skill from https://github.com/radimsem/remindb/tree/dev/.claude/skills/add-store-query into .github/skills/add-store-query/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-store-query", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add radimsem/remindb --skill add-store-query -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install radimsem/remindb add-store-query --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/radimsem/remindb.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/add-store-query .opencode/skills/add-store-query && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "add-store-query" agent skill from https://github.com/radimsem/remindb/tree/dev/.claude/skills/add-store-query into .opencode/skills/add-store-query/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-store-query", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
add-store-queryA skill your agent uses when adding or modifying a SQL query against the SQLite store — symptoms include "add a method to Store", "new column on nodes", "expose X via the store", "add an index"…
Add Store Query is an agent skill from radimsem/remindb. Use when adding or modifying a SQL query against the SQLite store — symptoms include "add a method to Store", "new column on nodes", "expose X via the store", "add an index", "support a new lookup", "write a migration", or any change to pkg/store/queries.go, pkg/store/.go methods, or migrations/. Covers both the read/write method workflow and the schema-migration workflow with FTS5 trigger sync.
Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering SQL and Database migrations. It works with SQLite, SQL and Model Context Protocol. The repository describes itself as: An agentic memory database that cuts session tokens by 82–99%. One portable SQLite file — your agent's memory, anywhere. The licence is MIT.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 977b31c. It shows what the files ask for, not the result of running them.
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.
Shell commands in SKILL.md call:
gogitFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Add Store Query loads about 2k tokens when it runs. Until then it costs about 106 tokens; SKILL.md has 792 words of instructions outside code blocks.
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.
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.
The full file from radimsem/remindb at commit 977b31c, republished under its MIT licence (© radimsem). 792 words, ~1,978 tokens.
.claude/skills/add-store-query/SKILL.md (or your agent's skills folder).pkg/store/ is the SQLite layer. Queries are SQL string constants in queries.go; methods on *Store execute them through s.Tx(...) for writes or s.db.QueryContext(...) for reads. Schema lives in migrations/000N_*.sql, embedded via embed.FS and applied at startup.
There are two workflows here. Pick the right one before you start.
Need new SQL only? ──> Workflow A (query)
Need a new column / table / index? ──> Workflow A + Workflow B (migration)Three files. Same pattern every time.
| File | What changes |
|---|---|
pkg/store/queries.go | Add a q<Verb><Noun> = ... const |
pkg/store/<domain>.go | Add the method on *Store (temperature.go, node.go, search.go, snapshot.go — pick the matching domain) |
pkg/store/store_test.go | Add a test that opens testutil.OpenTestDB(t) and exercises the method |
Constants are grouped at the bottom of queries.go next to related queries. Name them q<Verb><Noun> — e.g., qSelectColdNodes, qBoostTemperature, qIncrementAccess. No package prefix; the file is the namespace.
const qListSourceFiles = `SELECT DISTINCT source_file FROM nodes ORDER BY source_file`For batch queries with a variable IN list, follow the qBoostTemperatureBatchPrefix pattern: define the prefix as a const, append placeholders + ) in the calling method.
Two flavors based on read vs write.
Reads call s.db.QueryContext directly, defer rows.Close(), and return through collectRows (or a dedicated row-scanner if the columns differ from nodeColumns). Reads do not wrap in s.Tx(...).
func (s *Store) ListSourceFiles(ctx context.Context) ([]string, error) {
rows, err := s.db.QueryContext(ctx, qListSourceFiles)
if err != nil {
return nil, err
}
defer func() { _ = rows.Close() }()
var out []string
for rows.Next() {
var path string
if err := rows.Scan(&path); err != nil {
return nil, err
}
out = append(out, path)
}
return out, rows.Err()
}Writes wrap in s.Tx(ctx, func(tx *sql.Tx) error { ... }) so the FTS5 triggers fire atomically with the main update. See BoostTemperature / DecayTemperatures in temperature.go.
func (s *Store) MarkVisited(ctx context.Context, id string) error {
return s.Tx(ctx, func(tx *sql.Tx) error {
_, err := tx.ExecContext(ctx, qMarkVisited, time.Now().Unix(), id)
return err
})
}For writes that need RowsAffected, capture it inside the closure via a named-scope variable; see DecayTemperatures for the pattern.
store_test.go defines a local unexported openTestDB(t) helper (the public testutil.OpenTestDB is for cross-package callers like integration tests; inside pkg/store itself, use the local helper to avoid an import cycle). Seed rows through other store methods (don't poke SQL directly inside the test body), exercise the new method, assert. Mirror the existing tests for tone — minimal, table-driven where it helps.
Migrations are numbered SQL files in migrations/, loaded via //go:embed *.sql (migrations/migrations.go). They run in lex order at startup, so file naming carries the order.
000N_<verb>_<noun>.sql — zero-padded to 4 digits, snake_case body. Existing files: 0001_init.sql, 0002_compile_root.sql. Next is 0003_<verb>_<noun>.sql.
IF NOT EXISTS / IF EXISTS everywhere. Migrations may be applied to a partially-initialized DB; idempotency is the only safe assumption.git log.NOT NULL, DEFAULT, REFERENCES go on the ALTER TABLE ADD COLUMN line.nodes_fts is a virtual FTS5 table whose content is mirrored from nodes via three triggers (nodes_fts_insert, nodes_fts_delete, nodes_fts_update in 0001_init.sql:52-67). If your migration adds a searchable column to nodes, you must:
nodes_fts USING fts5(...) declaration — but FTS5 virtual-table column lists can't be ALTERed. The migration has to drop and recreate nodes_fts, then rebuild by triggering the insert path for every existing row.This is invasive. Reach for it only when the column truly needs full-text matching. For metadata-only columns, leave nodes_fts alone.
If you only need indexable but non-FTS lookup, add a regular CREATE INDEX IF NOT EXISTS idx_nodes_<col> ON nodes(<col>); line — see the existing idx_nodes_temperature, idx_nodes_parent etc. at the bottom of 0001_init.sql.
go test ./pkg/store/... -run TestMigrate # must pass
go test ./... # full suite picks up schema driftWorkflow A (query only):
1. pkg/store/queries.go (q<Verb><Noun> const)
2. pkg/store/<domain>.go (method on *Store)
3. pkg/store/store_test.go (Test<Method>_<Case>)
4. go test ./pkg/store/...
Workflow B (schema):
1. migrations/000N_<verb>_<noun>.sql (one logical change, IF NOT EXISTS)
2. If touching nodes searchable cols: rebuild nodes_fts + update 3 triggers
3. Then Workflow A for the read/write methods that consume the new shape
4. go test ./...s.db.ExecContext for writes instead of s.Tx(...). FTS5 triggers run inside the implicit transaction; raw Exec may still work for simple updates but breaks atomicity guarantees and is inconsistent with the codebase. Use s.Tx.qInsertSomething when it's an UPDATE. The verb has to match the SQL operation. Reviewer-grep relies on it.CREATE INDEX IF NOT EXISTS in the same migration.nodes_fts without rebuilding. A schema change to nodes searchable columns leaves nodes_fts stale until a full rebuild. Search results will silently drop the new column from ranking.IF NOT EXISTS on CREATE TABLE / CREATE INDEX. Re-running migrations on a partially-applied DB will fail without it. Every existing line in 0001_init.sql uses it.time.Now() in the SQL string. Use SQLite's unixepoch() function (see qBoostTemperature) or pass time.Now().Unix() as a bind arg. String concatenation is both wrong and the start of an injection bug..claude/rules/go-concise.md — error wrapping (action errors get failed to <verb>:), method receiver consistency, no premature interface.claude/rules/git-versioning.md — feat(store): add MarkVisited query is one commit; feat(migration): 0003 add visited_at column is a separate commit if it ships independently. Migration files are append-only — never edit a committed migration; write a new one.claude/skills/add-mcp-tool/SKILL.md — when a new tool needs a new query, do this skill first© radimsem, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/add-store-query of radimsem/remindb.
Open the folder on GitHubat commit 977b31c
Add Store Query 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Add Store Query this skillradimsem/remindb | 129 | — | ~2k | Automated safety check: Pass | MIT | |
| Cursor BYOK Database Schemaleookun/cursor-byok | 3.2k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Postgrestimescale/pg-aiguide | 1.9k | — | ~941 | Automated safety check: Pass | Apache-2.0 | |
| Database MigrationRain-kl/OpenFlare | 288 | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Database MarchatCod-e-Codes/marchat | 137 | — | ~985 | Automated safety check: Pass | MIT | |
| Evolving The Data ModelTriliumNext/Trilium | 38k | — | ~2.1k | Automated safety check: Pass | AGPL-3.0 |
leookun/cursor-byok
Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.
timescale/pg-aiguide
A skill your agent uses for any PostgreSQL database work — table design, indexing, data types, constraints, extensions (pgvector, PostGIS, TimescaleDB), search, and migrations.
Rain-kl/OpenFlare
Wavelet 项目专用:当新增或修改数据库表结构、索引、初始化数据、系统配置 seed、模板 seed、默认管理员、goose SQL 迁移、internal/infra/persistence/migrator、ClickHouse 分析库 DDL 或数据库升级流程时必须使用。本技能指导在 internal/infra/persistence/migrator/goose 下编写…
Cod-e-Codes/marchat
Changes marchat SQL schema and queries across SQLite, PostgreSQL, and MySQL using dialect helpers.
TriliumNext/Trilium
A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…
prest/prest
Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.
radimsem/remindb
Guides an agent writing to a remindb memory server: structured notes go in as files parsed into a node tree, single text facts go in through MemoryWrite.
radimsem/remindb
Covers the read-side tools of the remindb MCP server, a SQLite-backed agent memory, for orienting, searching, resyncing and tracing relations.
radimsem/remindb
Adds a new row to remindb's token-savings benchmark table by writing a scenario function that measures the naive shell-tool token cost against the remindb tool-call cost for the same task.
radimsem/remindb
Adds a new Go fuzz target to remindb following its seed-corpus discipline: one target per logical surface, discovered automatically by its FuzzXxx function name.
radimsem/remindb
Explains how to add an end-to-end test scenario to remindb, choosing between a direct API test and an MCP test and using the shared helpers and fixtures.
radimsem/remindb
Checklist for adding a new Memory-prefixed tool to remindb's Go MCP server: tool file, registration, test, skill docs, plus the locking and logging rules.
Works with
Categories
A skill your agent uses when adding or modifying a SQL query against the SQLite store — symptoms include "add a method to Store", "new column on nodes", "expose X via the store", "add an index"…. Add Store Query is an agent skill from radimsem/remindb.go methods, or migrations/.
Add Store Query fits situations like: modifying a SQL query against the SQLite store — symptoms include add a method to Store; new column on nodes; expose X via the store; support a new lookup.
Run `npx skills add radimsem/remindb --skill add-store-query -a claude-code`. Or copy the skill folder (.claude/skills/add-store-query in radimsem/remindb) into .claude/skills/add-store-query in your project. Claude Code loads it when a task matches its description.
Run `npx skills add radimsem/remindb --skill add-store-query -a codex`. Or copy the skill folder (.claude/skills/add-store-query in radimsem/remindb) into .agents/skills/add-store-query in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add radimsem/remindb --skill add-store-query -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-store-query, .gemini/skills/add-store-query, .github/skills/add-store-query and .opencode/skills/add-store-query in your project.
Going by SKILL.md and its folder, Add Store Query needs the command-line tools its instructions call (go and git).
SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
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.
Add Store Query is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Add Store Query: Cursor BYOK Database Schema (leookun/cursor-byok, 3.2k stars), Postgres (timescale/pg-aiguide, 1.9k stars), Database Migration (Rain-kl/OpenFlare, 288 stars) and Database Marchat (Cod-e-Codes/marchat, 137 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
radimsem (a GitHub user) maintains it in radimsem/remindb, which has 129 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on August 3, 2026.
Source: radimsem/remindb on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.