rust-code-quality
Skill0 starsChanged 2 months agoMITView on GitHub
Guides agents in applying idiomatic Rust architecture: Result/Option handling with ?, avoiding unnecessary clones, custom error types with thiserror.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- rcore-os/tgoskitstheir own version, first seen Oct 8, 2026
- AsakuraMizu/skillstheir own version, first seen Sep 18, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- rcore-os/tgoskits★ 76same name
- AsakuraMizu/skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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-clippy-checkSkill
- 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
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
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 testing; use rust-testing.
- Very specific: line 26
If target_file is missing: ask for target file.
- Very specific: line 27
Never leave bare .unwrap() in production library code.
- Distinctive: line 30
Follow these numbered actions:
- Very specific: line 32
Search for .unwrap() and .expect().
- Very specific: line 38
Run cargo check and cargo test.
- Very specific: line 41
Never use .unwrap() in production libraries.
- Distinctive: line 68
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 Code Quality & Idioms
Enforces canonical Rust design: replacing .unwrap() with ? error propagation, defining custom error enums via thiserror, and avoiding unnecessary heap allocations and .clone().
1. Purpose
Refactor Rust code to prevent panics and improve performance.
2. When to Use
Use this skill when:
- Replacing unsafe
.unwrap()or.expect()calls in library code withResult<T, E>and?. - Creating clean, typed error enums.
- Replacing heap allocations (
String) with borrowed slices (&str) in read-only functions.
3. When Not to Use
- Do not use for testing; use
rust-testing.
4. Required Inputs
target_file: Path to the Rust source file.
5. Missing-Input Behavior
- If
target_fileis missing: ask for target file. - Never leave bare
.unwrap()in production library code.
6. Procedure
Follow these numbered actions:
- Action 1: Audit for Panics
- Search for
.unwrap()and.expect().
- Search for
- Action 2: Convert to Result Propagation
- Return
Result<T, AppError>and propagate using?.
- Return
- Action 3: Audit Allocations
- Change
fn takes_string(s: String)tofn takes_string(s: &str).
- Change
- Action 4: Verify Compiler & Tests
- Run
cargo checkandcargo test.
- Run
7. Decision Rules
- Never use
.unwrap()in production libraries; use?or handleNone.
8. Output Format
Emit the report using this template:
### Rust Code Quality Report: [File]
- **File Modified**: `[path]`
- **Patterns Applied**: [e.g. Error Propagation, Borrowed Slices]
- **Compile Status**: PASS
- **Test Status**: PASS
#### Improvements Made
- [Improvement 1]9. Verification Checklist
- No bare
.unwrap()calls in modified code. cargo testpasses cleanly.- No unnecessary
.clone()calls.
10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
cannot use ? in function returning () | Function returns unit | Update function return signature to Result<(), Error>. |
11. Stop or Escalation Conditions
Stop and ask the user when:
- Converting to Result requires modifying public library traits.
12. Examples
Example 1: Successful Execution
Input:
File: src/config.rs
Issue: let val = env::var("PORT").unwrap();Output:
### Rust Code Quality Report: src/config.rs
- **File Modified**: `src/config.rs`
- **Patterns Applied**: Error Propagation with `?`
- **Compile Status**: PASS
- **Test Status**: PASS
#### Improvements Made
- Replaced `.unwrap()` with `env::var("PORT").map_err(ConfigError::from)?`.Example 2: Ambiguous or Missing Input
Input:
Improve rust.Output:
### Rust Code Quality Report: Halted - No File
- **Status**: Halted
Please specify the target Rust file to inspect.Example 3: Expected Final Output
Output:
### Rust Code Quality Report: src/parser.rs
- **File Modified**: `src/parser.rs`
- **Patterns Applied**: Borrowed Slice Parameters
- **Compile Status**: PASS
- **Test Status**: PASSDoes 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.

