reactive-sqlite-ui

A set of patterns for building desktop screens whose data comes from SQLite, a small database stored with the application, and updates when that data changes. It covers lists, selected items, forms, writes, and loading states.

In plain words
What is it for?
Use it when building or reviewing SQLite-backed screens with live queries, selected records, editable detail panes, and create or update forms.
Why use it?
It prevents duplicate database subscriptions, flickering detail views, and form drafts being reset whenever live data updates. It also keeps saved data separate from temporary edits made in a form.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fastrepl/anarlog/reactive-sqlite-ui
Any agent
npx skills add fastrepl/anarlog --skill reactive-sqlite-ui
Clone the repo
git clone --depth 1 https://github.com/fastrepl/anarlog

Made for: Claude Code, Codex.

Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 586 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00053 $0.00586
Opus 5 $0.00026 $0.00293
Sonnet 5 $0.00011 $0.00117
Haiku 4.5 $0.00005 $0.00059

Measured 2d ago against content hash 308e0c09a79a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

reactive-sqlite-ui scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/reactive-sqlite-ui/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Goal

Use SQLite live queries as the screen data source without duplicating subscriptions, fighting the reactivity model, or making selection and form state unstable.

Patterns

1. Screen Boundary Query

  • Subscribe once per resource domain at the screen boundary.
  • Pass derived data downward.
  • Open another live query only when the child truly needs different data.
const items = useItems();
const selectedItem = items.find((item) => item.id === selectedId) ?? null;

2. Selection Is UI State

  • Keep selection in tab/zustand/local UI state as an id or index.
  • Do not model selection as a second live query.
  • Resolve the selected item from the already-loaded collection when possible.

3. Detail Pane From Snapshot

  • Pass the selected object into detail components.
  • Key detail forms by entity id only when you want local state reset on entity switch.
  • Preserve visible data across normal selection changes.

This is the main anti-flicker pattern.

4. Forms Own Draft State

  • Reactive query data is the source for persisted state.
  • The form owns draft state while editing.
  • Reset form state when the entity changes, not on every reactive payload.

5. Writes Flow One Way

  • Reads: useDrizzleLiveQuery(db.select()...)
  • Imperative reads: helper/query outside the render path
  • Writes: db.insert, db.update, db.delete inside useMutation
  • Let SQLite change notifications update subscribed UI

Do not add manual invalidation unless the write affects data outside the subscribed query graph.

6. Loading States Are Scoped

  • Show loading UI for initial screen load.
  • Do not blank the detail pane for ordinary selection changes.
  • Prefer preserving previous data until the next snapshot when query args change frequently.

Anti-Patterns

  • Parent list query plus child selected-row query for the same table
  • Child components that take id and immediately subscribe again
  • Resetting detail data to undefined during normal selection changes
  • Form resets tied to every incoming reactive payload
  • Mixing imperative local cache invalidation with SQLite live-query updates

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 75 lines · 53 tokens per session scan A 308e0c09a79a

Subscribe to this mod's changes

reactive-sqlite-ui is a skill published in the GitHub repository fastrepl/anarlog (9,219 stars, last pushed today), licensed MIT. It adds 53 tokens to every session and 586 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

shellx-host

ShellX host-session manifest. Use only when the current prompt or runtime metadata positively identifies this session as running inside ShellX, when ShellX host tools are advertised, or when the user explicitly asks about ShellX host APIs or surfaces. Do not use merely because this skill is installed, a project…

martinsbrezauckis/shellx · 89 tokens

design-language

Use when building, modifying, or fixing any frontend UI in the Asyar launcher — new components, new views, layout changes, styling decisions, new built-in features, visual bug fixes, and anything in settings or onboarding. Answers "what do I use here?" for fonts, colour, typography, spacing, motion, components, and…

Xoshbin/asyar · 72 tokens

architectural-integrity

Use before planning or implementing ANY feature, bug fix, refactor, or API change that touches Asyar's architecture — extension system, service layer, IPC contracts, Tauri commands, manifest contributions, or cross-layer data flow. Triggers on new features, new extension APIs, new services, bug fixes involving…

Xoshbin/asyar · 176 tokens

generated-files

Never hand-edit or hand-copy generated content. Use when touching permissions.rs, error.rs, AppError/SearchError variants, runtimes/catalog.fallback.json, any #[derive(specta::Type)] struct, any file with an AUTO-GENERATED banner (kinds.ts, gatedPermissions.ts, knownRuntimes.ts, bindings.ts, emoji data), or whenever…

Xoshbin/asyar · 95 tokens

dev-environment

Reference for the Asyar monorepo structure, SDK workspace linking, lockfile discipline, CI workflows, and release flow. Use this skill whenever working on anything related to pnpm workspace setup, the asyar-sdk dependency, lockfile errors, SDK or launcher version bumps, CI configuration, release workflow, or questions…

Xoshbin/asyar · 113 tokens

review-ipc

Audit IPC message contracts between extensions and the Asyar host. Use when adding a new SDK service, adding a new proxy method, changing a postMessage type string, or reviewing permission gate coverage.

Xoshbin/asyar · 43 tokens