Routa.js is a workspace-first multi-agent coordination platform with two runtime surfaces:
- Web: Next.js app and API in
src/ - Desktop: Tauri app in
apps/desktop/backed by Axum incrates/routa-server/
The project is intentionally not "two separate products". Web and desktop differ in deployment model and storage, but they are expected to preserve the same domain semantics, API shape, and agent-coordination behavior.
docs/ARCHITECTURE.md: Canonical architecture boundaries, domain model, protocol stack, and cross-backend invariants.docs/adr/: Durable architectural decisions. Start here for "why".docs/design-docs/: Human-reviewed design intent and normalized decisions migrated from.kiro/specs/.
- General coding style guidance lives in
docs/coding-style.md; keep this file focused on routing and repo-level guardrails. - Source of truth for executable gates is
docs/fitness/+entrix; do not restate tool-level checks here. - Frontend and desktop API calls in
src/appandsrc/clientshould useresolveApiPath+desktopAwareFetchfor统一的后端路径组装:resolveApiPath(src/client/config/backend.ts):统一补全/api前缀并在需要时拼接后端 base URL。desktopAwareFetch(src/client/utils/diagnostics.ts):在 Tauri 桌面静态运行时自动落到http://127.0.0.1:3210或配置的后端地址。- 避免在前端/桌面再次直接写
fetch('/api/...')。
- For long behavior-heavy files, prefer orchestration shell + domain hooks over UI-only slicing.
- Apply the same pattern to oversized API routes: thin top-level route, extract workflow branches (session creation, streaming, provider dispatch, etc.).
- Split route refactors by workflow branch before shared helpers; avoid premature generic
utils. - Before large behavior refactors, add or extend characterization tests that lock routing/lifecycle/persistence/recovery behavior.
- All UI-facing strings must go through the i18n system (e.g.,
t('key')). Do not hardcode English or Chinese literals in components.
- Use
agent-browser(or Electron/browser skills) for manual walkthroughs and visual evidence capture. - Use Playwright e2e for automated UI coverage.
- Tauri UI smoke path:
npm run tauri dev, then validate viahttp://127.0.0.1:3210/. - If Tauri routes look wrong, verify fallback mapping in
crates/routa-server/src/lib.rsand placeholders inout/workspace/__placeholder__/. - For large or cross-core changes, run graph probes first:
entrix graph impact,entrix graph test-radius, orentrix graph review-context. - Temporary frontend debug
console.logis allowed during diagnosis; remove all debug logs before finish. - Shared repo-level agent skills live under
.agents/skills/. The canonical release automation skill is.agents/skills/release/and should be invoked as/release.
Before PR, run entrix using docs/fitness/README.md as canonical rulebook.
entrix run --dry-run
entrix run --tier fast
entrix run --tier normal # when behavior/shared modules/APIs/workflow orchestration changed- If a check fails, fix and re-run; do not skip.
- Skip source-code validation only when changes are strictly non-code (
*.md,*.yml,*.yaml,.github/,docs/, etc.). - Build if needed:
cargo build -p entrix.
- One commit = one concern (feature, fix, or refactor) with Conventional Commits format.
- No kitchen-sink commits; split mixed concerns.
- Target budget: under 10 files and under 1000 changed lines per commit.
- Include related GitHub issue ID when applicable.
- If closing an issue in commit text, verify against
mainfirst:gh issue view <issue-id>. - Always add co-author information.
- Only ONE co-author line is allowed. If multiple agents contributed, aggregate into ONE entry
Format example:
Co-authored-by: ()
Valid examples (choose EXACTLY ONE):
Co-authored-by: Kiro AI (Claude Opus 4.6) kiro@kiro.dev Co-authored-by: GitHub Copilot Agent (GPT 5.4) 198982749+copilot@users.noreply.github.com Co-authored-by: QoderAI (Qwen 3.5 Max) qoder_ai@qoder.com Co-authored-by: gemini-cli (...) 218195315+gemini-cli@users.noreply.github.com Co-authored-by: Codex (GPT 5.4) codex@openai.com
- For UI-affecting changes, include browser screenshots or recordings in PR body (prefer
agent-browsercaptures). - Attach e2e screenshots/recordings when available.
- Before creating a new issue, search
docs/issues/for existing incident context. - For non-trivial failures, create/update
docs/issues/YYYY-MM-DD-short-description.mdfirst (focus on WHAT/WHY), then escalate to GitHub. - Use one canonical active local tracker per problem. If you need supporting material, record it as a non-issue note via
kind: analysis,kind: progress_note, orkind: verification_reportinstead of opening another active tracker for the same problem. - Use
kind: github_mirroronly for GitHub-synced mirror files. Those mirrors are reference material, not canonical active local trackers. - If a local record tracks a GitHub issue, populate
github_issue,github_state, andgithub_urlso issue review can detect status drift automatically. - When resolved, update the local issue record and close the GitHub issue.
- Run issue hygiene/garbage collection at least once every 7 days. Track the last sweep time in
docs/issues/issue-gc-state.yaml(last_reviewed_at). - If
last_reviewed_atis 7+ days old when an agent reads this contract, the agent should invokeAskUserQuestionfirst: whether to run issue sync/cleanup now. - After finishing an issue GC pass, update
docs/issues/issue-gc-state.yamlwith the newlast_reviewed_at.
docs/product-specs/FEATURE_TREE.md: Auto-generated product and API surface index. Start here for route and endpoint discovery.docs/exec-plans/active/: Short-lived implementation plans for in-flight work.docs/exec-plans/completed/: Archived plans that reflect what shipped.docs/exec-plans/tech-debt-tracker.md: Cross-cutting debt ledger.docs/issues/: Incident and repro records. Capture WHAT happened and WHY it mattered.docs/fitness/: Executable quality/testing/contract rulebook consumed byentrix.docs/coding-style.md: Canonical coding style guidance for Rust, TypeScript/frontend, naming, and testing preferences.docs/REFACTOR.md: Long-file refactor playbook.docs/references/: Distilled external references for frequent dependencies.docs/release-guide.md: Full release guide for CLI/Desktop/distribution.docs/RELEASE_CHECKLIST.md: Quick release checklist.crates/entrix/: Entrix runtime and CLI implementation.
When starting work on this repository, read in this order:
docs/ARCHITECTURE.md— runtime topology and boundaries.docs/adr/README.md— decision index, then relevant ADRs.docs/fitness/README.md— quality gates and verification flow.- Task-specific files in
docs/design-docs/ordocs/exec-plans/.
