Skip to content
Development
Command

/context-load-go-concurrency

Systematic Go concurrency documentation loading with comprehensive context analysis

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/context-load-go-concurrency

Context preview

What this command does when you run it.

Systematic Go concurrency documentation loading with comprehensive context analysis

Command definition

context-load-go-concurrency.md
allowed-tools: Task, WebFetch, Bash(fd:*), Bash(rg:*), Bash(gdate:*), Bash(git:*), mcp__context7__resolve-library-id, mcp__context7__get-library-docs
name: "Context Load Go Concurrency"
description: "Systematic Go concurrency documentation loading with comprehensive context analysis"
author: "wcygan"
tags: ["context","go"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

/context-load-go-concurrency

Context

  • Session ID: !`gdate +%s%N`
  • Current directory: !`pwd`
  • Go project files: !`fd "(go\.mod|go\.sum|\.go)$" . --max-depth 3 | head -10 || echo "No Go files detected"`
  • Git repository: !`git status --porcelain 2>/dev/null | wc -l | tr -d ' '` changes, branch: !`git branch --show-current 2>/dev/null || echo "No git repository"`
  • Go version: !`go version 2>/dev/null || echo "Go not installed"`
  • Existing concurrency code: !`rg "(goroutine|go func|chan|select)" --type go . | wc -l | tr -d ' '` concurrency patterns found
  • Go modules: !`fd "go\.mod" . --max-depth 2 | head -5 || echo "No Go modules found"`

Your Task

STEP 1: Context Loading Session Initialization

Think deeply about optimal Go concurrency documentation loading strategies and comprehensive pattern analysis.

  • Initialize context loading session: /tmp/context-go-concurrency-$SESSION_ID.json
  • Detect Go project characteristics and existing concurrency patterns
  • Create systematic documentation loading plan
  • Save checkpoint: session_initialized
// /tmp/context-go-concurrency-$SESSION_ID.json
{
  "sessionId": "$SESSION_ID",
  "target": "go-concurrency-patterns",
  "phase": "initialization",
  "project_context": {
    "has_go_files": false,
    "go_version": "unknown",
    "existing_patterns": [],
    "complexity_level": "unknown"
  },
  "loaded_sources": [],
  "context_analysis": {
    "patterns_covered": [],
    "examples_loaded": 0,
    "documentation_depth": "basic"
  },
  "checkpoints": {
    "session_initialized": "complete",
    "context_loading": "pending",
    "analysis_complete": "pending"
  }
}

STEP 2: Systematic Documentation Source Loading

TRY:

  • Use Context7 MCP server for structured Go concurrency documentation
  • Load comprehensive documentation from authoritative sources
  • Process and analyze documentation for pattern extraction
  • Update session state with loaded context

**Primary Documentation Sources Loading:**

FOR EACH source IN priority_sources:

1. **Go Official Documentation** (Context7 Integration):

  • Resolve Go library ID for concurrency documentation
  • Load comprehensive Go concurrency context
  • Focus on: goroutines, channels, select, context package

2. **Go by Example - Concurrency Patterns**:

  • URL: `https://gobyexample.com/`
  • Focus areas: goroutines, channels, select, worker pools, rate limiting
  • Extract executable examples and pattern analysis

3. **Effective Go - Concurrency Section**:

  • URL: `https://go.dev/doc/effective_go`
  • Focus areas: concurrency best practices, channel idioms, goroutine management

4. **Go Blog - Advanced Concurrency**:

  • URL: `https://go.dev/blog/`
  • Focus areas: concurrency patterns, pipelines, cancellation, context usage

5. **Go Concurrency Patterns Presentation**:

  • URL: `https://go.dev/talks/2012/concurrency.slide`
  • Focus areas: advanced patterns, select statement mastery, cancellation patterns

6. **Sync Package Documentation**:

  • URL: `https://pkg.go.dev/sync`
  • Focus areas: mutexes, wait groups, atomic operations, once patterns

Update session state after each successful source load.

CATCH (context7_unavailable):

  • Fall back to WebFetch tool for direct documentation loading
  • Continue with available documentation sources
  • Document missing Context7 capabilities in session state

CATCH (documentation_load_failure):

  • Log failed sources in session state
  • Continue with available documentation
  • Provide manual documentation loading guidance

STEP 3: Concurrency Pattern Analysis and Extraction

Think harder about Go concurrency pattern categorization and practical application strategies.

  • Analyze loaded documentation for key concurrency patterns
  • Extract executable code examples and best practices
  • Categorize patterns by complexity and use case
  • Create comprehensive pattern reference

**Pattern Categories to Extract:**

1. **Basic Goroutine Patterns**:

  • Goroutine spawning and lifecycle management
  • Anonymous function goroutines
  • Goroutine synchronization techniques

2. **Channel Communication Patterns**:

  • Unbuffered vs buffered channels
  • Channel direction restrictions
  • Channel closing and range patterns
  • Fan-in and fan-out patterns

3. **Select Statement Patterns**:

  • Non-blocking channel operations
  • Timeout and deadline patterns
  • Default case usage
  • Channel multiplexing

4. **Advanced Concurrency Patterns**:

  • Worker pool implementations
  • Pipeline architectures
  • Context-based cancellation
  • Graceful shutdown patterns

5. **Synchronization Primitives**:

  • Mutex and RWMutex usage
  • WaitGroup coordination
  • Atomic operations
  • sync.Once patterns

6. **Error Handling in Concurrent Code**:

  • Error propagation through channels
  • Context cancellation on errors
  • Graceful degradation patterns

Update session state with extracted patterns and examples.

STEP 4: Practical Implementation Guidance Generation

  • Generate practical implementation examples for common scenarios
  • Create decision trees for pattern selection
  • Provide performance considerations and best practices
  • Document common pitfalls and anti-patterns

**Implementation Decision Framework:**

## Concurrency Pattern Selection Guide

### When to Use Goroutines:

- I/O-bound operations that can run concurrently
- Independent tasks that don't require shared state
- Background processing and cleanup tasks

### When to Use Channels:

- Communication between goroutines
- Coordinating goroutine execution
-
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin