Agent skill

Add Store Query

by radimsem in radimsem/remindb

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"…

MITAuto-check passedDatabases

Install Add Store Query

skills CLI
$ npx skills add radimsem/remindb --skill add-store-query -a claude-code

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

GitHub CLI
$ gh skill install radimsem/remindb add-store-query --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/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-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
add-store-query
GitHub stars
129
Token cost
~2k tokens
SKILL.md length
792 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

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"…

  • Works in 2 steps: Add the column to the nodes_fts USING… → Update all three triggers to reference…
  • Modifying a SQL query against the SQLite store — symptoms include add a method to Store
  • SKILL.md covers Workflow A — add a query and…, Workflow B — add a migration…, Quick reference and Common mistakes, plus 1 more section
  • Calls go and git

What it does

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.

When your agent uses it

  • 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

Example prompts

  • “add a method to Store”
  • “new column on nodes”
  • “expose X via the store”
  • “/add-store-query”

Workflow steps

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

  1. Add the column to the nodes_fts USING fts5(...) declaration — but FTS5 virtual-table column lists can't be ALTERed. The migration has to…
  2. Update all three triggers to reference the new column.

What it can do on your machine

Read from SKILL.md and the folder at commit 977b31c. 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:

    • go
    • git

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

  • Network

    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.

  • 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

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.

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

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 radimsem/remindb at commit 977b31c, republished under its MIT licence (© radimsem). 792 words, ~1,978 tokens.

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

Add a query (and optionally a migration) to the store

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)

Workflow A — add a query and method

Three files. Same pattern every time.

FileWhat changes
pkg/store/queries.goAdd a q<Verb><Noun> = ... const
pkg/store/<domain>.goAdd the method on *Store (temperature.go, node.go, search.go, snapshot.go — pick the matching domain)
pkg/store/store_test.goAdd a test that opens testutil.OpenTestDB(t) and exercises the method
Query const

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.

go
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.

Method shape

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(...).

go
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.

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.

Test

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.

Workflow B — add a migration (when schema changes)

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.

Naming

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.

Content rules
  • IF NOT EXISTS / IF EXISTS everywhere. Migrations may be applied to a partially-initialized DB; idempotency is the only safe assumption.
  • One logical change per migration. Adding a column and adding an index = two migrations, two files. Easier to roll forward, easier to read in git log.
  • Constraints belong on the column, not in a separate migration. NOT NULL, DEFAULT, REFERENCES go on the ALTER TABLE ADD COLUMN line.
Show full SKILL.md (381 more words)Show less
FTS5 trigger sync — the easy-to-miss bit

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:

  1. Add the column to the 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.
  2. Update all three triggers to reference the new column.

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.

Verify the migration applies cleanly
go test ./pkg/store/... -run TestMigrate    # must pass
go test ./...                                # full suite picks up schema drift

Quick reference

Workflow 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 ./...

Common mistakes

  • 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.
  • Naming the const qInsertSomething when it's an UPDATE. The verb has to match the SQL operation. Reviewer-grep relies on it.
  • Adding a column without an index, then querying it. SQLite does table scans on un-indexed columns. If your new method's WHERE clause filters on the column, add CREATE INDEX IF NOT EXISTS in the same migration.
  • Touching 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.
  • Forgetting 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.
  • Using 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.

Cross-references

  • .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

Files

Just SKILL.md in .claude/skills/add-store-query of radimsem/remindb.

Open the folder on GitHubat commit 977b31c

Compare with similar skills

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.

Add Store Query compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Store Query this skillradimsem/remindb129—~2kAutomated safety check: PassMIT
Cursor BYOK Database Schemaleookun/cursor-byok3.2k—~1.3kAutomated safety check: PassMIT
Postgrestimescale/pg-aiguide1.9k—~941Automated safety check: PassApache-2.0
Database MigrationRain-kl/OpenFlare288—~1.3kAutomated safety check: PassApache-2.0
Database MarchatCod-e-Codes/marchat137—~985Automated safety check: PassMIT
Evolving The Data ModelTriliumNext/Trilium38k—~2.1kAutomated safety check: PassAGPL-3.0

Similar skills

  • 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.

    3.2k GitHub stars~1.3k tokensUpdated 9 days ago
    DatabasesAuto-check passed
  • Postgres

    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.

    1.9k GitHub stars~941 tokensUpdated 5 days ago
    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
  • Evolving The Data Model

    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…

    38k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated yesterday
    DatabasesAuto-check passed

More from radimsem/remindb

All 11 skills in this repo
  • remindb Memory Writer

    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.

    129 GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed
  • remindb Read Path

    radimsem/remindb

    Covers the read-side tools of the remindb MCP server, a SQLite-backed agent memory, for orienting, searching, resyncing and tracing relations.

    129 GitHub stars~2.7k tokensUpdated 2 mo ago
    Auto-check passed
  • 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.

    129 GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • 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.

    129 GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • 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.

    129 GitHub stars~1.8k tokensUpdated 2 mo ago
    Auto-check passed
  • 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.

    129 GitHub stars~2.1k tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Add Store Query

What does Add Store Query do?

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/.

When should I use Add Store Query?

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.

How do I install Add Store Query in Claude Code?

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.

How do I install Add Store Query in Codex?

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.

Can I use Add Store Query 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 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.

What does Add Store Query need to run?

Going by SKILL.md and its folder, Add Store Query needs the command-line tools its instructions call (go and git).

Does Add Store Query access the network?

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.

Is Add Store Query 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 Add Store Query use?

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.

How many tokens does Add Store Query use?

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.

What are the alternatives to Add Store Query?

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.

Who maintains Add Store Query?

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.