- Pull Requests Required: Never push new features directly to the
mainbranch. Always create a new branch and push your changes as a Pull Request (PR) for review. - Pre-PR Checks: Run
npm run lintandnpx vitest runbefore opening any PR — don't open a PR with failing checks. - Preload/Types Contract: IPC contract:
src/types.d.ts↔src/api.tsviainvoke(). Never modify these files in isolation. - Secrets Management: Never add secrets to Rust source — use keyring crate via
commands/keychain.rs.
- Zustand Slices: Zustand stores must use slice subscriptions (
state => state.x), never subscribe to the whole store. - Lazy Loading: Dynamic
import()for any dependency over 1MB unpacked — check withnpx cost-of-modulesbefore adding new deps. - Timers: No
setIntervalin renderer or main process — use targetedsetTimeoutchains or event-driven patterns.
- Security Context: Follow Tauri's strict security model. Do not enable dangerous IPC scopes unless absolutely necessary.
- IPC Types: All new IPC channels must be declared in
src/types.d.tswith proper types before use. - Asynchronous Rust: Use
tauri::command(async)for I/O bound operations in Rust to avoid blocking the main thread.
- Focused PRs: Don't refactor and add features in the same PR.
- Performance Reporting: Performance changes require a before/after bundle size comparison in the PR description (just paste the Vite build output).
- Audit Logging: Every change or significant update made must also be documented in
AUDIT_LOG.md. Log what was done, when it was done, and why.