leoyeai/openclaw-master-skills/phy-concurrency-audit
Claude Code and agent skill by leoyeai/openclaw-master-skills
- community
Checking that the SKILL.md file is still in the repository.
Static concurrency and race-condition auditor for Go, Java, Python, Node.js/TypeScript. Detects shared-state mutations without locks (Go map races, Java non-atomic increments, Python thread/asyncio shared lists), TOCTOU (time-of-check-time-of-use) patterns across all languages, sync.Mutex copied by value, WaitGroup.Add inside goroutines, SimpleDateFormat as instance field, double-checked locking without volatile, asyncio shared state without Lock. Maps findings to CWE-362 (race condition) and CWE-367 (TOCTOU). Zero competitors on ClawHub — not a single concurrency-audit SKILL.md in 13,700+ files.
Install
npx vskill@latest install leoyeai/openclaw-master-skills/phy-concurrency-auditSKILL.md
The same SKILL.md was published earlier as leoyeai/openclaw-master-skills/phy-concurrency-audit.
phy-concurrency-audit
Static scanner for race conditions (CWE-362) and TOCTOU vulnerabilities (CWE-367) in Go, Java, Python, and Node.js/TypeScript codebases. Finds shared-state mutations without synchronization, unsafe concurrency patterns, and check-then-act anti-patterns. Zero external API calls, zero dependencies beyond Python 3 stdlib.
Why Concurrency Bugs Are Special
- Non-deterministic: reproduce only under load, on multi-core machines, or on specific OS schedulers
- Silent corruption: data races don't crash immediately — they corrupt state silently for hours
- Security impact: TOCTOU races in file ops enable symlink attacks and privilege escalation (CWE-367)
- Hard to test: even
go test -raceonly finds races that actually execute during the test run - Static analysis catches the ones that never trigger in testing
What It Detects
Go Race Conditions
| Pattern | Severity | CWE | |
|---|---|---|---|
Global map variable read/written in concurrent functions | CRITICAL | CWE-362 | |
sync.Mutex or sync.RWMutex copied by value after first use | HIGH | CWE-362 | |
sync.WaitGroup.Add() called inside a goroutine | HIGH | CWE-362 | |
| Package-level slice/map mutated without mutex | HIGH | CWE-362 | |
atomic.Value used without checking type consistency | MEDIUM | CWE-362 | |
Missing sync.Once for lazy singleton initialization | MEDIUM | CWE-362 | |
| Struct fields accessed in goroutines without receiver mutex | HIGH | CWE-362 |
Java Thread-Safety Violations
| Pattern | Severity | CWE | |
|---|---|---|---|
count++ / i++ on shared instance/static field without synchronized or AtomicInteger | HIGH | CWE-362 | |
HashMap or ArrayList as instance field in class with concurrent methods | HIGH | CWE-362 | |
SimpleDateFormat as static or instance field (not thread-safe) | HIGH | CWE-362 | |
Double-checked locking without volatile keyword | HIGH | CWE-362 | |
synchronized block on non-final field (lock can change) | MEDIUM | CWE-362 | |
Vector/Hashtable used (thread-safe but deprecated, miss modern happens-before) | LOW | CWE-362 | |
Calendar.getInstance() result stored as field | MEDIUM | CWE-362 |
Python Threading & Asyncio
| Pattern | Severity | CWE | |
|---|---|---|---|
Thread function mutating module-level list/dict without threading.Lock | HIGH | CWE-362 | |
counter += 1 / list.append() on global var in thread without lock | HIGH | CWE-362 | |
asyncio coroutine mutating shared object without asyncio.Lock | HIGH | CWE-362 | |
multiprocessing.Process sharing mutable list/dict without Manager | HIGH | CWE-362 | |
threading.Thread target accessing global without lock | HIGH | CWE-362 |
Node.js / TypeScript Async Races
| Pattern | Severity | CWE | |
|---|---|---|---|
Module-level object/array mutated inside async request handler | HIGH | CWE-362 | |
TOCTOU: await cache.has(key) followed by await cache.get(key) | HIGH | CWE-367 | |
Counter increment count++ in async handler (non-atomic) | MEDIUM | CWE-362 | |
| Promise chain modifying shared closure variable | MEDIUM | CWE-362 |
TOCTOU Patterns (All Languages)
| Pattern | Severity | CWE | |
|---|---|---|---|
os.path.exists(path) followed by open(path) without lock | HIGH | CWE-367 | |
os.path.isdir(d) then os.makedirs(d) without exist_ok=True | MEDIUM | CWE-367 | |
os.path.exists then os.rename/remove/chmod | HIGH | CWE-367 | |
if not User.exists() then User.create() — DB check-then-insert | HIGH | CWE-367 | |
Java File.exists() then new FileOutputStream(file) | HIGH | CWE-367 | |
Node.js fs.existsSync() then fs.writeFileSync() | HIGH | CWE-367 | |
Go os.Stat(path) check then os.Open(path) | HIGH | CWE-367 |
Implementation
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/phy-concurrency-audit/SKILL.md
Popularity
- Repository stars
- 2,157
- Repository forks
- 324
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/leoyeai/openclaw-master-skills/phy-concurrency-audit)