An opinionated cargo-generate template for Rust projects.
cargo generate gh:mlavrinenko/cratemplate
# or using nix:
nix run nixpkgs#cargo-generate -- generate --git https://github.com/mlavrinenko/cratemplateYou'll be prompted for project name, description, and license.
- Rust 2024 edition with strict clippy lints
- Error handling with
anyhow+thiserror - CLI support via
clap - Nix flake dev environment (rustc, cargo, clippy, rustfmt, just, rust-analyzer, etc.)
Justfilewith common recipes (just check,just test,just cover, etc.)- Code coverage via
cargo-tarpaulin(70% minimum) - File size limits enforced via linecop (500 lines for Rust, 200 for Markdown)
ejectestfor inline tests extractionAGENT.mdwith rules for LLM coding agents
After making changes to the template, validate that it still produces a working project:
just validateThis generates a project in a temp directory and runs fmt, clippy, tests, build, coverage, and file size checks against it.