Development
Install dependencies
Section titled “Install dependencies”npm installnpm install installs the repo hook path. .githooks/pre-commit runs npm run precommit, and .githooks/commit-msg enforces Conventional Commits 1.0.0.
Do not use git commit --no-verify or any equivalent bypass.
Run checks
Section titled “Run checks”Full precommit suite:
npm run checkThis runs:
- docs checks with
docs:check: generated surface-reference freshness, generated code-map freshness, internal docs links/sidebar routes, packaged Markdown links, GitHub Pages base-prefixed docs links, and docs-site build - formatting with
oxfmt - type-aware linting with
oxlint tsgotypecheck- Vitest suite
Critical-path coverage gate:
npm run check:coverageSecondary TypeScript compiler check:
npm run typecheck:tscUseful targeted checks:
npm run formatnpm run lintnpm run typechecknpm testnpm test -- tests/queue.test.tsRun Pi locally
Section titled “Run Pi locally”pi -e ./extensions/index.tsOr install the checkout path:
pi install /path/to/pi-hindsightDocumentation architecture
Section titled “Documentation architecture”Use docs/documentation-architecture.md as the migration map for documentation-site work, navigation changes, generated reference placement, and archive decisions.
Work tracking
Section titled “Work tracking”Use GitHub Issues as the project task ledger. Backlog items, current work, blockers, decisions, and follow-ups should be visible in issues or issue comments. Do not rely on local scratch files, chat-only plans, or private harness TODOs as the source of truth for project work.
When a report or review creates actionable work, turn accepted items into issues and remove or archive the scratch file after the issues carry the work.
Coverage gates
Section titled “Coverage gates”Critical-path coverage thresholds are configured in vitest.config.ts for:
- queue
- queue lock
- JSONL queue store
- import Modules
- config Modules
- lifecycle Modules
- transport Modules
Live smoke
Section titled “Live smoke”For memory-path behavior changes, prove the live path with a configured Hindsight server:
export HINDSIGHT_BASE_URL=http://localhost:8888# export HINDSIGHT_API_KEY=... # if needednpm run smoke:hindsightThe GitHub Hindsight Integration workflow also runs live smoke when configured. An unconfigured workflow skip is not proof for memory-path changes.
Source-of-truth order
Section titled “Source-of-truth order”- Official Hindsight docs and API behavior
- Official Pi extension/session/package docs
- This repository’s PRD, plans, ADRs,
CONTEXT.md,AGENTS.md, andCONTRIBUTING.md - Public reference repos as implementation inspiration only
- User notes and gists as hypotheses only
Definition of done
Section titled “Definition of done”A change is done only when:
- it follows official Hindsight memory rules;
- it uses documented Pi extension hooks;
- tests cover changed logic;
- user-visible behavior is documented if changed;
- the diff is minimal and focused; and
- no new memory anti-pattern is introduced.
Changelog and releases
Section titled “Changelog and releases”CHANGELOG.md is generated from Conventional Commits. The normal release path is release-please: it opens a release PR that updates version metadata and the changelog, then creates the tag and GitHub release after merge.
Local fallback:
npm run changelogThe version script also regenerates and stages CHANGELOG.md during npm version. Use these scripts for inspection or emergency manual releases, not as the normal source of truth. Do not hand-edit generated release entries as the source of truth.