code-quality

Format, lint, and audit Rust code with cargo fmt, Clippy, and cargo-audit.

11|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/d-o-hub/rust-self-learning-memory --skill code-quality-d-o-hub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-quality
Source: https://github.com/d-o-hub/rust-self-learning-memory/tree/main/.claude/skills/code-quality
Command: npx skills add https://github.com/d-o-hub/rust-self-learning-memory --skill code-quality-d-o-hub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides maintaining high code quality through formatting, linting, and static analysis to ensure consistency and reduce defects.

Core Features & Use Cases

  • Formatting & style: rustfmt usage and configuration.
  • Linting: clippy checks with recommended fixes.
  • Security & dependencies: cargo-deny and cargo-audit for dependency hygiene.

Quick Start

Run cargo fmt, cargo clippy --all-targets -- -D warnings, and cargo audit to verify and fix issues.

Frequently Asked Questions about code-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent code formatting across a Rust project?

Use cargo fmt to automatically format all Rust code according to style guidelines. Configure rustfmt in rustfmt.toml to set project-specific formatting rules, then run cargo fmt locally and in CI to maintain consistency across all contributors.

What does Clippy do and how do I use it in my Rust workflow?

Clippy performs static linting to catch common mistakes and suggest idiomatic improvements. Run cargo clippy --all-targets -- -D warnings to enforce all recommendations as errors, integrating it into CI pipelines and pre-commit hooks.

How do I audit Rust dependencies for security vulnerabilities?

Use cargo-audit to scan dependencies for known security advisories and cargo-deny to enforce dependency policies. Both tools integrate into CI to block builds with vulnerable or unapproved dependencies before they reach production.

Can I automate formatting and linting checks on every commit?

Yes. Set up pre-commit hooks to run cargo fmt, cargo clippy, and cargo-audit automatically before commits complete. This prevents inconsistent or problematic code from entering version control.

Do I need all three tools—rustfmt, Clippy, and cargo-audit—or can I use them separately?

Each tool addresses different quality aspects: rustfmt handles style, Clippy catches logical issues, and cargo-audit secures dependencies. Use all three together for comprehensive coverage, or adopt them incrementally based on your project's needs.