<One sentence: what this CLI does.>
Stack
- Rust (edition from Cargo.toml), clap (derive) for args, anyhow for app errors, thiserror for library errors
- Tests: unit tests in modules, integration tests in
tests/with <assert_cmd + predicates>
Commands
- Build:
cargo build - Run:
cargo run -- <args> - Tests:
cargo test(one:cargo test parse_duration) - Lint:
cargo clippy --all-targets --all-features -- -D warnings - Format:
cargo fmt
Rules
- No
unwrap()/expect()in non-test code except for true invariants (with a message saying why it cannot fail). - Library code returns typed errors (
thiserror);mainand command handlers useanyhow::Resultwith.context(...). - Keep
main.rsthin: parse args, call intolib.rs, map errors to exit codes. - Output: human-readable by default,
--jsonfor machine output; errors to stderr. - Prefer borrowing over cloning; justify
clone()in hot paths. - Add
cargo clippyfixes rather than#[allow]unless there is a comment explaining why.
Definition of done
cargo fmt --check, clippy with-D warnings, andcargo testpass.