agentleFS
DankosikDankosik/rust-cli-skills/skills/rust-concurrency/SKILL.md

rust-concurrency

Skill0 starsChanged 2 months agoMITView on GitHub

Ownership. Use when Rust CLI threads, parallel iterators, async tasks, or shared state need capacity bounds, cancellation, ordering, or completion guarantees.

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rust-macros and rust-api-design.

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.
  • dawidpereiraSkill

    rust-macros

    Rust macros — macro_rules!, proc macros, derive macros, attribute macros, fragment specifiers, repetition, hygiene, cargo expand, when to use macros vs generics. Use when writing or debugging declarative or procedural macros, choosing between macros and other abstractions, understanding expansion errors, or generating repetitive code.

    Also in 3 projects that use this

  • adxptivedSkill

    rust-api-design

    Rust API Design guidelines, naming conventions, and best practices. Use when: - User is designing a library, crate, or public APIs - Implementing patterns like Builder, Typestate, or Extension traits - Designing public structures, enums, or traits - Working with common traits (From/Into, Default, AsRef, Debug, Clone) - Applying #[must_use] or #[non_exhaustive] attributes - Restricting trait implementation via Sealed Traits - Formatting naming structures and lifetime designs

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 1

    Distinctive

    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:

    Follow shared data and lock ownership.

    line 14

“Common” is measured: kept by at least 6 in 10 of the 6 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 Concurrency

Ownership. For the affected work, identify who admits it, observes failure, requests cancellation, and waits for completion. Honor supplied requirements and preserve settled choices outside the requested change; resolve only what the task leaves open.

Keep sequential work sequential when it meets the requirement. Use scoped threads or existing parallel facilities for useful overlap; Rayon can fit CPU data parallelism, while an async runtime needs concurrent waiting or an existing integration that warrants it. Async does not make CPU computation faster.

Bound active work, queues, and retained results together. Worker count alone does not limit buffered input or ordered output waiting behind a slow item. Choose granularity against scheduling and copying costs, available resources, and nested parallelism. Preserve ordering only where the contract requires it.

Follow shared data and lock ownership. Arc shares ownership, not synchronized mutation; Send and Sync do not establish atomic business operations or freedom from deadlock. Keep lock scope small and inspect guards held across blocking calls or await points.

Cancellation is cooperative. Make blocked sends, receives, I/O, and workers able to finish or unblock. Dropping a thread JoinHandle detaches it; await or join owned work and surface failures. Started Tokio spawn_blocking work cannot be aborted merely by aborting its task handle.

Install signal handling only when the command needs graceful interruption. Use supported facilities to notify normal execution rather than performing arbitrary cleanup in a raw signal handler. Release terminal state and owned resources before completion.

For review, explain ownership and termination risks without editing. For implementation, verify the relevant interruption, saturation, failure, or slow-consumer case with controlled coordination. A timer or clean compilation cannot prove termination; observe completion and leave no running test work. Expand beyond the affected path only for a concrete risk or required project check.

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.