Rust Quality
Rule
Improve Rust code quality without changing behavior. Prefer mechanical, idiomatic,
reviewable changes aligned with rustfmt, Clippy, and project lints.
Hard Stops
Stop when:
- A lint fix changes public API, feature semantics, error behavior, persistence, or wire
formats.
- Removing apparently unused items could remove public exports, macro entry points, plugin
hooks, migrations, examples, or build-tagged/platform-specific code.
- Adding
#[allow], changing lint levels, or disabling warnings would hide a real issue.
- Tooling policy is missing and adding strict Clippy/cargo-deny/nextest config is out of
scope.
Defaults
- Run
cargo fmt --all and cargo clippy --all-targets --all-features -- -D warnings when
the project can support it.
- Keep
#[allow] narrow, local, and justified with a reason.
- Prefer removing dead private code over suppressing warnings.
- Preserve generated code; update generators instead of hand-editing when possible.
- Keep feature defaults minimal and avoid accidental dependency activation.
Workflow
- Inspect
Cargo.toml, features, workspace config, rustfmt/clippy config, generated files,
and wrappers.
- Run fmt and Clippy through project commands when available.
- Apply formatting, import cleanup, warning fixes, safe simplifications, and dead private
code removal.
- Run tests for touched crates and
just check.
Antipatterns
- Turning clear code into clever iterator chains solely for style.
- Adding broad crate-level allows.
- Fixing borrow/clippy issues with unnecessary clones everywhere.
- Changing module boundaries during lint cleanup.
Completion
Report tools run, files cleaned, allows added with reasons, behavior assumptions, and
validation results.
Source: nyquistwilder/personal-pi — distributed by TomeVault.
1---2name: rust-quality-33description: Rust quality workflow for cargo fmt, Clippy, warning fixes, import/module cleanup, dead-code removal, edition idioms, feature hygiene, and behavior-preserving cleanup in greenfield crates. Use when this capability is needed.4---56# Rust Quality78## Rule910Improve Rust code quality without changing behavior. Prefer mechanical, idiomatic,11reviewable changes aligned with `rustfmt`, Clippy, and project lints.1213## Hard Stops1415Stop when:1617- A lint fix changes public API, feature semantics, error behavior, persistence, or wire18 formats.19- Removing apparently unused items could remove public exports, macro entry points, plugin20 hooks, migrations, examples, or build-tagged/platform-specific code.21- Adding `#[allow]`, changing lint levels, or disabling warnings would hide a real issue.22- Tooling policy is missing and adding strict Clippy/cargo-deny/nextest config is out of23 scope.2425## Defaults2627- Run `cargo fmt --all` and `cargo clippy --all-targets --all-features -- -D warnings` when28 the project can support it.29- Keep `#[allow]` narrow, local, and justified with a reason.30- Prefer removing dead private code over suppressing warnings.31- Preserve generated code; update generators instead of hand-editing when possible.32- Keep feature defaults minimal and avoid accidental dependency activation.3334## Workflow35361. Inspect `Cargo.toml`, features, workspace config, rustfmt/clippy config, generated files,37 and wrappers.382. Run fmt and Clippy through project commands when available.393. Apply formatting, import cleanup, warning fixes, safe simplifications, and dead private40 code removal.414. Run tests for touched crates and `just check`.4243## Antipatterns4445- Turning clear code into clever iterator chains solely for style.46- Adding broad crate-level allows.47- Fixing borrow/clippy issues with unnecessary clones everywhere.48- Changing module boundaries during lint cleanup.4950## Completion5152Report tools run, files cleaned, allows added with reasons, behavior assumptions, and53validation results.5455---56> Source: [nyquistwilder/personal-pi](https://github.com/nyquistwilder/personal-pi) — distributed by [TomeVault](https://tomevault.io).57<!-- tomevault:4.0:skill_md:2026-06-16 -->