rust-formatting

Format Rust code with rustfmt and apply Clippy linting.

1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/caraya/agent-skills --skill rust-formatting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-formatting
Source: https://github.com/caraya/agent-skills/tree/main/skills/rust-formatting
Command: npx skills add https://github.com/caraya/agent-skills --skill rust-formatting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeps Rust projects consistently formatted and linted by enforcing rustfmt and Clippy configurations, reducing style drift and review overhead.

Core Features & Use Cases

  • Enforce consistent formatting across codebases with rustfmt and customizable rustfmt.toml.
  • Apply linting rules via Clippy to catch idiomatic and correctness issues during development.
  • Integrate with IDEs and pre-commit hooks to ensure formatting is applied on save or before commits.

Quick Start

Format the project with cargo fmt and run cargo clippy to lint.

Frequently Asked Questions about rust-formatting

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

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

Enforce consistent Rust code formatting by running cargo fmt with a customizable rustfmt.toml configuration, which automatically standardizes style and reduces review overhead across the codebase.

How do I apply Clippy linting to catch Rust correctness issues?

Apply Clippy linting by running cargo clippy in your Rust project to automatically detect idiomatic improvements and correctness issues during the development cycle.

Can I integrate rustfmt and Clippy into IDEs and pre-commit hooks?

Yes, you can integrate rustfmt and Clippy into IDEs and pre-commit hooks to automatically apply formatting and linting on save or before commits, ensuring continuous code quality.

Do I need rust-analyzer to enable on-save formatting for Rust?

Yes, IDE integration with rust-analyzer is required to enable on-save formatting, alongside explicit rustfmt and Clippy configurations and an edition setting for the Rust project.

What is the best way to prevent style drift in Rust codebases?

The best way to prevent style drift is enforcing rustfmt and Clippy configurations within CI pipelines, which standardizes formatting and catches lint issues before code review.