I got tired of setting up the same things every new Rust project. Clippy config, CI pipelines, linker flags, pre-commit hooks, cargo-nextest... all from scratch, every time. And then doing it again every time I switched AI coding tools — re-explaining the project structure, the lint rules, what's off-limits.
So I built rust-2026-template. Click "Use this template", point your agent at it, and you're coding — not configuring.
Here's what's actually in it.
The setup I always end up with anyway
Rust 2024 edition, MSRV 1.87 pinned via rust-toolchain.toml. Workspace layout from day one — even for small projects. Refactoring a single-crate project into a workspace later is just pain you don't need:
crates/
example-crate/
sample-app/
Rename those, done.
One script, full quality gate
./scripts/quality-gates.sh
This runs fmt, clippy (pedantic, zero warnings), cargo nextest, cargo audit, cargo deny, and optionally cargo mutants. Same thing CI runs. I run it before every commit so there are no surprises.
Mutation testing with cargo-mutants is the one I'd push people to try — it tells you whether your tests actually catch bugs or just touch code. Very different things.
Security defaults, not an afterthought
-
deny.toml— license policy and banned crates -
.gitleaks.toml— secret scanning before anything gets committed -
.pre-commit-config.yaml— hooks run locally, not just in CI
The goal is that you never have to remember to do this. It just happens.
AI agents work out of the box
This is the part I use the most now. Every AI coding tool needs project context — and they all want it in a slightly different place. Instead of re-explaining conventions every session, it's all checked in:
.agents/ — skill definitions per agent
.claude/ — Claude Code config
.cursor/ — Cursor rules
.gemini/ — Gemini CLI config
.opencode/ — OpenCode config
.qwen/ — Qwen CLI config
.windsurf/ — Windsurf config
AGENTS.md — canonical project rules, read by every agent
llms.txt — machine-readable project overview
AGENTS.md is the key file. It tells any agent: the workspace layout, the lint rules, commit conventions, what to never touch. You switch from Claude Code to Codex to OpenCode mid-project — they all read the same rules. No re-onboarding.
When you start a new project from this template, you can also just hand the repo URL directly to your agent as context:
"Use github.com/d-oit/rust-2026-template as the reference for this project."
It'll pick up the structure, the tooling choices, and the conventions without you writing a single prompt about them.
Performance defaults you forget to add
.cargo/config.toml sets the mold linker. One line, noticeably faster incremental builds. The dev profile is tuned to avoid the "my debug build takes forever" problem. Small thing, but after six months on a project you'll notice it.
Use it
- Hit "Use this template" on GitHub — or tell your agent: use
github.com/d-oit/rust-2026-templateas the reference for this project - Follow
QUICKSTART.md— rename the crates, updateCargo.toml - Run
./scripts/quality-gates.shonce locally
MIT licensed. PRs welcome — if there's a pattern you always add to Rust projects, open an issue.
Top comments (0)