agentleFS
pesappesap/skills/rust/SKILL.md

rust

Skill1 starsChanged 4 months agoMITView on GitHub

Write and review Rust using pesap's standard-library-first, function-first style, typed errors, explicit ownership, and domain-specific contexts. Use for implementation, debugging, refactoring, tests, API design, performance, and safety reviews, including tasks identified by .rs paths, Cargo manifests, or compiler/Clippy diagnostics. Not for non-Rust tasks, Git-only operations, or purely conceptual explanations.

43 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use java, node and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • testdino-hqSkill

    java

    Google's official Java style guide. Covers 2-space indentation, 100-char line limit, naming conventions, braces, imports, Javadoc, exception handling, lambdas, and streams. Enforces @Override annotations and specific imports.

    Also in 4 projects that use this

  • mcollinaSkill

    node

    Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules, testing, performance, caching, logging, and more. Use when setting up Node.js projects with native TypeScript support, configuring type stripping (--experimental-strip-types), writing Node 22+ TypeScript without a build step, or when the user mentions 'native TypeScript in Node', 'strip types', 'Node 22 TypeScript', '.ts files without compilation', 'ts-node alternative', or needs guidance on error handling, graceful shutdown, flaky tests, profiling, or environment configuration in Node.js. Helps configure tsconfig.json for type stripping, set up package.json scripts, handle module resolution and import extensions, and apply robust patterns across the full Node.js stack.

    Also in 3 projects that use this

  • rogue-dev-studioSkill

    golang

    Go development environment. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `golang` work when listed in TEAM.yaml or explicitly requested.

    Also in 3 projects that use this

  • trotsky1997Skill

    ast-grep

    Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.

    Also in 3 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 4 projects that use this

  • OpenAISkill

    nextjs

    Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications — routing, Server Components, Server Actions, Cache Components, layouts, middleware/proxy, data fetching, rendering strategies, and deployment on Vercel.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 35 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read local instructions, Cargo manifests, toolchain/MSRV, callers, tests, and configured checks.

    line 17
  2. Very specific:

    Keep unsafe minimal and isolated.

    line 60
  3. Very specific:

    Do not hold blocking locks across .await or block an async executor.

    line 63
  4. Distinctive:

    No blanket lint suppression, legacy compatibility layers, speculative abstractions, unrelated lockfile churn, or unmeasured performance …

    line 65
  5. Distinctive:

    Test public success, failure, boundaries, and supported flag combinations.

    line 70
  6. Very specific:

    Use only supported feature/target combinations, not automatic --all-features.

    line 80
  7. Distinctive:

    Do not preload references or evaluation files.

    line 91

“Common” is measured: kept by at least 6 in 10 of the 35 edited versions of this file we could read. “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

Rust

First

Read local instructions, Cargo manifests, toolchain/MSRV, callers, tests, and configured checks. Follow explicit repository requirements, not accidental nearby style. Ask about conflicting requirements before editing. Preserve the edition, supported targets/features, dependency policy, and unrelated changes.

Default decisions

DecisionUse
DependencyStdlib when it meets correctness and operational requirements; core/alloc for existing no_std crates. Reuse canonical public APIs. Do not add a crate for a sufficient stdlib operation or rewrite existing dependencies without need.
ComputationSmall typed functions, separate from I/O and logging. Methods belong with real state or invariants; no stateless service objects, speculative traits, or one-use factories.
DataExisting domain types first. Structs for named records, enums for alternatives, newtypes for meaningful invariants. Not every scalar needs a wrapper.
OwnershipBorrow read-only inputs (&str, &[T]); own values when retaining or transferring them. Do not add clones, Arc<Mutex<_>>, or lifetime machinery merely to silence the compiler.
ReturnUseful value T for ordinary work; Option<T> for absence; Result<T, E> for expected failure; Result<(), E> for a fallible command without a payload. Propagate with ? and preserve causes.
Public APIPrivate implementation modules with deliberate pub use exports. Use the narrowest visibility and crate:: paths. No underscore naming convention or duplicate forwarding function is needed for privacy. Respect trait signatures.
ConfigurationInject a domain-named borrowed snapshot such as ctx: &CountImportContext for configured operations. No generic context bag, empty contexts, or hidden environment reads. Independent flags use booleans; exclusive behavior uses an enum.
LoggingReuse the configured logging/tracing stack. Applications own subscribers, sinks, process exit, and CLI output; libraries return errors and never install global logging configuration.

Working pattern

An internal batch parser can reuse the stdlib error without a new error enum. Empty input yields an empty vector; invalid or overflowing counts return Err.

use std::num::ParseIntError;

/// Parse one unsigned count per line without trimming whitespace.
///
/// # Errors
/// Returns the first invalid or out-of-range count's parsing error.
pub fn parse_counts(raw: &str) -> Result<Vec<u32>, ParseIntError> {
    raw.lines().map(str::parse).collect()
}

Guardrails

  • Handle or propagate every Result. No production unwrap, expect, ignored errors, or success-shaped fallbacks. Use checked arithmetic/indexing where external data can overflow or exceed bounds; casts must not silently lose data.
  • Validate untrusted input once at the boundary. Model invalid states out of the domain; flags never bypass required validation or conceal failures. Distinguish runtime policy from Cargo's compile-time features.
  • Keep unsafe minimal and isolated. Explain why safe Rust is insufficient and document validity, aliasing, lifetime, and synchronization obligations. Tests can find violations; they do not prove soundness.
  • Do not hold blocking locks across .await or block an async executor. Use the existing runtime and test cancellation/resource cleanup when relevant.
  • No blanket lint suppression, legacy compatibility layers, speculative abstractions, unrelated lockfile churn, or unmeasured performance claims.

Finish

Test public success, failure, boundaries, and supported flag combinations. Reproduce bugs when practical. Start with focused checks, then run the project's required suite. If no commands are defined and the lockfile is current:

cargo fmt --all -- --check
cargo test --locked
cargo clippy --locked --all-targets -- -D warnings

Use only supported feature/target combinations, not automatic --all-features. Report exact results and gaps. Do not add end-to-end tests or release builds unless requested or needed by the repository/task.

Read only when needed

  • Public exports, domain contexts/flags, error sources, or ownership decisions: contracts.
  • Workspace/MSRV/feature checks, strict Clippy, unsafe validation, or benchmarks: validation.

Do not preload references or evaluation files.

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.