Concurrency
A ruthlessly strict algorithmic optimization methodology for AI coding agents. Forces your agent to profile, benchmark, and mathematically prove performance gains before writing code.
npx -y skills add v0idOS/performance-deity --skill concurrencyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Detect and fix race conditions and deadlocks. Fires thousands of concurrent requests to prove thread-unsafety, then applies the minimal synchronization primitive needed.
SKILL.md
1.4 KB, as published. Nobody here has run it
Execute all four phases in order.
Phase 1 — Chaos Script
Write a test that fires ≥1,000 concurrent async requests or threads at the target function simultaneously. The test must assert the final state deterministically (e.g. if a counter is incremented 1,000 times, assert counter === 1000).
Phase 2 — Failure Verification
Run the test. If it passes consistently:
- Increase concurrency to 10,000.
- Add
sleep()calls mid-execution to force thread context switching.
Prove the function is unsafe before fixing it. Do not add synchronization to code that has not been shown to fail.
Phase 3 — Synchronization
Implement the minimal synchronization primitive needed (prefer in this order):
- Atomic operations (e.g.
Atomics.add,atomic.AddInt64,std::atomic) - Mutex / Lock with the smallest possible critical section
- Semaphore only if mutual exclusion alone is insufficient
Do not hold a lock across any I/O operation.
Phase 4 — Report
Re-run the test with 10,000 concurrent requests. Report the pass/fail counts.
| Metric | Before | After |
|---|---|---|
| Failures at 1k concurrent | N | 0 |
| Failures at 10k concurrent | N | 0 |
The target is 0 failures.