Agent skill

Concurrency Safety

by r3bl-org in r3bl-org/r3bl-open-core

Concurrency safety patterns for R3BL - Chain of Custody, Loud Lock Releases, and Ergonomic Atomics.

Apache-2.0Auto-check passedDevelopment

Install Concurrency Safety

skills CLI
$ npx skills add r3bl-org/r3bl-open-core --skill concurrency-safety -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install r3bl-org/r3bl-open-core concurrency-safety --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/concurrency-safety .claude/skills/concurrency-safety && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
concurrency-safety
GitHub stars
485
Token cost
~903 tokens
SKILL.md length
433 words
Files
2
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Concurrency safety patterns for R3BL - Chain of Custody, Loud Lock Releases, and Ergonomic Atomics.

  • Works in 5 steps: Scoped Access (Deadlock Prevention) → Chain of Custody (Guard Passing) → Loud Lock Releases → …
  • Working with threads
  • SKILL.md covers When to Use, Core Principles, Supporting Files and Related Skills
  • Calls cargo

What it does

Concurrency Safety is an agent skill from r3bl-org/r3bl-open-core. Concurrency safety patterns for R3BL - Chain of Custody, Loud Lock Releases, and Ergonomic Atomics. Use when working with threads, locks, or atomics.

Its SKILL.md is about 900 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `patterns.md`).

It sits in Development, covering Async programming. The repository describes itself as: TUI framework and developer productivity apps in Rust 🦀. The licence is Apache-2.0.

When your agent uses it

  • Working with threads
  • Tasks that involve Async programming

Example prompts

  • “/concurrency-safety”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Scoped Access (Deadlock Prevention)
  2. Chain of Custody (Guard Passing)
  3. Loud Lock Releases
  4. Friction as a Feature (Ergonomic API Design)
  5. Visibility for Documentation

What it can do on your machine

Read from SKILL.md and the folder at commit 89db352. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Concurrency Safety loads about 903 tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 433 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~903

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from r3bl-org/r3bl-open-core at commit 89db352, republished under its Apache-2.0 licence (© r3bl-org). 433 words, ~903 tokens.

Download SKILL.mdSave it as .claude/skills/concurrency-safety/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
concurrency-safety
description
Concurrency safety patterns for R3BL - Chain of Custody, Loud Lock Releases, and Ergonomic Atomics. Use when working with threads, locks, or atomics.

Concurrency Safety Skill

Apply these principles to ensure thread safety, prevent deadlocks, and maintain high-performance, predictable execution in multi-threaded code.

When to Use

  • Proactively when working with Mutex, RwLock, Atomic, or Condvar.
  • When designing thread-safe modules like Reactor, Monitor, or Engine.
  • When refactoring state management to use AtomicU8Ext.
  • When troubleshooting deadlocks or race conditions.

Core Principles

1. Scoped Access (Deadlock Prevention)

For simple shared state, use closure-based access to structurally prevent deadlocks by making it impossible to hold a lock guard longer than necessary.

Guidelines:

  • Closure-Based Access: Restrict state access to closures. The closure's scope is the lock's scope.
  • Recursion Detection: Use recursion detection (Safety-First) to prevent terminal-hanging deadlocks. Panic with a clear message if a recursive lock is detected.
  • Performance Opt-out: For hot paths, opt-out of recursion detection at compile-time for zero overhead.
  • Fail-Fast vs. Poison-Safe: Use Fail-Fast (panic) for normal logic, but Poison-Safe (recover) for cleanup paths to avoid Double Panic Aborts.
2. Chain of Custody (Guard Passing)

For complex state machines requiring Condvar, ensure linear ownership of locks by passing and returning MutexGuard by value.

Guidelines:

  • Pass MutexGuard as a parameter to internal helper functions to guarantee they operate within an existing critical section.
  • Return MutexGuard from state-reading closures (e.g., read_state) to force the caller to be intentional about the lock's lifetime.
  • Avoid "Stale Guards" by ensuring the guard is either consumed or explicitly dropped.
Show full SKILL.md (205 more words)Show less
3. Loud Lock Releases

Make critical section boundaries explicit and easy to audit by using drop(guard).

Guidelines:

  • Explicit Release: Always call drop(guard) immediately when a critical section ends, especially before function returns, macro calls, or long-running operations.
  • Auditability: Explicit drops make it clear to reviewers (and the compiler) exactly where a lock is held, preventing accidental deadlocks during refactoring.
  • No Implicit Drops: Do not rely on scope-based implicit drops for complex logic or when calling into external code/macros.
4. Friction as a Feature (Ergonomic API Design)

Design APIs that make it harder to mismanage concurrency.

Guidelines:

  • Type-Safe Subscriptions: Use specific enums (like SubscriptionStrategy) instead of generic types to map thread states to execution paths at compile time.
  • Ergonomic Atomics: Always use AtomicU8Ext (e.g., get(), set(), increment()) instead of raw load()/store() with manual Ordering.
5. Visibility for Documentation

Balance encapsulation with discoverability for documentation.

Guidelines:

  • Make internal fields pub if they are targets of public documentation links.
  • Rely on the "Barrel Export" pattern (mod.rs re-exports) to maintain actual module-level encapsulation while allowing cargo doc to resolve links correctly.

Supporting Files

  • patterns.md - Good and Bad examples of concurrency safety patterns.
  • design-philosophy - Core principles (Cognitive Load, Progressive Disclosure).
  • check-code-quality - Includes concurrency safety in its final checklist.

© r3bl-org, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/concurrency-safety of r3bl-org/r3bl-open-core.

  • SKILL.md
  • patterns.md

Open the folder on GitHubat commit 89db352

Compare with similar skills

Concurrency Safety next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Concurrency Safety compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Concurrency Safety this skillr3bl-org/r3bl-open-core485—~903Automated safety check: PassApache-2.0
YugabyteDB ASH Instrumentationyugabyte/yugabyte-db11k—~4.5kAutomated safety check: PassCustom licence
Mirage VFS Adapter Authoringstrukto-ai/mirage3.7k—~2.4kAutomated safety check: PassApache-2.0
Golang Patternsantoniopaya22/go-rest-template1729 repos~3.5kAutomated safety check: PassNone
Rust Async Patternsdiodeme/Gold-Band14310 repos~3.1kAutomated safety check: PassAGPL-3.0
Swift Concurrencyhenrypldev/react-native-nitro-mlx1003 repos~3.1kAutomated safety check: PassMIT

Similar skills

  • YugabyteDB ASH Instrumentation

    yugabyte/yugabyte-db

    Procedure for adding or changing YugabyteDB Active Session History wait states in TServer and DocDB C++ code, including the macro to use for sync and async paths.

    11k GitHub stars~4.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Builds or extends a custom Mirage virtual filesystem adapter for an API, database, object store or app data, with a working mount configuration and filesystem tests.

    3.7k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Golang Patterns

    antoniopaya22/go-rest-template

    Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.

    172 GitHub starsUsed in 9 repos~3.5k tokens
    DevelopmentAuto-check passed
  • Rust Async Patterns

    diodeme/Gold-Band

    Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns.

    143 GitHub starsUsed in 10 repos~3.1k tokens
    DevelopmentAuto-check passed
  • Swift Concurrency

    henrypldev/react-native-nitro-mlx

    Diagnose Swift Concurrency issues, refactor callback-based code to async/await, and guide Swift 6 migration when working with tasks, actors, @MainActor, Sendable, data races, thread safety, or…

    100 GitHub starsUsed in 3 repos~3.1k tokens
    DevelopmentAuto-check passed
  • Rust Engineer

    farm-fe/farm

    Writes, reviews, and debugs idiomatic Rust code with memory safety and zero-cost abstractions.

    5.6k GitHub starsUsed in 1 repo~1.5k tokens
    DevelopmentAuto-check passed

More from r3bl-org/r3bl-open-core

All 25 skills in this repo
  • Analyze Log Files

    r3bl-org/r3bl-open-core

    Analyze log files by stripping ANSI escape sequences first. An agent skill from r3bl-org/r3bl-open-core.

    485 GitHub stars~632 tokensUpdated yesterday
    Auto-check: notes
  • Analyze Performance

    r3bl-org/r3bl-open-core

    Establish performance baselines and detect regressions using flamegraph analysis.

    485 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Check Bounds Safety

    r3bl-org/r3bl-open-core

    Apply type-safe bounds checking patterns using VPIndex/VPLength types instead of usize.

    485 GitHub stars~4.1k tokensUpdated yesterday
    Auto-check passed
  • Release Crate

    r3bl-org/r3bl-open-core

    Publish a crate release to crates.io with changelog, standalone release notes, git tag, and GitHub release.

    485 GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Organize Modules

    r3bl-org/r3bl-open-core

    Apply private modules with public re-exports (barrel export) pattern for clean API design.

    485 GitHub stars~5.8k tokensUpdated yesterday
    Auto-check passed
  • Check Code Quality

    r3bl-org/r3bl-open-core

    Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests.

    485 GitHub stars~3.8k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Concurrency Safety

What does Concurrency Safety do?

Concurrency safety patterns for R3BL - Chain of Custody, Loud Lock Releases, and Ergonomic Atomics. Concurrency Safety is an agent skill from r3bl-org/r3bl-open-core. Concurrency safety patterns for R3BL - Chain of Custody, Loud Lock Releases, and Ergonomic Atomics.

When should I use Concurrency Safety?

Concurrency Safety fits situations like: working with threads; tasks that involve Async programming.

How do I install Concurrency Safety in Claude Code?

Run `npx skills add r3bl-org/r3bl-open-core --skill concurrency-safety -a claude-code`. Or copy the skill folder (.agents/skills/concurrency-safety in r3bl-org/r3bl-open-core) into .claude/skills/concurrency-safety in your project. Claude Code loads it when a task matches its description.

How do I install Concurrency Safety in Codex?

Run `npx skills add r3bl-org/r3bl-open-core --skill concurrency-safety -a codex`. Or copy the skill folder (.agents/skills/concurrency-safety in r3bl-org/r3bl-open-core) into .agents/skills/concurrency-safety in your project. Codex loads it when a task matches its description.

Can I use Concurrency Safety in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add r3bl-org/r3bl-open-core --skill concurrency-safety -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/concurrency-safety, .gemini/skills/concurrency-safety, .github/skills/concurrency-safety and .opencode/skills/concurrency-safety in your project.

What does Concurrency Safety need to run?

Going by SKILL.md and its folder, Concurrency Safety needs the command-line tools its instructions call (cargo).

Does Concurrency Safety access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Concurrency Safety safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Concurrency Safety use?

Concurrency Safety is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Concurrency Safety use?

About 903 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Concurrency Safety?

Skills that share tags, products or a category with Concurrency Safety: YugabyteDB ASH Instrumentation (yugabyte/yugabyte-db, 11k stars), Mirage VFS Adapter Authoring (strukto-ai/mirage, 3.7k stars), Golang Patterns (antoniopaya22/go-rest-template, 172 stars) and Rust Async Patterns (diodeme/Gold-Band, 143 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Concurrency Safety?

r3bl-org (a GitHub organization) maintains it in r3bl-org/r3bl-open-core, which has 485 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 9, 2026.

Source: r3bl-org/r3bl-open-core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.