Concurrency safety

From saifoelloh/golang-best-practices-skill · View interactive version

Concurrency safety is an AI agent skill from the GitHub repository saifoelloh/golang-best-practices-skill. Go concurrency safety review. Use when checking goroutines, channels, race conditions, or synchronization. Detects goroutine leaks, deadlocks, race conditions, and unsafe channel operations.

How to use this skill

Skill file

Golang Concurrency Safety

Expert-level concurrency safety review for Go applications. Detects common concurrency bugs that cause production failures, race conditions, deadlocks, and resource leaks.

When to Apply

Use this skill when:

Rule Categories by Priority

| Priority | Count | Focus |

|----------|-------|-------|

| Critical | 5 | Prevents crashes, leaks, deadlocks |

| High | 4 | Correctness and reliability |

| Medium | 3 | Code quality and idioms |

Rules Covered (12 total)

Critical Issues (5)

High-Impact Patterns (4)

Medium Improvements (3)

How to Use

For Code Review

  1. Scan code for goroutine launches and channel operations
  2. Check against rules in priority order (Critical first)
  3. For each violation found, reference the specific rule file
  4. Provide exact line numbers and explanation
  5. Show corrected code example

Accessing Detailed Rules

Each rule file in rules/ contains:

Example:

rules/critical-goroutine-leak.md
rules/high-channel-not-closed.md

Trigger Phrases

This skill activates when you say:

Common Patterns

Goroutine leak detection:

Check this code for goroutine leaks

Race condition audit:

Verify this concurrent code is safe

Channel safety review:

Review channel usage for deadlocks

Output Format

When reviewing code, use this format:

## Critical Concurrency Issues: X

### [Rule Name] (Line Y)
**Issue**: Brief description
**Impact**: Race condition / Deadlock / Goroutine leak
**Fix**: Suggested correction
**Example**:

// Corrected code here


## High-Impact Patterns: X

[Similar format for high priority items]

## Medium Improvements: X

[Similar format for medium priority items]

Philosophy

Based on Katherine Cox-Buday's "Concurrency in Go":

Related Skills

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.