AGENTS.md - Miro PDF Viewer Development Guide
Build/Test Commands
cargo build- Build the projectcargo run- Run the applicationcargo test- Run all testscargo test <test_name>- Run a specific testcargo check- Check code without building, use this before each build since it is a lot faster
Code Style Guidelines
- Use
snake_casefor variables, functions, and modules - Use
PascalCasefor types, structs, enums, and traits - Prefer explicit types over
auto/inference when clarity improves - Use
anyhow::Resultfor error handling with context - Import organization: std first, external crates, then local modules
- Use
#[derive(Debug)]on all structs and enums - Prefer
matchoverif letfor complex pattern matching - Use
constfor compile-time constants (e.g.,const MOVE_STEP: f32 = 40.0) - Use
staticwithLazyLockfor global state (e.g.,CONFIG) - Implement
Defaulttrait where appropriate - Use
EnumStringderive for string-to-enum conversion - Prefer
PathBufover&strfor file paths - Use
tokio::syncprimitives for async communication - Structure modules with
mod.rsfiles for organization - Use the
debug!,info!anderror!fromtracingfor printing and logging
Development Process Guidelines
- Don't run the graphical application unless absolutely necessary. Prefer writing tests to answer your questions instead if possible
- Prefer
cargo checkas a first layer of validating your code - Run
cargo testafter you are done with each task to ensure that you haven't introduced any regressions