Agent skill

Migrate To Sqlite

by fastrepl in fastrepl/anarlog

Migrate a TinyBase table to SQLite. An agent skill from fastrepl/anarlog.

MITAuto-check passedDatabases

Install Migrate To Sqlite

skills CLI
$ npx skills add fastrepl/anarlog --skill migrate-to-sqlite -a claude-code

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

GitHub CLI
$ gh skill install fastrepl/anarlog migrate-to-sqlite --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/fastrepl/anarlog.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/migrate-to-sqlite .claude/skills/migrate-to-sqlite && 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
migrate-to-sqlite
GitHub stars
9.5k
Token cost
~2.1k tokens
SKILL.md length
963 words
Files
1
Skills in repo
32
Repo updated
First seen
Licence
MIT

At a glance

Migrate a TinyBase table to SQLite. An agent skill from fastrepl/anarlog.

  • Works in 10 steps: Decouple consumers → Swap storage per domain → Rust migration → …
  • Asked to move a data domain (e.g
  • SKILL.md covers Status, Strategy, Architecture and Per-domain steps (Phase 1)
  • Calls pnpm, cargo and npx

What it does

Migrate To Sqlite is an agent skill from fastrepl/anarlog. Migrate a TinyBase table to SQLite. Use when asked to move a data domain (e.g. templates, vocabs) from the TinyBase store to the app SQLite database.

Its SKILL.md is about 2.1k 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. It works with SQLite and Rust. The repository describes itself as: Open source Granola AI Alternative. The licence is MIT.

When your agent uses it

  • Asked to move a data domain (e.g

Example prompts

  • “/migrate-to-sqlite”

Requirements

  • Node.js

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Decouple consumers
  2. Swap storage per domain
  3. Rust migration
  4. Rust ops (optional but recommended)
  5. Legacy data import
  6. Drizzle schema
  7. Swap hook internals
  8. Shadow bridge (skip for leaf-clean domains)
  9. Remove TinyBase artifacts
  10. Verify

What it can do on your machine

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

    • pnpm
    • cargo
    • npx

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm and npx, 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

Migrate To Sqlite loads about 2.1k tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 963 words of instructions outside code blocks.

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

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 fastrepl/anarlog at commit 385e117, republished under its MIT licence (© fastrepl). 963 words, ~2,092 tokens.

Download SKILL.mdSave it as .claude/skills/migrate-to-sqlite/SKILL.md (or your agent's skills folder).
name
migrate-to-sqlite
description
Migrate a TinyBase table to SQLite. Use when asked to move a data domain (e.g. templates, vocabs) from the TinyBase store to the app SQLite database.
metadata.internal
true

Status

Keep up to date as each PR lands. Outer box = fully done across both phases. Sub-bullets track sub-states where relevant.

This migration targets the TinyBase main store only. The separate TinyBase settings store is out of scope unless the plan is explicitly expanded to include it.

  • templates — already Drizzle, no Phase 0 needed
  • calendars
    • Phase 0 reads (PR 2: useCalendar, useEnabledCalendars)
    • Phase 0 writes — services/calendar/ctx.ts has a cross-domain calendars+events transaction; lands with events PR
    • Phase 1 — Rust migration + ops exist
  • events
    • Phase 0
    • Phase 1 — Rust migration + ops exist
  • sessions
  • transcripts
  • humans
  • organizations
  • enhanced_notes
    • Phase 0 reads — session/hooks/useEnhancedNotes.ts
    • Phase 0 writes
    • Phase 1
  • mapping_session_participant
  • mapping_tag_session
  • mapping_mention
  • tags
  • chat_groups
  • chat_messages
  • session_key_facts
  • tasks
  • daily_notes
    • Phase 0 writes (partial) — chat/store/*
    • Phase 0 reads
    • Phase 1
  • tasks
  • memories
    • Phase 0 writes — settings/memory/custom-vocabulary.tsx
    • Phase 0 reads
    • Phase 1
  • daily_notes

Strategy

Two-phase, per-domain migration. Each phase is many small PRs.

Phase 0 — Decouple consumers

Before any storage swap, move every TinyBase call behind a domain hook living in apps/desktop/src/<domain>/hooks.ts (or <domain>/hooks/*). Hook return shapes are plain TypeScript; no TinyBase types leak out. Consumer code stops importing ~/store/tinybase/store/main.

Scope note: this applies to consumers of ~/store/tinybase/store/main and the legacy ~/store/tinybase/hooks barrel. Do not start wrapping settings.UI.* usage behind new hooks as part of this effort; ~/store/tinybase/store/settings is intentionally out of scope for this migration.

Why: one storage-swap PR per domain touches 1 file (the hook module), not 20–50 consumer files.

Enforced by anlg/no-raw-tinybase in eslint-plugin-anlg.mjs. .oxlintrc.json keeps a TINYBASE_MIGRATION_PENDING override that shrinks as each domain is cleaned. CI gates this via .github/workflows/lint.yaml.

Phase 1 — Swap storage per domain
  1. Rust migration + ops + Drizzle schema (steps below).
  2. Flip writes in the hook module: db.insert()/update()/delete().
  3. Shadow-hydrate TinyBase from SQLite so read hooks that haven't moved yet keep working. A small adapter subscribes to db-live-query and mirrors rows into the in-memory TinyBase store. One-way only: SQLite is the source of truth.
  4. Swap read hooks to useDrizzleLiveQuery one at a time. Consumers untouched because hook signatures are stable.
  5. Once no TinyBase consumers remain for the domain, remove the shadow adapter, the TinyBase schema entries, and the persister.

Skip the shadow bridge only for leaf-clean domains (no cross-table indexes/queries into or out of the domain, and <10 consumer sites).

Architecture

  • Schema source of truth: Rust migration in crates/db-app/migrations/
  • Drizzle mirror: packages/db/src/schema.ts (typed TS query interface, not schema management)
  • Reads (reactive): useDrizzleLiveQuery — calls .toSQL() on a Drizzle query, feeds {sql, params} to the underlying useLiveQuery which uses subscribe() from @anlg/plugin-db
  • Reads (imperative): db.select()... through the Drizzle sqlite-proxy driver
  • Writes: db.insert(), db.update(), db.delete() through the Drizzle sqlite-proxy driver, wrapped in useMutation from tanstack-query
  • Reactivity loop: write via execute → SQLite change → Rust db-live-query notifies subscribers → useLiveQuery fires onData → React re-renders. No manual invalidation needed.
Package layers

The DB stack uses a factory/DI pattern across four packages:

  1. @anlg/db-runtime (packages/db-runtime/) — type contracts only: LiveQueryClient, DrizzleProxyClient, shared row/query types.
  2. @anlg/db (packages/db/) — Drizzle schema (schema.ts) + createDb(client) factory using drizzle-orm/sqlite-proxy. Re-exports Drizzle operators (eq, and, sql, etc.).
  3. @anlg/db-tauri (packages/db-tauri/) — Tauri-specific client that binds execute/executeProxy/subscribe from @anlg/plugin-db to the db-runtime types.
  4. @anlg/db-react (packages/db-react/) — createUseLiveQuery(client) and createUseDrizzleLiveQuery(client) factories.

These are wired together in apps/desktop/src/db/index.ts, which exports db, useLiveQuery, and useDrizzleLiveQuery. Consumer code imports from ~/db, not directly from the packages.

Per-domain steps (Phase 1)

Assumes Phase 0 already landed for this domain — consumers go through <domain>/hooks.ts, not raw UI.*.

Show full SKILL.md (391 more words)Show less
1. Rust migration

Add a new timestamped .sql file in crates/db-app/migrations/. Convention: YYYYMMDDHHMMSS_name.sql.

Do NOT include user_id columns — it was a TinyBase-era pattern with a hardcoded default. It will be redesigned when multi-device/team support lands.

Add <domain>_types.rs and <domain>_ops.rs in crates/db-app/src/ with typed sqlx::FromRow structs and CRUD functions. Export from lib.rs. These are used by other Rust code and legacy import; the TS side uses Drizzle instead.

3. Legacy data import

If the domain had a TinyBase JSON persister file (e.g. templates.json), add an import function in plugins/db/src/migrate.rs that reads the old file and upserts rows. Call it from plugins/db/src/runtime.rs during startup. Guard with an "already imported" check (e.g. table non-empty).

4. Drizzle schema

Add the table definition to packages/db/src/schema.ts mirroring the migration. Use { mode: "json" } for JSON text columns, { mode: "boolean" } for integer boolean columns. Re-export from packages/db/src/index.ts if adding new operator re-exports.

5. Swap hook internals

Replace the hook module's TinyBase calls with Drizzle. Hook signatures stay the same, so consumer code doesn't change.

  • useDrizzleLiveQuery(db.select()...) for reactive reads
  • db.select()... for imperative reads (returns parsed objects via proxy driver)
  • db.insert(), db.update(), db.delete() for writes, wrapped in useMutation

Import db and useDrizzleLiveQuery from ~/db, and schema tables/operators from @anlg/db.

Live query results come from Rust subscribe as raw objects (not through the Drizzle driver), so mapRows must handle two things:

  • JSON parsing for JSON text columns (e.g. sections_json, targets_json).
  • snake_case → camelCase mapping. Live rows use the raw SQLite column names (pin_order, targets_json), while Drizzle's $inferSelect uses camelCase (pinOrder, targetsJson). Define a separate <Domain>LiveRow type with snake_case keys for mapRows, distinct from the Drizzle inferred type. See TemplateLiveRow in apps/desktop/src/templates/queries.ts for the pattern.
6. Shadow bridge (skip for leaf-clean domains)

Add a small module that hydrates the TinyBase <domain> table from SQLite on startup and subscribes to db-live-query to mirror subsequent changes. One-way: SQLite → TinyBase. Retire once all consumers have swapped.

7. Remove TinyBase artifacts
  • Table definition from packages/store/src/tinybase.ts
  • Query definitions from store/tinybase/store/main.ts (both QUERIES object and _QueryResultRows type)
  • Persister files (e.g. store/tinybase/persister/<domain>/)
  • Persister registration from store/tinybase/store/persisters.ts
  • Hooks from store/tinybase/hooks/ if they existed
  • Shadow-bridge module if one was added
  • Associated tests and test wrapper setup
8. Verify
  • cargo check and cargo test -p db-app -p tauri-plugin-db
  • pnpm -F @anlg/desktop typecheck
  • pnpm -F @anlg/desktop test
  • npx oxlint --quiet apps/desktop/src/ (the anlg/no-raw-tinybase CI gate)
  • pnpm exec dprint fmt

© fastrepl, 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/migrate-to-sqlite of fastrepl/anarlog.

Open the folder on GitHubat commit 385e117

Compare with similar skills

Migrate To Sqlite 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.

Migrate To Sqlite compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Migrate To Sqlite this skillfastrepl/anarlog9.5k—~2.1kAutomated safety check: PassMIT
Rust Heavy Performanceveloxbase/veloxdb646—~733Automated safety check: PassMIT
Cdphuoshen80/ReinaManager693—~178Automated safety check: PassAGPL-3.0
Hydra Architectstreamband/hydra-srt146—~1.2kAutomated safety check: PassApache-2.0
Database Opsbkywksj/knowledge-base330—~1.9kAutomated safety check: PassCustom licence
Golem Add Sqlite Rustgolemcloud/golem1.5k—~1kAutomated safety check: PassCustom licence

Similar skills

  • Rust Heavy Performance

    veloxbase/veloxdb

    Enforces a Rust-first approach for heavy work in VeloxDB so expensive compute stays in Tauri/Rust instead of JavaScript.

    646 GitHub stars~733 tokensUpdated 7 days ago
    DatabasesAuto-check passed
  • Cdp

    huoshen80/ReinaManager

    通过 CDP 连接 ReinaManager WebView2,复现、诊断并验证真实应用的前端问题。仅在用户显式调用 /cdp 或 $cdp 进行前端调试时使用。

    693 GitHub stars~178 tokensUpdated 4 days ago
    DatabasesAuto-check passed
  • Hydra Architect

    streamband/hydra-srt

    A skill your agent uses when designing or evolving Hydra platform architecture across Elixir/Phoenix, SQLite, VictoriaMetrics/VictoriaLogs analytics, native/Rust, and runtime boundaries.

    146 GitHub stars~1.2k tokensUpdated 21 days ago
    DatabasesAuto-check passed
  • Database Ops

    bkywksj/knowledge-base

    Tauri 本地数据库操作技能,使用 rusqlite 进行 SQLite 数据库操作. An agent skill from bkywksj/knowledge-base.

    330 GitHub stars~1.9k tokensUpdated 5 days ago
    DatabasesAuto-check passed
  • Golem Add Sqlite Rust

    golemcloud/golem

    Use embedded SQLite from a Rust Golem agent with rusqlite and the WASI VFS.

    1.5k GitHub stars~1k tokensUpdated today
    DatabasesAuto-check passed
  • Nxv

    utensils/nxv

    Find any version of any Nix package across nixpkgs git history using the nxv CLI or HTTP API.

    136 GitHub stars~7.9k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes

More from fastrepl/anarlog

All 32 skills in this repo
  • But

    fastrepl/anarlog

    Use only in the Anarlog repository when the active checkout branch is exactly gitbutler/workspace.

    9.5k GitHub stars~5.8k tokensUpdated today
    Auto-check passed
  • Create PRs

    fastrepl/anarlog

    Use only in the Anarlog repository when the active checkout branch is exactly gitbutler/workspace.

    9.5k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Fix Ready PRs

    fastrepl/anarlog

    Inspect every open non-draft PR for CI failures and unresolved Cursor Bugbot findings, then fix them on the existing PR branches.

    9.5k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • No Use Effect

    fastrepl/anarlog

    Avoid direct React useEffect usage when writing or reviewing React components and hooks.

    9.5k GitHub stars~825 tokensUpdated today
    Auto-check passed
  • QA Critical UX

    fastrepl/anarlog

    QA Anarlog's critical Pro user journey on a signed staging candidate — onboarding, responsive launch, microphone and system-audio capture, automated summaries, and cloud sync.

    9.5k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Reactive Sqlite UI

    fastrepl/anarlog

    Build SQLite-backed reactive UI in apps/desktop using stable patterns for reads, selection, forms, writes, and loading states.

    9.5k GitHub stars~699 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Migrate To Sqlite

What does Migrate To Sqlite do?

Migrate a TinyBase table to SQLite. An agent skill from fastrepl/anarlog. Migrate To Sqlite is an agent skill from fastrepl/anarlog. Migrate a TinyBase table to SQLite.

When should I use Migrate To Sqlite?

Migrate To Sqlite fits situations like: asked to move a data domain (e.g.

How do I install Migrate To Sqlite in Claude Code?

Run `npx skills add fastrepl/anarlog --skill migrate-to-sqlite -a claude-code`. Or copy the skill folder (.agents/skills/migrate-to-sqlite in fastrepl/anarlog) into .claude/skills/migrate-to-sqlite in your project. Claude Code loads it when a task matches its description.

How do I install Migrate To Sqlite in Codex?

Run `npx skills add fastrepl/anarlog --skill migrate-to-sqlite -a codex`. Or copy the skill folder (.agents/skills/migrate-to-sqlite in fastrepl/anarlog) into .agents/skills/migrate-to-sqlite in your project. Codex loads it when a task matches its description.

Can I use Migrate To Sqlite 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 fastrepl/anarlog --skill migrate-to-sqlite -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/migrate-to-sqlite, .gemini/skills/migrate-to-sqlite, .github/skills/migrate-to-sqlite and .opencode/skills/migrate-to-sqlite in your project.

What does Migrate To Sqlite need to run?

Going by SKILL.md and its folder, Migrate To Sqlite needs the command-line tools its instructions call (pnpm, cargo and npx). Our summary lists: Node.js.

Does Migrate To Sqlite access the network?

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

Is Migrate To Sqlite 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 Migrate To Sqlite use?

Migrate To Sqlite 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 Migrate To Sqlite use?

About 2.1k tokens (SKILL.md is roughly 8.4k 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 Migrate To Sqlite?

Skills that share tags, products or a category with Migrate To Sqlite: Rust Heavy Performance (veloxbase/veloxdb, 646 stars), Cdp (huoshen80/ReinaManager, 693 stars), Hydra Architect (streamband/hydra-srt, 146 stars) and Database Ops (bkywksj/knowledge-base, 330 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Migrate To Sqlite?

fastrepl (a GitHub organization) maintains it in fastrepl/anarlog, which has 9,452 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 8, 2026.

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