Thanks for your interest in contributing. This guide covers everything you need to get started.
# Clone the repo
git clone https://github.com/ProductionLineHQ/cortex.git
cd cortex
# Install dependencies (requires pnpm 9+)
pnpm install
# Build all packages
pnpm build
# Run the test suite
pnpm test
# Start the dev server (daemon + dashboard with hot reload)
pnpm devRequirements: Node.js 18+, pnpm 9+.
This is a pnpm monorepo managed with Turborepo. Here are the packages:
| Package | Path | What it does |
|---|---|---|
@cortex.memory/shared |
packages/shared |
Shared types, schemas (Zod), constants, utilities |
@cortex.memory/server |
packages/server |
MCP server, REST API (Fastify), quality gate, summarizer, SQLite |
@cortex.memory/cli |
packages/cli |
CLI tool (33 commands), project detection, daemon management |
dashboard |
packages/dashboard |
Next.js 14 web dashboard (localhost:7433) |
desktop |
packages/desktop |
SwiftUI native macOS app |
electron |
packages/electron |
Electron desktop app (cross-platform) |
vscode |
packages/vscode |
VS Code extension |
installer |
packages/installer |
Homebrew formula, install scripts |
web |
packages/web |
Marketing site |
# Build everything first
pnpm build
# Start the daemon in dev mode (auto-restarts on changes)
pnpm --filter @cortex.memory/server dev
# In a separate terminal, start the dashboard
pnpm --filter dashboard dev
# The MCP server runs on localhost:7434
# The dashboard runs on localhost:7433To test the full flow with Claude Code, register the dev MCP server:
# Point Claude Code to your local dev server
pnpm --filter @cortex.memory/cli dev -- init --dev# Run all tests
pnpm test
# Run tests for a specific package
pnpm --filter @cortex.memory/server test
# Run tests in watch mode
pnpm --filter @cortex.memory/server test -- --watch
# Run tests with coverage
pnpm test:coverageWe use Vitest. Tests live next to the code they test (*.test.ts).
We use Conventional Commits. Every commit message must follow this format:
type(scope): description
[optional body]
Types: feat, fix, docs, style, refactor, perf, test, chore, ci
Scope is the package name without the org prefix: server, cli, shared, dashboard, vscode, electron.
Examples:
feat(cli): add cortex history command
fix(server): handle empty memory content in quality gate
docs(readme): update install instructions for Windows
refactor(shared): extract memory type validation to separate module
-
Open an issue first for anything non-trivial. This lets us discuss the approach before you write code. Bug fixes and typo corrections can skip this step.
-
Fork and branch. Create a branch from
mainwith a descriptive name:feat/history-command,fix/quality-gate-empty-content. -
Write tests. New features need tests. Bug fixes need a test that would have caught the bug.
-
Run the checks before pushing:
pnpm lint pnpm typecheck pnpm test -
Open the PR. Fill out the PR template. Link to the issue. Describe how to test it.
-
Respond to review. We aim to review PRs within 48 hours. Push changes as new commits, not force-pushes, so reviewers can see what changed.
- TypeScript strict mode. No
anyunless absolutely necessary and justified in a comment. - ESM imports only. No CommonJS
require(). - Zod for all runtime validation (API inputs, config files, MCP tool parameters).
- Small, pure functions. If a function does more than one thing, split it.
- No abbreviations in variable names.
memoryContentnotmemCont.
ESLint and Prettier configs are provided. Run pnpm lint before committing. Your editor should pick up the config automatically.
For anything that changes the public API, the data model, or the architecture:
- Open a GitHub issue describing the problem and your proposed solution.
- Wait for a maintainer to respond. We will discuss trade-offs and agree on an approach.
- Once agreed, reference the issue in your PR.
This prevents surprises and duplicate work. Small fixes, documentation improvements, and test additions do not need this process.
Open a GitHub Discussion or file an issue. We respond to everything.