It also covers supply-chain policy as code — committing deny.toml, centralizing dependency
versions in [workspace.dependencies] rather than pinning per member — and auxiliary tooling
like cargo hack (feature-powerset checks) and cargo machete (unused-dependency pruning).
Out of scope: writing the tests themselves (unit/integration/proptest/criterion) belongs to
rust-testing-quality; non-Rust CI pipelines are not covered.
Rust Tooling & CI/CD
Agent Workflow (MANDATORY)
Before ANY tooling/CI work, spawn 3 agents in parallel, one Agent call each with a name:
- fuse-ai-pilot:explore-codebase - Inspect existing
Cargo.toml, workspace layout, .github/workflows
- fuse-ai-pilot:research-expert - Verify current cargo / cargo-deny / nextest docs via Context7/Exa
- mcp__context7__query-docs - Check workspace-inheritance and feature-unification specifics
After implementation, run fuse-ai-pilot:sniper for validation.
Overview
| Layer |
Tool(s) |
Purpose |
| Layout |
Cargo workspaces |
One Cargo.lock, one target/, shared metadata |
| Config |
features, workspace.dependencies |
Optional functionality, single source of versions |
| Format/lint |
cargo fmt, cargo clippy |
Style + correctness lints, warnings as errors |
| Supply chain |
cargo deny, cargo audit |
Licenses, bans, duplicate/yanked/vulnerable crates |
| Test |
cargo nextest, cargo test --doc |
Fast parallel run + doc-tests |
| Coverage/MSRV |
cargo llvm-cov, cargo hack |
Line coverage, minimum-supported-Rust matrix |
Critical Rules
- Gate order is fixed - fmt → clippy → deny → audit → nextest →
test --doc → coverage. Cheap, fast-failing checks run first.
-D warnings on clippy in CI - cargo clippy --all-targets --all-features -- -D warnings. A warning must fail the build.
- Commit
deny.toml - supply-chain policy is code; it must be reviewed and versioned.
- Centralize versions in
workspace.dependencies - members inherit with dep.workspace = true; never pin the same crate twice.
cargo test --doc is a separate step - nextest never runs doc-tests (see rust-testing-quality).
Architecture
my-workspace/
├── Cargo.toml # [workspace] members + workspace.dependencies + lints
├── Cargo.lock # single lockfile, committed
├── deny.toml # supply-chain policy, committed
├── crates/
│ ├── core/Cargo.toml # inherits version.workspace = true
│ └── cli/Cargo.toml
└── .github/workflows/ci.yml
→ See ci-workflow.md and deny-toml.md
Reference Guide
Concepts
| Topic |
Reference |
When to Consult |
| Workspaces & features |
workspaces-features.md |
Structuring members, inheriting deps, feature design, MSRV |
| CI gate |
ci-gate.md |
Ordering checks, cargo-deny/audit, coverage |
Templates
| Template |
When to Use |
| ci-workflow.md |
GitHub Actions pipeline |
| deny-toml.md |
Supply-chain policy + workspace root |
Quick Reference
The full local gate
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo deny check
cargo audit
cargo nextest run --all-features
cargo test --doc
cargo llvm-cov --all-features --workspace
Workspace dependency inheritance
# root Cargo.toml
[workspace.dependencies]
serde = { version = "1", features = ["derive"] }
# member Cargo.toml
[dependencies]
serde = { workspace = true }
→ See deny-toml.md for the complete root manifest
Best Practices
DO
- Fail fast: run
fmt and clippy before the expensive test/coverage steps
- Keep one
[workspace.dependencies] as the version source of truth
- Run
cargo hack --feature-powerset check to catch broken feature combinations
- Run
cargo machete to prune unused dependencies
DON'T
- Let clippy warnings pass CI (use
-D warnings)
- Duplicate crate versions across members instead of inheriting
- Skip
cargo deny because "audit already ran" — they check different things
- Forget
cargo test --doc after nextest
1---2name: rust-tooling-cicd3description: Use when structuring a Cargo workspace or building a Rust CI pipeline — fmt, clippy, cargo-deny/audit, nextest, coverage, MSRV. Not for writing the tests themselves (rust-testing-quality).4versions:5 cargo: "1.9x (edition 2024)"6 cargo-deny: "0.16"7 cargo-nextest: "0.9"8user-invocable: false9references: references/workspaces-features.md, references/ci-gate.md, references/templates/ci-workflow.md, references/templates/deny-toml.md10related-skills: rust-testing-quality, solid-rust11metadata:12 source: https://skillmd.com/skills/fusengine/rust-tooling-cicd13---1415<objective>16This skill covers structuring Cargo workspaces (member layout, workspace.dependencies17inheritance, feature design, MSRV) and building the canonical Rust CI gate: fmt → clippy18(-D warnings) → cargo deny → cargo audit → nextest → cargo test --doc → coverage, in that19fixed order so cheap checks fail fast.2021It also covers supply-chain policy as code — committing deny.toml, centralizing dependency22versions in [workspace.dependencies] rather than pinning per member — and auxiliary tooling23like cargo hack (feature-powerset checks) and cargo machete (unused-dependency pruning).2425Out of scope: writing the tests themselves (unit/integration/proptest/criterion) belongs to26rust-testing-quality; non-Rust CI pipelines are not covered.27</objective>2829# Rust Tooling & CI/CD3031## Agent Workflow (MANDATORY)3233Before ANY tooling/CI work, spawn 3 agents in parallel, one `Agent` call each with a `name`:34351. **fuse-ai-pilot:explore-codebase** - Inspect existing `Cargo.toml`, workspace layout, `.github/workflows`362. **fuse-ai-pilot:research-expert** - Verify current cargo / cargo-deny / nextest docs via Context7/Exa373. **mcp__context7__query-docs** - Check workspace-inheritance and feature-unification specifics3839After implementation, run **fuse-ai-pilot:sniper** for validation.4041---4243## Overview4445| Layer | Tool(s) | Purpose |46|-------|---------|---------|47| **Layout** | Cargo workspaces | One `Cargo.lock`, one `target/`, shared metadata |48| **Config** | features, `workspace.dependencies` | Optional functionality, single source of versions |49| **Format/lint** | `cargo fmt`, `cargo clippy` | Style + correctness lints, warnings as errors |50| **Supply chain** | `cargo deny`, `cargo audit` | Licenses, bans, duplicate/yanked/vulnerable crates |51| **Test** | `cargo nextest`, `cargo test --doc` | Fast parallel run + doc-tests |52| **Coverage/MSRV** | `cargo llvm-cov`, `cargo hack` | Line coverage, minimum-supported-Rust matrix |5354---5556## Critical Rules57581. **Gate order is fixed** - fmt → clippy → deny → audit → nextest → `test --doc` → coverage. Cheap, fast-failing checks run first.592. **`-D warnings` on clippy in CI** - `cargo clippy --all-targets --all-features -- -D warnings`. A warning must fail the build.603. **Commit `deny.toml`** - supply-chain policy is code; it must be reviewed and versioned.614. **Centralize versions in `workspace.dependencies`** - members inherit with `dep.workspace = true`; never pin the same crate twice.625. **`cargo test --doc` is a separate step** - nextest never runs doc-tests (see rust-testing-quality).6364---6566## Architecture6768```69my-workspace/70├── Cargo.toml # [workspace] members + workspace.dependencies + lints71├── Cargo.lock # single lockfile, committed72├── deny.toml # supply-chain policy, committed73├── crates/74│ ├── core/Cargo.toml # inherits version.workspace = true75│ └── cli/Cargo.toml76└── .github/workflows/ci.yml77```7879→ See [ci-workflow.md](references/templates/ci-workflow.md) and [deny-toml.md](references/templates/deny-toml.md)8081---8283## Reference Guide8485### Concepts8687| Topic | Reference | When to Consult |88|-------|-----------|-----------------|89| **Workspaces & features** | [workspaces-features.md](references/workspaces-features.md) | Structuring members, inheriting deps, feature design, MSRV |90| **CI gate** | [ci-gate.md](references/ci-gate.md) | Ordering checks, cargo-deny/audit, coverage |9192### Templates9394| Template | When to Use |95|----------|-------------|96| [ci-workflow.md](references/templates/ci-workflow.md) | GitHub Actions pipeline |97| [deny-toml.md](references/templates/deny-toml.md) | Supply-chain policy + workspace root |9899---100101## Quick Reference102103### The full local gate104105```bash106cargo fmt --all -- --check107cargo clippy --all-targets --all-features -- -D warnings108cargo deny check109cargo audit110cargo nextest run --all-features111cargo test --doc112cargo llvm-cov --all-features --workspace113```114115### Workspace dependency inheritance116117```toml118# root Cargo.toml119[workspace.dependencies]120serde = { version = "1", features = ["derive"] }121122# member Cargo.toml123[dependencies]124serde = { workspace = true }125```126127→ See [deny-toml.md](references/templates/deny-toml.md) for the complete root manifest128129---130131## Best Practices132133### DO134- Fail fast: run `fmt` and `clippy` before the expensive test/coverage steps135- Keep one `[workspace.dependencies]` as the version source of truth136- Run `cargo hack --feature-powerset check` to catch broken feature combinations137- Run `cargo machete` to prune unused dependencies138139### DON'T140- Let clippy warnings pass CI (use `-D warnings`)141- Duplicate crate versions across members instead of inheriting142- Skip `cargo deny` because "audit already ran" — they check different things143- Forget `cargo test --doc` after nextest