rustfmt

Runs cargo fmt on Rust projects with workspace detection and nightly toolchain fallback.

3|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/waki285/dotfiles --skill rustfmt-waki285
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rustfmt
Source: https://github.com/waki285/dotfiles/tree/main/.skills/rustfmt
Command: npx skills add https://github.com/waki285/dotfiles --skill rustfmt-waki285

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Formatting Rust code consistently requires knowing whether a project is a workspace, whether its rustfmt configuration needs nightly-only options, and whether formatting actually applied cleanly. This Skill automates that decision process so cargo fmt runs correctly every time. ## Core Features & Use Cases - Workspace Detection: Reads Cargo.toml and automatically adds --all when a [workspace] section is present. - Nightly Detection: Inspects command output for indicators like "unstable features are only available in nightly channel" and switches all subsequent runs to cargo +nightly fmt. - Check-Then-Apply Workflow: Runs cargo fmt --check first to preview changes, then applies formatting and reports how many files were reformatted. - Use Case: After writing new Rust code in a workspace project with a nightly-only rustfmt.toml, ask the agent to format the code and it will detect the workspace scope, switch to the nightly toolchain, apply formatting, and summarize the results. ## Quick Start Format the Rust code in this project using the rustfmt skill and tell me how many files changed.

Frequently Asked Questions about rustfmt

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

FAQPage Schema
How do I format Rust code with cargo fmt?▼

Run cargo fmt in the project directory to format all source files according to rustfmt rules. Use cargo fmt --check first to preview which files need changes without modifying them.

How do I format an entire Cargo workspace?▼

Run cargo fmt --all to format every crate in a workspace. The skill detects the [workspace] section in Cargo.toml automatically and adds the --all flag for you.

Why does cargo fmt fail with unstable features errors?▼

This happens when rustfmt.toml uses nightly-only configuration options on a stable toolchain. Switch to cargo +nightly fmt so the unstable options are accepted.

Does rustfmt require the nightly toolchain?▼

Only when the project's rustfmt.toml or .rustfmt.toml uses unstable options. The skill checks command output for nightly indicators and uses cargo +nightly fmt for all subsequent runs in that session.

How do I check Rust formatting without changing files?▼

Run cargo fmt -- --check to see a diff of what would change without writing anything. A non-zero exit code means some files are not formatted according to the configured rules.