Rust Code Quality

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Run Clippy, rustfmt and, when a deny.toml exists, cargo-deny on a Rust crate or Cargo workspace and report every issue grouped by tool and by rule id. It is a read-only reporting skill: it never fixes issues, applies formatting, initializes a cargo-deny config, or edits lint configuration unless asked to as a follow-up.

Purpose

iru-rust-code-quality reads the project’s lint policy ([lints] or [workspace.lints], clippy.toml, rustfmt.toml, deny.toml) and its CI invocation, then mirrors that invocation. Clippy is counted without -D warnings, so one failing crate does not hide the lints of the crates that depend on it, and the report says how many issues would fail a CI that denies warnings. Each tool is verified as installed before a "zero issues" result is trusted; a missing tool is reported as skipped. One embedded stdlib Python parser turns every report into per-tool totals and per-rule-id counts, deduplicating the copies Cargo prints once per target. When a calling skill supplies a baseline, only new issues are reported.

Purpose group

Plugin

Shipped by the iru-rust plugin of the ai-catalog marketplace (install with /plugin install iru-rust@ai-catalog; see Plugins).

Invocation

/iru-rust-code-quality
/iru-rust-code-quality <file-or-dir>[,<file-or-dir>...]

Inputs

Argument Required Description Default

scope

No

Comma-separated files or directories (src/commands/greet.rs, crates/core/). Non-existent paths are dropped with a note. Clippy and rustfmt still run workspace-wide and findings outside the scope are filtered out; cargo-deny is always workspace-wide.

None — the whole workspace.

baseline

No

A baseline: line or block in the calling prompt: per-tool/per-rule-id counts, or an itemized tool rule file[:line] list from an earlier run, used to report only new issues.

None — plain counts are reported.

Tools and how they count as wired:

Tool Wired when

Clippy

cargo clippy --version succeeds; otherwise reported as "clippy component not installed", skipped

rustfmt

cargo fmt --version succeeds; otherwise reported as "rustfmt component not installed", skipped

cargo-deny

A deny.toml exists and cargo deny --version succeeds; no config is "not configured, skipped", and config without the binary is "not installed, skipped"

Outputs

  • A plain-text summary in the conversation: an overall total first, then per tool whether it ran or was skipped (and why), the version and config in force, its total, and one line per rule-id bucket with its count.

  • A file:line — message list when the scope is smaller than the workspace or on request; per-rule lists are capped at 20 entries with "(+N more)".

  • Rule-id buckets: clippy::<lint>, rustc lint names, E… and compile-error for Clippy; rustfmt, rustfmt-config and rustfmt-error; cargo-deny:<check>:<code>. Doc lints are called out for iru-rust-rustdoc, and unsafe_code findings and compile errors are listed first.

  • A statement of whether a CI that runs Clippy with -D warnings, cargo fmt --check and cargo deny check would pass.

  • With a baseline, only issues new since it, matched on tool, rule id and file rather than line numbers.

  • Tool failures (Clippy exit 101 from a build error, cargo-deny tool-error, a stale Cargo.lock) get their own line, never "0 issues". Temporary reports under target/iru-rust-cq/ are deleted. No source or configuration is modified, and no cargo clippy --fix, write-mode cargo fmt, cargo deny init or cargo update is run.

Execution flow

flowchart TD A["Start /iru-rust-code-quality\n(optional scope and baseline)"] --> B["Step 0: resolve inputs, read lint policy,\nCI invocation and tool configs"] B --> C["Step 1: verify which tools are wired"] C --> D["Step 2: run Clippy without -D warnings,\nrustfmt --check, cargo-deny per check"] D --> E{"Compile errors or\ntool failures?"} E -- yes --> F["Report them first as their own buckets"] E -- no --> G["Step 3: parse every report into\ntool, rule id and issues"] F --> G G --> H{"Baseline supplied?"} H -- yes --> I["Step 4: keep only new issues\nagainst the baseline"] H -- no --> J["Step 4: bucket by tool and rule id"] I --> K["Report totals, skipped tools\nand would-CI-pass verdict"] J --> K

Dependencies

Invokes

None — iru-rust-code-quality is a leaf skill. It refers to Rust Test for the stale-lockfile behavior and hands doc lints off to Rust Rustdoc in its report, but does not call either.

Invoked by

  • iru-gate-runner — calling skills normally run it inside this sub-agent. It spawns no agents itself.

Source

SKILL.md on GitHub — the file this page was generated from.