Contributing to Hivelore
July 2, 2026 · View on GitHub
Thanks for helping. This guide is written so that anyone — not just the original author — can build, test, extend, and release Hivelore. Reducing the bus-factor is an explicit goal: if you can follow this file end to end without asking a human, it is doing its job. Open an issue if a step is unclear.
Prerequisites
- Node 20 LTS+ and
pnpm9+ (the repo pinspnpm@9.14.2viapackageManager). - This is a pnpm workspace monorepo — always run package scripts through pnpm, never
npm.
git clone https://github.com/Doucs91/hivelore.git
cd Hivelore
pnpm install
pnpm -r build # build every package (topological order via workspace deps)
pnpm -r test # run all suites (vitest)
pnpm -r typecheck # tsc --noEmit across packages
Repository map
| Path | What lives here |
|---|---|
packages/core | Pure domain layer. Schemas, scoring/ranking, parsers, path resolution, sensors, eval math, code-map. No I/O beyond the memory loader, no CLI/MCP imports. Put deterministic logic here first. |
packages/cli | commander CLI. One file per subcommand in src/commands/, registered on the root program. Keep command files thin: parse options → resolve root → call core/MCP → print. |
packages/mcp | MCP server (stdio). Tool handlers in src/tools/ are pure (input, ctx) async functions; server.ts is the registry. |
packages/embeddings | Optional local semantic search (Transformers.js, bge-small-en-v1.5). EmbedderLike is injectable for tests. |
packages/vscode | VS Code extension (surfaces memories + cockpit over the CLI). |
packages/github-action | PR-comment action that posts relevant team memories. |
.ai/ | Hivelore's own knowledge base (it dogfoods itself). Decisions, gotchas, conventions, and failed attempts live here as Markdown — read them; they explain why the code is shaped the way it is. |
The golden rule of layering
Heavy logic (ranking, matching, scoring, parsing) goes in @hivelore/core where it is unit-testable
without stdio or a git repo. CLI and MCP only orchestrate it. See the team memory
2026-06-02-architecture-core-pure-domain-layer and 2026-06-02-architecture-cli-command-surface.
How to add things
A new CLI command
- Create
packages/cli/src/commands/<name>.tsexporting aregister<Name>(program)function. - Register it in
packages/cli/src/index.ts. - If it is part of the day-to-day loop, add it to
CORE_ROOT_COMMANDS(and updateSTABILITY.md). Otherwise it stays behind--advancedautomatically.
A new MCP tool
- Add
packages/mcp/src/tools/<name>.tsas a pure(input, ctx)handler. - Wire it in
packages/mcp/src/server.ts(three lines: import, schema, registration). - Add it to the right profile constant (
ENFORCEMENT_PROFILE_TOOLS/MAINTENANCE_…/EXPERIMENTAL_…). Tools inenforcementare the stable surface — hold that bar.
A new executable sensor type or matcher
Sensors live in packages/core/src/sensors.ts (pure) and are surfaced via hivelore sensors and the
enforce check gate. Diff scanning must use scannableSensorTargets / isSensorScannablePath so it
never self-fires on .ai/ or generated bridge files.
Testing & quality bar
- Every behavioural change ships with a vitest test, preferably at the
corelayer. pnpm -r test,pnpm -r typecheck, andpnpm -r buildmust all be green before you push.node scripts/verify-build-artifacts.mjschecks the published bundles.hivelore evalruns the retrieval + sensor quality gate; CI fails on a regression.
Release protocol (maintainers)
See CLAUDE.md for the full multi-agent git-sync protocol. In short:
- Commit your work on a branch; open a PR.
- Bump the version only if shippable code changed (
@hivelore/core/cli/mcp/embeddings); docs/.ai//CI-only changes ship without a bump. Patch by default; minor for features. - Keep all four packages in lockstep; create the matching
vX.Y.Ztag. - Push code and that tag:
git push && git push origin vX.Y.Z(nevergit push --tags). - Wait for every GitHub Actions run on HEAD to pass.
npm publishis done only by a human maintainer — agents never publish.
Knowledge protocol (why .ai/ matters)
Hivelore uses Hivelore. When you discover a non-obvious trap, make a real decision, or hit a dead end, capture
it (hivelore memory save / hivelore memory tried). This is how the project stays understandable without a
single person holding all the context in their head — the whole point of the product.