IMPORTANT: GitHub CLI is READ-ONLY
- DO NOT comment on, close, or modify GitHub issues
- DO NOT use commands like
gh issue comment,gh issue close,gh pr comment, etc. - ONLY use
gh issue list,gh issue view,gh pr list,gh pr viewfor reading - After implementing fixes, inform the user so they can manage the issue themselves
- Build:
cargo build - Run:
cargo run - Test:
cargo test(run all tests) orcargo test <test_name>(single test) - Check:
cargo check(fast type checking without compilation) - Clippy:
cargo clippy(linting) - Quality Gate: Every work item must pass
cargo fmt --check,cargo clippy, and tests before it is considered done
- Language: Rust 2024 edition
- Error Handling: Use
anyhow::Resultfor functions,anyhow::Contextfor error context - Imports: Group by std → external crates → internal modules, separated by blank lines
- Types: Prefer explicit types on public APIs; use
pubfields for simple data structs - Naming:
snake_casefor variables/functions,PascalCasefor types/enums,SCREAMING_SNAKE_CASEfor constants - String Handling: Use
.to_string()for owned strings,&strfor borrowed; trim user input - Time Format: Use
timecrate (TimePointformat:HH:MM, validates 0-23h, 0-59m) - Serialization: Use
serdewithSerialize/Deserializederives; pretty-print JSON withserde_json::to_string_pretty - State Management: Mutable methods on structs (e.g.,
&mut self); validate before mutating - UI Pattern: Separate state (
app_state.rs) from rendering (render.rs); use ratatui widgets - Module Structure: Each module exports types via
pub useinmod.rs - Data Storage: SQLite database (
work-tuimer.db) in app data dir, keep legacy JSON files on disk after migration