Thank you for considering contributing! This is a generic Rust project template.
- Rust stable (see
rust-toolchain.tomlfor exact version) cargo-nextest—cargo install cargo-nextestcargo-deny—cargo install cargo-denycargo-audit—cargo install cargo-audit
git clone https://github.com/d-oit/rust-2026-template.git
cd rust-2026-template
cargo buildAlways run before pushing:
bash scripts/quality-gates.shThis runs: cargo fmt --check, cargo clippy, cargo nextest run, cargo audit, cargo deny check.
| Type | Pattern | Example |
|---|---|---|
| Feature | feat/description |
feat/add-async-support |
| Bug fix | fix/description |
fix/clippy-warnings |
| Docs | docs/description |
docs/update-readme |
| Refactor | refactor/description |
refactor/workspace-layout |
Use Conventional Commits:
feat(crate-name): add feature X
fix: resolve clippy warning in lib.rs
docs: update AGENTS.md with new skill
chore(deps): bump serde from 1.0.195 to 1.0.196
- Format:
cargo fmt(enforced by CI) - Lint:
cargo clippy -- -D warnings(zero warnings policy) - Shell Lint:
shellcheckfor all scripts inscripts/(enforced by CI) - Edition: Rust 2024
- MSRV: 1.88 (see
rust-toolchain.toml)
- Use
cargo nextest runfor all tests - Unit tests live in
#[cfg(test)]modules in source files - Integration tests live in
crates/<name>/tests/ - All public items must have doc tests or unit tests
- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make changes and run quality gates
- Commit using Conventional Commits format
- Push and open a PR against
main - Wait for CI to pass (all green required)
- Request review
-
cargo fmt --checkpasses -
cargo clippy -- -D warningspasses -
cargo nextest runpasses -
cargo auditshows no vulnerabilities -
cargo deny checkpasses - Coverage targets met (as defined in
.codecov.yml) - Documentation updated if API changed
-
CHANGELOG.mdupdated -
shellcheckpasses for all shell scripts
Workspace-level lints (Cargo.toml) set the default for all crates.
Individual crates may relax specific lints in their own [lints.clippy]
section when there is a documented reason. Never use #[allow(...)]
attributes in source code — this is enforced by allow_attributes = "deny".
We use cargo-release for version management and cargo-dist for artifact generation.
- Ensure you are on the
mainbranch and it's up to date. - Run
cargo release <patch|minor|major>to prepare the release.- This will run quality gates (via
scripts/pre-release-hook.sh), bump versions, update the changelog (viagit-cliff), and create a tag.
- This will run quality gates (via
- Push the tag to trigger the GitHub Actions release workflow.
cargo release patch --execute
git push --tagsThis is a generic Rust template, not a standalone application. Changes should:
- Remain generic and reusable for any Rust project
- Not add application-specific logic
- Keep the
example-crateas a minimal, illustrative placeholder - Be documented in
CHANGELOG.md
If your organization uses this template across multiple repos, configure .agents/context/ to share conventions and skill sources:
external-repos.json— Links to related repositories for agent discoveryshared-conventions.md— Cross-repo coding standards (commits, branches, quality)
Agents in derived repos automatically apply these shared conventions. See QUICKSTART.md for setup instructions.
Every publishable crate must define an include whitelist in its Cargo.toml
to prevent internal files (plans, agent docs, scripts, CI config) from ending up in
the published package. The template already sets this up via [workspace.package]:
include = ["/src", "README.md", "LICENSE"]When you create a new crate, verify the publish surface is correct:
cargo package --list -p your-crateThe output should not contain plans/, agents-docs/, scripts/, .github/,
.agents/, or .opencode/. See
Cargo manifest include field
for details.
Open an issue at: https://github.com/d-oit/rust-2026-template/issues
For security vulnerabilities, see SECURITY.md.