name: cv-db-rebuild
prettier-ignore
description: Rebuild cv-agent.db from CV copy files, sources.md, and ccrecall databases. Use when database is lost, corrupted, or needs full reconstruction.
CV Agent Database Rebuild
Reconstruct data/cv-agent.db from source files using
mcp-sqlite-tools.
Quick Start
- Open/create DB:
open_databaseat/home/scott/repos/cv/data/cv-agent.db - Create schema (see references/schema.sql)
- Populate from sources (see references/data-sources.md)
- Build FTS5 search index across all tables
- SCP to prod (see memory/MEMORY.md for push process)
Table Population Order
- profile — from
src/lib/copy/basics.md++layout.svelte - roles — from
src/lib/copy/work.md,early-webdev-exp.md,non-webdev-exp.md - achievements — from
src/lib/copy/work.mdhighlights +memory/sources.md - projects — from
src/lib/copy/projects.md+memory/sources.mdGitHub stars - skills — from
src/lib/copy/skills.mdwith evidence strings - events — from
memory/sources.mdspeaking section - content_stats — from
memory/sources.mdFathom/blog/GitHub stats - qa_pairs — curate ~25-30 recruiter Q&A pairs across categories: about, skills, experience, community, projects, logistics
- work_evidence — aggregate stats from ccrecall databases (see references)
- search_index — FTS5 index across ALL content from ALL tables
Critical Rules
- Use mcp-sqlite-tools for all DB operations
- ALWAYS checkpoint WAL before SCP push: mcp-sqlite-tools uses WAL
mode. Edits go to
.db-wal, not the main file. RunPRAGMA wal_checkpoint(TRUNCATE)before any file-based transfer. - Push process: stop container → SCP → delete WAL/SHM on prod → start
- XtendOps ccrecall (
~/Downloads/ccrecall.db) contains customer PII — extract AGGREGATE stats ONLY - Personal ccrecall (
~/.claude/ccrecall.db) — per-project session counts, tools, date ranges - Use en-GB spellings throughout
- After rebuild, verify with:
SELECT COUNT(*) FROM search_index(expect ~140 rows)
References
- schema.sql — Full table DDL
- data-sources.md — Where each table's data comes from