rust-clippy-check
Skill0 starsChanged 2 months agoMITView on GitHub
Guides agents through running and resolving cargo clippy warnings, borrow-checker diagnostics, and rustfmt.
In this repository49 other files it gives its agents.
- bug-reproducerSkill
- claim-checkerSkill
- command-failure-diagnoserSkill
- config-risk-reviewerSkill
- csv-validatorSkill
- deployment-checklist-makerSkill
- diff-reviewerSkill
- factual-summarizerSkill
- field-extractorSkill
- api-contract-testerSkill
- database-migration-helperSkill
- security-vulnerability-fixerSkill
- git-commit-stagerSkill
- git-conflict-resolverSkill
- github-actions-debuggerSkill
- github-issue-triagerSkill
- github-pr-creatorSkill
- github-pr-reviewerSkill
- go-code-qualitySkill
- go-lint-and-vetSkill
- go-testingSkill
- json-schema-converterSkill
- lint-and-typecheckSkill
- meaning-preserving-editorSkill
- meeting-notes-to-actionsSkill
- minimal-bug-fixSkill
- option-comparatorSkill
- py-code-qualitySkill
- py-lint-and-typecheckSkill
- py-testingSkill
- readme-writerSkill
- regression-test-writerSkill
- release-notes-drafterSkill
- repo-inspectorSkill
- research-briefSkill
- reversible-cleanup-plannerSkill
- rust-code-qualitySkill
- rust-testingSkill
- small-refactorSkill
- status-updateSkill
- step-by-step-tutorialSkill
- step-decomposerSkill
- tabular-analyzerSkill
- task-briefSkill
- test-runner-debuggerSkill
- ts-code-qualitySkill
- ts-lint-and-typecheckSkill
- ts-testingSkill
- skill-templateSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Very specific: line 20
Do not use for running tests.
- Distinctive: line 26
If not specified: default to current directory.
- Very specific: line 27
Strict Ban: Never add #![allow(clippy::...)] without explicit user permission.
- Distinctive: line 30
Follow these numbered actions:
- Very specific: line 36
Use references (&T) instead of cloning (.clone()) where possible.
- Very specific: line 44
If clippy recommends .into_iter() vs .iter(): follow borrow vs move semantics.
- Distinctive: line 70
Stop and ask the user when:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Rust Clippy and Linter (cargo clippy)
Executes Rust's static analyzer cargo clippy and formatter rustfmt. Resolves borrow-checker conflicts, unnecessary allocations, and clippy lints without #![allow(...)].
1. Purpose
Eliminate performance antipatterns and borrow-checker hazards in Rust.
2. When to Use
Use this skill when:
- Checking Rust code before committing.
- Resolving
cargo clippy -- -D warningserrors. - Resolving borrow checker errors (
E0382: borrow of moved value,E0502: cannot borrow as mutable).
3. When Not to Use
- Do not use for running tests; use
rust-testing.
4. Required Inputs
crate_path: Path to Cargo crate (default:.).
5. Missing-Input Behavior
- If not specified: default to current directory.
- Strict Ban: Never add
#![allow(clippy::...)]without explicit user permission.
6. Procedure
Follow these numbered actions:
- Action 1: Run Cargo Check
- Execute:
cargo check
- Execute:
- Action 2: Run Cargo Clippy
- Execute:
cargo clippy --all-targets -- -D warnings
- Execute:
- Action 3: Resolve Borrow Checker & Allocation Lints
- Use references (
&T) instead of cloning (.clone()) where possible. - Replace manual loops with iterator combinators where recommended.
- Use references (
- Action 4: Format Code
- Execute:
cargo fmt
- Execute:
- Action 5: Re-verify
- Confirm exit code 0 on
cargo clippy.
- Confirm exit code 0 on
7. Decision Rules
- If clippy recommends
.into_iter()vs.iter(): follow borrow vs move semantics.
8. Output Format
Emit the report using this template:
### Rust Clippy Report: [Crate]
- **Clippy Command**: `cargo clippy -- -D warnings` -> PASS
- **Format Command**: `cargo fmt -- --check` -> PASS
- **Lints Resolved**: [Count]
#### Resolved Lints
- `[file:line]`: [Clippy lint name and fix description]9. Verification Checklist
cargo clippyexits with code 0.- No
#![allow(...)]overrides added. - Code formatted with
cargo fmt.
10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
E0382: use of moved value | Value moved in earlier statement | Pass by reference &val or borrow clone. |
11. Stop or Escalation Conditions
Stop and ask the user when:
- Resolving borrow requires redesigning core data structures (e.g. using
Arc<Mutex<T>>).
12. Examples
Example 1: Successful Execution
Input:
Crate: .
Error: clippy::needless_borrow on &StringOutput:
### Rust Clippy Report: .
- **Clippy Command**: `cargo clippy -- -D warnings` -> PASS
- **Format Command**: `cargo fmt -- --check` -> PASS
- **Lints Resolved**: 1
#### Resolved Lints
- `src/main.rs:18`: Removed redundant borrow `&s` where `&str` was already expected.Example 2: Ambiguous or Missing Input
Input:
Clippy check.Output:
### Rust Clippy Report: .
- **Clippy Command**: `cargo clippy -- -D warnings` -> PASS
- **Lints Resolved**: 0Example 3: Expected Final Output
Output:
### Rust Clippy Report: parser-crate
- **Clippy Command**: `cargo clippy -- -D warnings` -> PASS
- **Lints Resolved**: 3Does 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
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.

