rust-google-style
Skill1 starsChanged 4 months agoMITView on GitHub
Write, review, and refactor Rust code with Google's Rust Style Guide. Use for Rust style reviews, API design, imports, ownership, error handling, traits, naming, documentation, unsafe code, or explicit requests to follow Google Rust guidelines.
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 14 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill for Rust implementation work and style reviews.
- Distinctive: line 16
Read the repository instructions.
- Distinctive: line 22
Run the applicable checks.
- Distinctive: line 24
If the source is unavailable, use the checklist for an initial review.
- Distinctive: line 28
Put implementations in leaf modules named for their main type.
- Distinctive: line 29
Avoid glob imports except documented cases.
- Distinctive: line 30
Prefer borrowing; justify shared ownership and deep copies.
- Distinctive: line 32
Use enums for unclear flags, newtypes for distinct meanings, and named fields.
- Distinctive: line 34
Prefer standard traits and derives.
- Distinctive: line 35
Document public contracts, panic conditions, and unsafe invariants.
- Very specific: line 37
Prefer matching to unwrap.
- Distinctive: line 38
Check API evolution, accessor names, macros, and readability in the source.
- Distinctive: line 39
Use repository formatting.
- Very specific: line 62
Use the repository's check commands and supported feature sets.
- Distinctive: line 71
Run documentation tests when examples change.
- Distinctive: line 83
When a repository rule differs from the guide, state which rule you followed.
≈ “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.
Files
Rust Google Style
Use this skill for Rust implementation work and style reviews. For a review request, report findings before you change files. For an implementation request, apply the relevant rules within the requested scope.
Workflow
- Read the repository instructions. Inspect the affected code, callers, tests, Cargo manifests, toolchain file, formatter configuration, and lint configuration. Identify the minimum supported Rust version and the build system.
- Identify the API boundary. Record whether the change affects application code, a reusable library, or an API used outside the repository. Check compatibility before you change a public signature or attribute.
- Open the relevant source links below. Read each rule with its rationale and exceptions. For a full style audit, read the complete guide. The checklist is a starting point, not a complete copy of the guide.
- Apply explicit user and repository instructions first. Apply Chromium-only layout, import, async, and thread rules only in Chromium. Apply Fuchsia mutex rules only in Fuchsia.
- For each finding, identify the location, the applicable rule, the effect on the code, and the smallest useful correction. Separate a correctness defect from a style preference. Check exceptions before you report a violation.
- Make only the changes needed for the task. Preserve unrelated edits. Do not add dependencies, change the toolchain, enable nightly formatter options, or add stricter lint policies solely to satisfy this skill.
- Run the applicable checks. Inspect the final diff for changes to behavior, public contracts, generated files, and unrelated formatting.
If the source is unavailable, use the checklist for an initial review. State that the full guide was not checked. Do not claim complete compliance or invent the missing rules.
Initial checklist
- Put implementations in leaf modules named for their main type.
- Avoid glob imports except documented cases; group imports by module.
- Prefer borrowing; justify shared ownership and deep copies.
- Accept flexible borrowed inputs; weigh iterator and generic APIs against application simplicity.
- Use enums for unclear flags, newtypes for distinct meanings, and named fields.
- Choose
Option,Result, or panic according to the contract. - Prefer standard traits and derives; add abstractions when needed.
- Document public contracts, panic conditions, and unsafe invariants.
- Isolate necessary unsafe code; explain safety and technical need.
- Prefer matching to
unwrap; useexpectfor justified invariant failures. - Check API evolution, accessor names, macros, and readability in the source.
- Use repository formatting; limit formatting exemptions.
Source sections
The Google Rust Style Guide is the source for the checklist. Open the links for the areas touched by the task, including rules omitted from the checklist.
- Applicability and API context
- Modules and imports
- Formatting
- Ownership
- Signatures and errors
- Data models
- Traits
- Concurrency
- Macros
- Naming
- Documentation
- Safety and API evolution
- Implementation
- Tests
Validation
Use the repository's check commands and supported feature sets. For a Cargo project without custom commands, select from these commands. Replace PACKAGE with the affected package name.
cargo fmt --all -- --check
cargo check --package PACKAGE
cargo test --package PACKAGE
cargo clippy --package PACKAGE --all-targetsRun documentation tests when examples change. Use the required target and features for conditional code. Do not enable every feature by default; some feature combinations are incompatible. Use the repository's build and test tools for a project that does not use Cargo.
A formatter or Clippy pass does not prove that an API follows the guide. Review the applicable design rules separately. Report existing failures and checks that could not run. Do not claim that unexecuted checks passed.
Report
State what changed and why. Include the validation result and any remaining limitation. For review findings, include a file location, a source link, the relevant context or exception, and a proposed correction.
Example review format:
src/example.rs:42: Describe the observed code and its effect. Link the applicable rule. Explain why its exceptions do not apply, then propose a focused change.
When a repository rule differs from the guide, state which rule you followed. When no applicable finding remains, say so and identify the scope reviewed.
Skill format
This skill uses the Agent Skills specification. Its metadata supports discovery; its instructions define the workflow; its source links provide details when needed.
In this repository73 other files it gives its agents.
- unsafe-checker/AGENTS.mdAGENTS.md
- activity-tracingSkill
- beadsSkill
- code-analysis-warningsSkill
- coding-guidelinesSkill
- compiler-warningsSkill
- core-actionbookSkill
- core-agent-browserSkill
- core-dynamic-skillsSkill
- core-fix-skill-docsSkill
- csharp-compiler-warningsSkill
- csharp-object-designSkill
- domain-cliSkill
- domain-cloud-nativeSkill
- domain-embeddedSkill
- domain-fintechSkill
- domain-iotSkill
- domain-mlSkill
- domain-webSkill
- dotnet-pinvokeSkill
- dreamSkill
- gitSkill
- ide-warningsSkill
- karpathy-guidelinesSkill
- m01-ownershipSkill
- m02-resourceSkill
- m03-mutabilitySkill
- m04-zero-costSkill
- m05-type-drivenSkill
- m06-error-handlingSkill
- m07-concurrencySkill
- m09-domainSkill
- m10-performanceSkill
- m11-ecosystemSkill
- m12-lifecycleSkill
- m13-domain-errorSkill
- m14-mental-modelSkill
- m15-anti-patternSkill
- mermaidSkill
- meta-cognition-parallelSkill
- modern-csharpSkill
- msbuild-warningsSkill
- mx-creative-keypadSkill
- nuget-warningsSkill
- nullability-warningsSkill
- rcs-warningsSkill
- renpySkill
- rust-call-graphSkill
- rust-code-navigatorSkill
- rust-dailySkill
- rust-deps-visualizerSkill
- rust-learnerSkill
- rust-object-designSkill
- rust-refactor-helperSkill
- rust-routerSkill
- rust-skill-creatorSkill
- rustSkill
- rust-symbol-analyzerSkill
- rust-trait-explorerSkill
- translationsSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

