Portable session context for AI coding agents (this repo dogfoods its own philosophy).
npm run build- compile TypeScript todist/(tsc, NodeNext ESM)npm test- vitest suite (unit + e2e against real temp git repos)npm run typecheck- strict tsc checknode dist/cli.js <cmd>- run the CLI locally
src/git.ts- git state capture.parsePorcelainis pure; never trim porcelain output (leading space = unstaged marker)src/snapshot.ts-buildMarkdown(pure renderer of HANDOFF.md) +runTestssrc/sync.ts- managed-block upsert into agent files; never destroys user content outside<!-- handoff:start/end -->src/commands/*- thin command handlers calling the above
- Node >= 18, strict TS with
noUncheckedIndexedAccess, ESM with explicit.jsimport suffixes - Two runtime dependencies only (
commander,picocolors) - do not add more without discussion - All new logic: pure function + unit test first
- Unit tests live beside
test/*.test.ts; e2e creates real temp git repos (auto-configures identity) - Never write outside the OS temp dir in tests