Slim always-on agent docs, default to toju-app plus targeted electron, and add HANDOFF.md plus a Cursor rule so long chats reset cleanly without agents opening new chats. Co-authored-by: Cursor <cursoragent@cursor.com>
4.7 KiB
AGENTS.md
Keep this file small. Detail lives in linked docs — load those only when the task needs them.
Session handoff (new chats)
Agents cannot open a new Cursor chat. To reset context:
- Write/update
agents-docs/HANDOFF.md(Status: active) — see.cursor/rules/handoff.mdc. - Ask the user to start a new chat and attach
@agents-docs/HANDOFF.md.
At session start: if agents-docs/HANDOFF.md has Status: active, read it first and continue Next steps. Do not redo Completed work.
Default work scope (token fence)
Unless the user explicitly expands scope, stay inside:
toju-app/(primary)electron/— targeted only (desktop shell is coupled to the client; see below)- CI:
.gitea/workflows/ - Agent/docs as needed: this file,
agents-docs/(index-first / handoff),toju-app/CONTEXT.md;electron/CONTEXT.mdonly when touching Electron
Electron — relevant files only
electron/ is in default scope because the renderer talks to it via preload/IPC/local DB. Do not browse the whole tree.
When a toju-app change needs the desktop bridge:
- Start from the renderer call site (
window.api/ Electron bridge usage). - Open only the matching surface: usually
electron/preload.ts, then the specific handler underelectron/ipc/,electron/cqrs*, or the one module/entity/migration involved. - Prefer ripgrep with path
electron/+ a concrete symbol over listing directories. - Skip unrelated areas (
electron/api/docs server,game-detection/,update/, other migrations, etc.) unless the bug points there.
Still out of scope by default (do not search/read/edit unless the user names them):
server/,e2e/,website/,docs-site/- Root noise:
dist*/,node_modules/,images/,project-files/,test-results/
If the root cause looks like server/ or e2e-only, ask once instead of exploring those trees.
Search with path filters. Prefer toju-app/src/app/domains/<name>/ over repo-wide greps.
Session start (cheap bootstrap)
- Skim this file.
- If handoff
Status: active→ readagents-docs/HANDOFF.md. - Open
agents-docs/LESSONS-INDEX.mdonly — match tags; open matching bodies inLESSONS.md. - Read
toju-app/CONTEXT.mdfor client work;electron/CONTEXT.mdonly if this task touches Electron. - Other docs on demand only.
Models: use the latest problem-solving model the user selected. Save tokens with scope, handoffs, and short chats — not by silently downgrading model quality.
Do not auto-read: ENGINEERING.md, AGENTS_FEATURES.md, FEATURES.md, CONTEXT-MAP.md, full AGENT_WORKFLOW.md, feature docs, ADRs — unless needed.
On-demand: agents-docs/AGENT_WORKFLOW.md, AGENTS_FEATURES.md, FEATURES.md, ENGINEERING.md, AGENTS_CONTEXT.md, AGENTS_ADRS.md, BUG_TRACKER.md.
MetoYou / Toju: desktop-first P2P chat. Default surface: Angular client (toju-app/) + targeted Electron bridge + CI.
CRITICAL — Done means the asked behavior works
Unit/spec green is support, not done.
- Restate acceptance in one sentence.
- Prove the behavior (user-visible path, focused test at the right level, or explicit manual check).
- Prefer a regression that fails if the asked behavior regresses.
Test-backed development (balanced)
For domain/logic: failing behavior-level test → minimal fix → green.
Skip full red-green for docs/copy/agent text, formatting, trivial wiring already covered higher up.
Do not: ship implementation-shaped mocks as the feature; stop at unit-green for product asks; run full monorepo / full e2e on every tiny change — targeted specs first.
Lint / type correctness (scoped)
- Targeted Vitest under
toju-app/(and colocated Electron specs only if you changed those files). npm run lint— fix errors; do not paste entire lint logs into the chat.npm run buildwhen client types/templates could break;npm run build:electrononly if you changed Electron sources.
Do not run cd server && npm run build or npm run test:e2e unless scope expanded or the bug is proven there.
Feature docs
Internal domain changes → toju-app/src/app/domains/<name>/README.md.
IPC/preload/WS contract changes → agents-docs/features/<slug>.md when that contract actually changed.
Completion checklist
- Asked behavior proven (not only unit tests green)
- Stayed in scope (
toju-app+ targetedelectron+ CI) unless user expanded it - Appropriate targeted tests for logic changes
- Lint/build only for touched packages
- Docs only if contracts changed
- Lesson + index entry if corrected this session
- If the thread is long and work remains: write
HANDOFF.mdand ask user for a new chat - PR when requesting merge (
Fixes #<n>/Relates to #<n>)