This file is the stable, always-on contract for contributors and coding agents.
Keep durable repository rules here; implementation details belong beside the
code they describe or in maintained documents under docs/**.
- Keep Kode terminal-native, fast, and predictable.
- Prefer intent-driven workflows with verifiable outcomes over setup menus.
.kode/**is the canonical write surface;.claude/**is read/import compatibility only.- Keep compatibility aliases in
packages/core/src/compat/**.
apps/cli/: CLI entrypoints, commands, and Ink TUI.apps/server/: local daemon and Web UI host.apps/web/: React/Vite Web UI source.packages/core/: orchestration, permissions, model wiring, and sessions.packages/tools/: built-in tool definitions and implementations.packages/runtime/: shell/runtime primitives and background tasks.packages/config/: configuration, schemas, and data roots.packages/protocol/: session and transport protocols.packages/client/: daemon client helpers.packages/builtin-skills/: skills shipped in the npm package.
bun install --frozen-lockfile
bun run format:check
bun run architecture:check
bun run security:audit
bun run typecheck
bun test
bun run buildRun the smallest relevant check while iterating; run the full sequence before a
release. Do not commit generated output (dist/**, wrappers, Web UI builds,
platform binaries, coverage, or node_modules/**).
- UI belongs in
apps/cli/src/ui/**orapps/web/**. - Orchestration belongs in
packages/core/**. - Tool behavior belongs in
packages/tools/**and must remain permission-aware. - OS/process behavior belongs in
packages/runtime/**. - Protocol and persisted formats must not depend on a UI host.
Do not add a new seam for a hypothetical implementation. When a seam is real, keep transport and host adapters outside the owning domain module.
- Keep refactors, behavior changes, formatting, and generated artifacts separate.
- Add regression tests when changing persistence, permissions, protocols, or compatibility behavior.
- Tool descriptions may be async; callers must await function-valued descriptions.
- Subagents inherit the parent permission context and command constraints.
- Runtime-required knowledge belongs in
packages/builtin-skills/skills/**, not developer documentation.
For a tool:
- Add it under
packages/tools/src/tools/<domain>/<ToolName>/. - Define its schema, prompt, permission behavior, and implementation.
- Register it in
packages/tools/src/registry.ts. - Add focused tests through its public behavior.
For a CLI command:
- Add it under
apps/cli/src/commands/**. - Register it in
apps/cli/src/commands/registry.ts. - Verify help text, non-interactive behavior, and permission handling.
Publishing is CI-only. Merge a reviewed version bump, then push an annotated
v<package.json version> tag. Stable versions publish under latest;
prerelease versions publish under dev. See
docs/develop/releasing.md. Never publish from a
developer workstation.