Use this file first when working in this repository. It defines the default agent workflow and points to the more specific rules and commands.
- This is the Abstand macOS desktop app repo
- Abstand is a Tauri app with a React/TanStack frontend in
apps/desktop/srcand Rust backend code inapps/desktop/src-tauri - macOS-native bridge code lives in
apps/desktop/crates/macosand its Swift sources - TypeScript workspaces are managed with pnpm and Turbo across
apps/*and any futurepackages/* - Rust workspace members live under
apps/*/src-tauri; app-local Rust crates may live under an app'scrates/* - Product concepts and language live in
docs/project-spec.mdanddocs/concepts/; use those terms when changing product behavior or UI copy
- Follow the user request and explicit task constraints first
- If a rule appears to conflict with the user's explicit request or clearly implied task goal, follow the user. Mention meaningful conflicts briefly so the rule can be improved.
- Before editing, read the matching rule from
.agent/rules/and the nearby implementation - Before product behavior, UI copy, or concept changes, read
docs/project-spec.mdand the relevant file indocs/concepts/ - Before Tauri command, database, scheduler, native bridge, or module-structure changes, read the relevant files in
docs/conventions/ - Before package-level changes, read the owning
package.json,Cargo.toml, or Tauri config and nearby tests - Prefer repository conventions and local package patterns over generic defaults
- Keep changes focused on the requested behavior. Do not do unrelated cleanup or opportunistic rewrites.
- Match surrounding style unless a local, low-risk improvement makes the edited code clearer
- Add abstractions only when they remove real complexity, reduce meaningful duplication, or match an existing pattern
- Write comments, docs, and explanations for future maintainers rather than the current session
- Treat matching rules as the target standard for new and touched code. If rules conflict, the more specific package, pattern, or framework rule wins.
- Do repo-wide cleanup only when the task explicitly calls for migration
- When reworking messy staged code, reduce the surface area before polishing it
- Treat generated or staged code as disposable draft work, not as an architecture to preserve
- Remove unused state, helpers, options, and lifecycle paths instead of routing around them
- Keep public methods returning only what callers actually need
- Do not add cancellation, notification, lifecycle, or migration machinery unless the current behavior requires it
- Inline one-off helpers that hide only a few lines; keep supporting logic close to its single consumer
- Use read-only git commands such as
git status,git diff,git log, andgit showwhen useful - Do not stage, commit, create or switch branches, push, or otherwise mutate git state unless the user explicitly asks for that specific git action
- Find the owning
package.jsonorCargo.tomlfor changed files before choosing validation - Prefer focused app checks such as
pnpm --filter @repo/desktop typecheck,pnpm --filter @repo/desktop lint,pnpm --filter @repo/desktop ui:build, orcargo test -p <crate>when the package or crate exposes them - Use Tauri or Rust checks for backend changes, and frontend checks for React/TypeScript-only changes
- Use Turbo filters or root
pnpm/cargocommands when changes cross package boundaries or shared tooling - Do not validate routine changes with browser-driven, Playwright/Cypress-style, or manual browser e2e testing unless explicitly asked. For UI-specific tasks, ask before starting a browser-based validation workflow.
- Report the checks you ran, and say clearly when a relevant check was skipped
Use the closest matching rule for the file or behavior you are changing.
- TypeScript and TSX:
.agent/rules/typescript.md - React and TSX components:
.agent/rules/react.md feature-stateandfeature-react/state:.agent/rules/feature-state.mdfeature-reactbindings and forms:.agent/rules/feature-react.md*Cx.tsfeature context pattern:.agent/rules/cx-pattern.md- General code style:
.agent/rules/style-guide.md - Comments:
.agent/rules/comments.md - Writing style (prose, READMEs, commit messages):
.agent/rules/writing.md tuple-result:.agent/rules/tuple-result.md- Vitest tests:
.agent/rules/vitest.md - Rust:
.agent/rules/rust.md - Swift and SwiftUI:
.agent/rules/swift.md
Commands are reusable workflows. Use them when the user asks for that workflow.
- Review staged changes before committing:
.agent/commands/review.md