.claude/skills/ln-628-concurrency-auditor/SKILL.md
Concurrency audit worker (L3). Checks race conditions, missing async/await, resource contention, thread safety, deadlock potential. Returns findings with severity, location, effort, recommendations.
npx skillsauth add cbbkrd-tech/jl-finishes ln-628-concurrency-auditorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
Specialized worker auditing concurrency and async patterns.
Receives contextStore with tech stack, language, codebase root, output_dir.
shared/templates/audit_worker_report_template.md, write to {output_dir}/628-concurrency.md in single Write callWhat: Shared state modified without synchronization
Detection Patterns:
| Language | Pattern | Grep |
|----------|---------|------|
| Python | Global modified in async | global\s+\w+ inside async def |
| TypeScript | Module-level let in async | ^let\s+\w+ at file scope + async function modifies it |
| Go | Map access without mutex | map\[.*\].*= without sync.Mutex in same file |
| All | Shared cache | cache\[.*\]\s*= or cache\.set without lock |
Severity:
payment, balance, auth, token in variable name)Recommendation: Use locks, atomic operations, message queues
Effort: M-L
What: Callback hell or unhandled promises
Detection Patterns:
| Issue | Grep | Example |
|-------|------|---------|
| Callback hell | \.then\(.*\.then\(.*\.then\( | .then().then().then() |
| Fire-and-forget | async.*\(\) not preceded by await | saveToDb() without await |
| Missing await | return\s+new\s+Promise in async function | Should just return await or return value |
| Dangling promise | \.catch\(\s*\) | Empty catch swallows errors |
Severity:
Recommendation: Convert to async/await, always await or handle promises
Effort: M
What: Multiple processes competing for same resource
Detection Patterns:
| Issue | Grep | Example |
|-------|------|---------|
| File lock missing | open\(.*["']w["']\) without flock or lockfile | Concurrent file writes |
| Connection exhaustion | create_engine\(.*pool_size check if pool_size < 5 | DB pool too small |
| Concurrent writes | writeFile or fs\.write without lock check | File corruption risk |
Severity:
Recommendation: Use connection pooling, file locking, asyncio.Lock
Effort: M
What: Shared mutable state without synchronization
Detection Patterns:
| Language | Safe Pattern | Unsafe Pattern |
|----------|--------------|----------------|
| Go | sync.Mutex with map | map[...] without Mutex in same struct |
| Rust | Arc<Mutex<T>> | Rc<RefCell<T>> in multi-threaded context |
| Java | synchronized or ConcurrentHashMap | HashMap shared between threads |
| Python | threading.Lock | Global dict modified in threads |
Grep patterns:
type.*struct\s*{[^}]*map\[ without sync.Mutex in same structglobal\s+\w+ in function + threading.Thread in same fileSeverity: HIGH (data corruption possible)
Recommendation: Use thread-safe primitives
Effort: M
What: Lock acquisition in inconsistent order
Detection Patterns:
| Issue | Grep | Example |
|-------|------|---------|
| Nested locks | with\s+\w+_lock:.*with\s+\w+_lock: (multiline) | Lock A then Lock B |
| Lock in loop | for.*:.*\.acquire\(\) | Lock acquired repeatedly without release |
| Lock + external call | .acquire\(\) followed by await or requests. | Holding lock during I/O |
Severity: HIGH (deadlock freezes application)
Recommendation: Consistent lock ordering, timeout locks (asyncio.wait_for)
Effort: L
What: Synchronous blocking calls inside async functions
Detection Patterns:
| Blocking Call | Grep in async def | Replacement |
|---------------|---------------------|-------------|
| time.sleep | time\.sleep inside async def | await asyncio.sleep |
| requests. | requests\.(get\|post) inside async def | httpx or aiohttp |
| open() file | open\( inside async def | aiofiles.open |
Severity:
Recommendation: Use async alternatives
Effort: S-M
MANDATORY READ: Load shared/references/audit_scoring.md for unified scoring formula.
MANDATORY READ: Load shared/templates/audit_worker_report_template.md for file format.
Write report to {output_dir}/628-concurrency.md with category: "Concurrency" and checks: race_conditions, missing_await, resource_contention, thread_safety, deadlock_potential, blocking_io.
Return summary to coordinator:
Report written: docs/project/.audit/628-concurrency.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)
shared/templates/audit_worker_report_template.mdshared/references/audit_scoring.mdshared/references/audit_output_schema.mdshared/references/audit_scoring.md{output_dir}/628-concurrency.md (atomic single Write call)Version: 3.0.0 Last Updated: 2025-12-23
testing
When the user wants to plan a content strategy, decide what content to create, or figure out what topics to cover. Also use when the user mentions "content strategy," "what should I write about," "content ideas," "blog strategy," "topic clusters," or "content planning." For writing individual pieces, see copywriting. For SEO-specific audits, see seo-audit.
development
When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' or 'competitive landing pages.' Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. Emphasizes deep research, modular content architecture, and varied section types beyond feature tables.
development
Write B2B cold emails and follow-up sequences that get replies. Use when the user wants to write cold outreach emails, prospecting emails, cold email campaigns, sales development emails, or SDR emails. Covers subject lines, opening lines, body copy, CTAs, personalization, and multi-touch follow-up sequences.
development
When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' or 'involuntary churn.' This skill covers voluntary churn (cancel flows, save offers, exit surveys) and involuntary churn (dunning, payment recovery). For post-cancel win-back email sequences, see email-sequence. For in-app upgrade paywalls, see paywall-upgrade-cro.