- Keep fast unit tests inline with
mod tests {}; put multi-crate checks intests/ortest_*.sh. - Scope runs with
cargo test -p crate test; add regression coverage for new failure modes.
- Profile first (
cargo bench,cargo flamegraph,perf) and land only measured wins. - Borrow ripgrep tactics: reuse buffers with
with_capacity, favor iterators, reach formemchr/SIMD, and hoist allocations out of loops. - Apply inline directives sparingly—mark tiny wrappers
#[inline], keep cold errors#[cold], and guard cleora-stylerayon::scopeloops with#[inline(never)]. - Prefer zero-copy types (
&[u8],bstr) and parallelize CPU-bound graph work withrayon, feature-gated for graceful fallback.
- Use Conventional Commit prefixes (
fix:,feat:,refactor:) and keep changes scoped. - Ensure commits pass
cargo fmt,cargo clippy, requiredcargo test, and desktop checks. - PRs should explain motivation, link issues, list manual verification commands, and attach UI screenshots or logs when behavior shifts.
Keep secrets in 1Password or .env. Use build-env.sh or scripts/ helpers to bootstrap integrations, and wrap optional features (openrouter, mcp-rust-sdk) with graceful fallbacks for network failures.