agentleFS
botirkhaltaevbotirkhaltaev/botir-skills/skills/rust-clippy-lints/SKILL.md

rust-clippy-lints

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Master Clippy lints for code quality. Use when running Clippy, fixing lint warnings, configuring lint levels, enabling/disabling specific lints, or writing custom lints.

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use real lint names (not category placeholders):

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clippy Lints

Guide to Clippy for code quality.

When to Use This Skill

  • Running Clippy checks
  • Fixing lint warnings
  • Configuring lint levels
  • Enabling/disabling lints

Running Clippy

cargo clippy
cargo clippy --fix
cargo clippy -- -D warnings
cargo clippy --all-targets --all-features
cargo clippy --workspace -- -D warnings

More flags and CI patterns: references/running-clippy.md.

Allow / Warn / Deny

Use real lint names (not category placeholders):

#[allow(clippy::redundant_clone)]
fn cache_key(s: &String) -> String {
    s.clone()
}

#[deny(clippy::unwrap_used)]
fn parse(s: &str) -> i32 {
    s.parse().unwrap()
}

// Crate-wide
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]

Levels: allow < warn < deny < forbid.

Lint Groups

GroupRole
clippy::allDefault set (correctness, style, complexity, perf, …)
clippy::correctnessLikely bugs; deny-worthy
clippy::styleIdiomatic style
clippy::complexitySimplify overly complex code
clippy::perfPerformance suggestions
clippy::pedanticStrict; expect some allows
clippy::nurseryNewer/experimental lints
clippy::cargoCargo.toml / crate metadata
cargo clippy -- -W clippy::pedantic
cargo clippy -- -W clippy::nursery
cargo clippy -- -A clippy::all -W clippy::perf
# Cargo.toml
[lints.clippy]
all = "deny"
pedantic = "warn"
nursery = "allow"
redundant_clone = "deny"

Common Fixes

Unnecessary clone

// Triggers clippy::redundant_clone when a borrow suffices
let x = some_value.clone();
let x = &some_value;

Redundant closure

.iter().map(|x| foo(x))
.iter().map(foo)

Needless collect

// Prefer iterating without an intermediate Vec when possible
let v: Vec<_> = iter.collect();
for x in v { /* ... */ }
for x in iter { /* ... */ }

Reference Map

  • references/running-clippy.md — Commands and flags
  • references/common-lints.md — Named lints by category
  • references/configuring.md — Attributes, Cargo.toml, clippy.toml

Key References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.