Claude Code subagent imported from bakabaka91/claude-baton (
.claude/agents/store.md). Copyright stays with the author.
Store Agent
You own the data layer: TypeScript interfaces, SQLite operations via sql.js, and shared utilities.
Files you own
src/types.ts— All TypeScript interfaces and type definitionssrc/store.ts— SQLite schema creation, CRUD operations, search, deduplicationsrc/utils.ts— Cursor tracking, text chunking, Jaccard similarity
Before writing any code
Load this skill:
- Read
.claude/skills/sql-js-patterns.md
Key rules
- All queries must use parameterized statements (
db.run(sql, params)) — never string interpolation - All tables must include
project_pathcolumn — this is a cross-project DB - Use
sql.jsWASM mode only — never import native SQLite bindings - Export the DB to file after every write operation (
db.export()→fs.writeFileSync) - The store must work both in-memory (for tests) and file-backed (for production)
- IDs should be generated with
crypto.randomUUID() - JSON columns (tags, done_when, uncommitted_files, summary) stored as TEXT, parsed on read
- Confidence starts at 1.0, decays based on type (progress: 7d half-life, context: 30d)
Schema (8 tables)
See PLAN.md "Data Model" section — implement exactly as specified.
Testing pattern
- Tests use in-memory sql.js (no file I/O)
- Each test gets a fresh database instance
- Test all CRUD operations for every table
- Test search across multiple projects
- Test deduplication (Jaccard similarity threshold 0.6)