Last updated: 2026-06-10
Project: Documents/knoter
Language for this file: English
This is the root routing guide for agent work in the knoter monorepo. It is
intentionally short. Package-specific instructions are authoritative for their
own areas and must be read before changing code in those areas.
Before doing package-specific work, read the matching guide:
- CLI/MCP/indexing/search/agent-queue work:
cli/agents.md - Web/frontend/Electron work:
web/agents.md
If a task touches both packages, read both guides before planning or editing. When package guides conflict, follow the guide for the files being changed. For cross-package behavior, preserve the stricter constraint unless the user explicitly approves a different direction.
| Path | Role |
|---|---|
cli/ |
Bun/TypeScript CLI: vault management, indexing, agent work queue, search, launchd scheduling. |
web/ |
React/Vite HTML workbench renderer plus Electron development shell with CLI/fs-backed IPC. |
res/templates/ |
Vault seed content: workflow contract + per-artifact templates (markdown + default HTML). |
docs/ |
Shared architecture, codebase, planning, and testing documentation. |
testdata/ |
Markdown fixture corpus for manual smoke runs. |
README.md |
Root project overview. |
Read the smallest relevant set under docs/ before larger changes:
docs/architecture.md— product model and boundary source of truth.docs/codebase.md— code reading entry point for both packages.docs/testing.md— verification commands, config files, manual smoke flow.docs/plan/progress.md— implemented current state and verification baseline.docs/plan/roadmap.md— active decisions and P0–P2 planned work.res/templates/workflow.md— the agent workflow contract seeded into every vault'stemplates/workflow.mdbykn vault init. It is runtime content, not prose documentation; changing it changes agent behavior for new vaults.
- Keep changes scoped to the user's request.
- Prefer existing patterns and local helper APIs over new abstractions.
- Do not rewrite architecture or user decisions without explicit approval.
- Update shared docs when behavior or contracts change across packages.
- Run the narrowest relevant verification first, then broaden when touching shared behavior, persistence, storage, retrieval, or UI interaction.
- Never claim verification that was not actually run. If a command cannot run, document the reason.
- Branch model (current): single long-lived branch
dev.devis the default branch and the only long-lived branch. There is nomainfor now; a stable/release branch may be reintroduced later.- Topic branches start from
devand merge back intodevthrough a PR (use a local--no-ffmerge when working without the remote). - Topic branch names are free-form. Prefix grouping such as
features/<name>,webs/<name>,backs/<name>,refactoring/<name>is a useful convention, not a requirement.
- Do not use branch names under
dev/...when a local or remotedevbranch exists. Git refs cannot cleanly contain bothdevanddev/<name>at the same time. - Branch new work from
devunless the user explicitly approves a different base. Continue on an existing active topic branch when it already matches the requested work. - Keep CLI and web implementation commits on separate topic branches unless the change is inherently cross-package.
- Commit related changes in small, reviewable units after appropriate
verification. Documentation-only commits usually need a read-through and
git diff --check. - Before committing, check the active branch and working tree with
git branch --show-currentandgit status --short --branch. - Never rewrite, reset, or discard user changes unless the user explicitly asks for that operation. If unrelated local changes are present, leave them alone.
- Do not push or delete remote branches unless the user explicitly asks.
- When branch history needs cleanup, prefer local branch correction first: create the correct branch from the intended base, cherry-pick or reapply only the required commits, verify, and ask before any destructive remote action.
- CLI-affecting changes: baseline in
cli/agents.mdplusdocs/testing.md. - Web-affecting changes: baseline in
web/agents.mdplusdocs/testing.md. - Documentation-only changes: a read-through and
git diff --checkare usually sufficient unless the edited document defines executable commands or contracts (res/templates/workflow.mdis the runtime agent contract).
- Identify the affected package or packages.
- Read this root guide and the required package guide(s).
- Read the smallest relevant docs under
docs/. - Plan the change with explicit acceptance criteria.
- Implement a minimal patch.
- Verify with package-appropriate commands.
- Report changed files, intent, risk, and exact verification results.