race-condition-hunter

Detects read-decision-write sequences lacking atomicity that violate invariants under concurrent requests.

Updated Aug 29, 2026
One-click install
npx skills add https://github.com/1arley/volibear --skill race-condition-hunter-1arley
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: race-condition-hunter
Source: https://github.com/1arley/volibear/tree/main/.opencode/skills/race-condition-hunter
Command: npx skills add https://github.com/1arley/volibear --skill race-condition-hunter-1arley

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Concurrent requests that read shared state, decide based on that read, and then write can silently violate business invariants like balance limits, quotas, and uniqueness. This Skill guides an agent to systematically find these race condition windows before they cause double-spends, over-limit grants, or duplicate records in production. ## Core Features & Use Cases - Pattern Detection: Maps READ → DECISION → WRITE sequences and identifies the shared state and invariant each decision protects. - Interleaving Analysis: Models how two simultaneous requests can both pass a check-then-act gate, and verifies whether defenses like CAS, SELECT FOR UPDATE, unique constraints, or serializable transactions close the window. - Confidence-Graded Reporting: Classifies findings as CONFIRMED, HIGH CONFIDENCE, POSSIBLE, or SPECULATIVE with structured audit-report output. - Use Case: While reviewing a wallet debit endpoint, the Skill traces the balance check and deduction, shows that two concurrent requests both read balance=100 and both write balance=50, and recommends a conditional UPDATE or SELECT FOR UPDATE as the fix. ## Quick Start Ask the agent to audit the checkout or balance-debit flow for race conditions where two simultaneous requests could both pass the same check.

Frequently Asked Questions about race-condition-hunter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find race conditions in my application code?▼

Map every operation that reads state, decides based on the read, and writes back. Then check whether two concurrent requests could both pass the decision before either writes, and whether a lock, conditional update, or constraint closes that window.

What is a check-then-act race condition?▼

A check-then-act race occurs when code reads state, verifies a condition like sufficient balance, and writes later without atomicity. Two requests can both pass the check on the same stale read, causing double-spends or over-limit grants.

Does a database transaction prevent race conditions?▼

Not automatically. A transaction only groups queries; without SELECT FOR UPDATE, serializable isolation, or a conditional WHERE clause, concurrent transactions can still interleave reads and writes and violate the invariant.

When is a race condition finding a false positive?▼

Findings are false positives when a conditional UPDATE guards the read value, a unique constraint blocks duplicates, increments are atomic, or each request operates on its own isolated row rather than shared state.

How do I fix a double-spend race condition in a balance debit?▼

Prefer database-level defenses: use a conditional UPDATE with a WHERE clause on the read value, SELECT FOR UPDATE inside a transaction, or atomic decrement. The database should be the last line of defense rather than application-level locks.