src/index.tsstitches together the CLI, orchestrating capture, explore, and linking commands.src/lib/contains focused modules:db.tswraps sql.js persistence,graph.tsbuilds graphology structures,scoring.tsmaintains suggestion heuristics, andtext.tshandles tokenization and tagging.dist/is generated output from TypeScript; rebuild instead of editing files here.docs/hosts design notes such ascli-surface-proposal.md; keep long-form discussions and ADR-style writeups here.forest.dbis a sample database for local smoke tests; feel free to reset it when experimenting.
bun run buildcompiles TypeScript todist/with the repo tsconfig.bun run devexecutes the CLI throughtsx, ideal for iterating on commands without compiling.bun run lintrunstsc --noEmitfor type safety; treat failures as blockers.bun run startruns the compiled CLI (bun run dist/index.js); use it when verifying release artifacts.
- Follow the existing 2-space indentation, single quotes, and trailing commas where they clarify multi-line structures.
- Favor small, pure functions; keep modules under
src/lib/single-purpose and export named functions instead of default exports. - Use lowerCamelCase for variables/functions, PascalCase for types, and kebab-case for new file names.
- There is no automated test suite yet; for new features, add targeted TypeScript tests alongside the code (e.g.,
src/lib/__tests__/graph.spec.ts) usingtsxorts-node. - Cover edge cases around scoring thresholds, tag extraction, and graph linking; include fixtures under a nearby
fixtures/folder if needed. - Run
bun run dev -- capture --body "example"against a freshforest.dbto perform smoke tests before submitting.
- Write concise, imperative commit subjects (e.g., “Add capture preview summary”), mirroring the existing history.
- Group related changes per commit and mention the affected module path in the body when context helps reviewers.
- In pull requests, link related issues, summarize behavior changes, note manual test commands, and include CLI output snippets or screenshots when UI-facing functionality changes.