بنقرة واحدة
format-code
// Formats the codebase using nightly rustfmt. Use when asked to "format the code", "run rustfmt", "cargo fmt", or when formatting is needed after code changes.
// Formats the codebase using nightly rustfmt. Use when asked to "format the code", "run rustfmt", "cargo fmt", or when formatting is needed after code changes.
| name | format-code |
| description | Formats the codebase using nightly rustfmt. Use when asked to "format the code", "run rustfmt", "cargo fmt", or when formatting is needed after code changes. |
| context | root |
| user-invocable | true |
Formats all Rust code in the codebase using nightly rustfmt to ensure consistent code style. This skill always uses nightly rustfmt to access the latest formatting features and configurations.
Execute the format command using nightly toolchain:
cargo +nightly fmt
This formats all Rust files in the workspace according to the project's rustfmt.toml configuration (if present).
After formatting completes:
User Request: "Format the code"
Expected Behavior:
Run formatter:
cargo +nightly fmt
Check for changes (optional):
git status
Report:
Code formatted successfully using nightly rustfmt.
User Request: "Run rustfmt before I commit"
Expected Behavior:
Run formatter:
cargo +nightly fmt
Report:
Formatting complete. Ready to commit.
cargo +nightly fmt to ensure nightly toolchaincargo fmt without the +nightly flagBefore considering the task complete, verify:
cargo +nightly fmt successfullyNightly toolchain not installed:
rustup install nightly to installFormatting fails with parse errors:
rustfmt.toml issues:
create-git-commit - Create commits after formatting