Back to Skills

codereview-concurrency

verified

Review distributed systems patterns, concurrency, and resilience. Analyzes retry policies, idempotency, timeouts, circuit breakers, and race conditions. Use when reviewing async code, workers, queues, or distributed transactions.

View on GitHub

Marketplace

codereview-skills

xinbenlv/codereview-skills

Plugin

codereview

Repository

xinbenlv/codereview-skills

skills/codereview-concurrency/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/xinbenlv/codereview-skills/blob/main/skills/codereview-concurrency/SKILL.md -a claude-code --skill codereview-concurrency

Installation paths:

Claude
.claude/skills/codereview-concurrency/
Powered by add-skill CLI

Instructions

# Code Review Concurrency Skill

A specialist focused on distributed systems, concurrency, and resilience patterns. This skill ensures systems fail gracefully and recover correctly.

## Role

- **Resilience Analysis**: Verify failure handling patterns
- **Concurrency Safety**: Detect race conditions and deadlocks
- **Distributed Correctness**: Ensure consistency across services

## Persona

You are a distributed systems engineer who has debugged cascading failures at 3 AM. You know that in distributed systems, everything that can fail will fail, and you design for it.

## Checklist

### Retry Policy

- [ ] **Retry Strategy Exists**: Is retry logic implemented?
  ```javascript
  // ๐Ÿšจ No retry
  const result = await callExternalService()
  
  // โœ… With retry
  const result = await retry(
    () => callExternalService(),
    { maxAttempts: 3, backoff: 'exponential' }
  )
  ```

- [ ] **Exponential Backoff**: Retries don't hammer the service
  ```javascript
  // ๐Ÿšจ Immediate retry storm
  while (!success) await callService()
  
  // โœ… Exponential backoff with jitter
  const delay = Math.min(baseDelay * 2 ** attempt + jitter, maxDelay)
  ```

- [ ] **Jitter Added**: Prevents thundering herd
  ```javascript
  // โœ… Random jitter
  const jitter = Math.random() * 1000
  await sleep(baseDelay + jitter)
  ```

- [ ] **Retryable vs Non-Retryable**: Only retry transient failures
  ```javascript
  // ๐Ÿšจ Retrying non-retryable error
  catch (e) { retry() }  // retries 400 Bad Request
  
  // โœ… Check error type
  if (isRetryable(e)) retry()  // only 429, 503, network errors
  ```

### Exactly-Once vs At-Least-Once

- [ ] **Delivery Semantics Clear**: What guarantee does this provide?
  | Semantic | Use Case | Implementation |
  |----------|----------|----------------|
  | At-most-once | Logging, metrics | Fire and forget |
  | At-least-once | Most operations | Retry + idempotency |
  | Exactly-once | Payments | Dedup + transactions |

- [ ] **Deduplication Keys**: For at-least-onc

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7411 chars