Skip to content
Back to skills

Concurrency And Async Correctness

ASecurity

Use when writing or fixing concurrent or async code - threads, async/await, tasks, locks, retries, cancellation, timeouts, or shared mutable state.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 23, 2026
ai-agents

Security analysis

A100/100

Scanned November 23, 2026

npx -y skills add Kushagrabainsla/north --skill concurrency-and-async-correctness --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Concurrency And Async Correctness?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Concurrency And Async Correctness
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kushagrabainsla-concurrency-and-async-correctness/badge)](https://www.skillsdirectory.com/skills/kushagrabainsla-concurrency-and-async-correctness)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: concurrency-and-async-correctness
description: "Use when writing or fixing concurrent or async code - threads, async/await, tasks, locks, retries, cancellation, timeouts, or shared mutable state."
---
# Concurrency and async correctness

> **Assume every interleaving happens; shared mutable state without a guard is a race.**

## Use this when
- The change involves threads, asyncio tasks, locks, background jobs, retries, cancellation, or timeouts.

## Do NOT use for
- Single-threaded, synchronous logic.

## Procedure
1. Identify shared state and who writes it. Make it immutable, or guard it with a lock/queue.
2. Avoid mutable default arguments and module-global accumulation across calls.
3. For every `await` / blocking call, define its timeout and its cancellation behaviour.
4. Release resources on every path (use context managers / `finally`).
5. Make retries idempotent.
6. Test the contended, cancelled, and timed-out paths - not just the sequential one.

## Done when
- Shared state is guarded, cancellation/timeouts are defined, and a concurrency-stressing test passes.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.