npm install
npm test # Jest — all specs against in-memory SQLite
npm run dev # wrangler dev — local Worker with local D1For the deploy spec add:
DEPLOY_URL=https://cassini-mission-plan.redfour.workers.dev npm test- TypeScript, strict mode, no
any. SeeCLAUDE.mdfor the full ruleset. - No comments that restate what the code does — only comment the why when it would surprise a reader.
- Every query uses prepared statements with bound params. No SQL string concatenation.
- New tools follow the established pattern: zod schema → query function in
src/db/queries.ts→ handler registered insrc/tools/index.ts.
Open an issue first for anything non-trivial. For small fixes, a PR is fine directly. Use Conventional Commits:
feat(timeline): add day-level bucket granularity
fix(search): handle quote characters in FTS MATCH query
docs: update deploy steps for wrangler v4
Types: feat, fix, chore, docs, refactor, test, perf.
The spec suite is in spec/. Each spec drives the real default.fetch entry point via an in-memory SQLite store injected at the Db boundary — no mocks that bypass production code paths. Keep it that way.
Run the full suite before submitting:
npm test
npx tsc --noEmit