Privacy Copilot is a Rust-first local desktop app with a React/Vite frontend.
- Prefer small modules with clear ownership boundaries.
- Return
Resultfor fallible work; avoid panics in application paths. - Keep domain types explicit and boring.
- Use traits only when there is more than one implementation or a clear testing boundary.
- Do not store raw secrets in files or frontend-accessible state.
- Run
cargo fmt --all,cargo check --workspace, andcargo test --workspace.
- SOLID where it helps readability and testability.
- KISS: choose the simplest implementation that satisfies the current product need.
- YAGNI: avoid framework-level abstractions before the app has multiple real implementations.
- Local-first: user data remains local by default.
- Secure-by-default: no telemetry by default, no frontend secrets, bounded file/artifact handling.
- Keep UI state close to the component using it.
- Put desktop/Rust command access behind a small bridge layer.
- Do not use browser storage for production secrets.
- Avoid raw DOM injection and
dangerouslySetInnerHTML. - Run
npm --prefix frontend run buildbefore merging frontend changes.
- Use focused commits.
- Prefer conventional commit prefixes when practical, such as
feat:,fix:,docs:, andchore:.