go-coding-patterns

Apply Go coding patterns for concurrency, context propagation, and error contracts.

33|6|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/CraftsMan-Labs/SimpleAgents --skill go-coding-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-coding-patterns
Source: https://github.com/CraftsMan-Labs/SimpleAgents/tree/main/.opencode/skills/go-coding-patterns
Command: npx skills add https://github.com/CraftsMan-Labs/SimpleAgents --skill go-coding-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go development often suffers from unreliable concurrency, scattered context handling, and weak error propagation, leading to brittle services and maintenance challenges. This Skill provides a structured approach to enforce disciplined concurrency, explicit context propagation, and coherent error contracts, delivering review-ready architecture across services, workers, CLIs, and shared packages.

Core Features & Use Cases

  • Production-grade Go with disciplined concurrency, explicit context propagation, coherent error contracts, and review-ready architecture.
  • Use cases include implementing new Go services, debugging complex goroutine interactions, refactoring for performance, and performing code reviews across services, workers, CLIs, and shared libraries.
  • Example scenarios emphasize safe goroutine lifecycles, bounded channel usage, and robust error wrapping in distributed Go applications.

Quick Start

Apply Go coding patterns to implement a sample module that demonstrates disciplined concurrency, explicit context handling, and robust error wrapping.

Frequently Asked Questions about go-coding-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle context propagation and error wrapping in Go services?

Context propagation and error wrapping in Go services require explicit context passing and coherent error contracts. Applying established coding patterns ensures robust error tracking and reliable request-scoped data flow across distributed services.

What is the best way to manage goroutine lifecycles and bounded channels?

Managing goroutine lifecycles and bounded channels demands disciplined concurrency patterns to prevent leaks and deadlocks. Structured Go coding patterns enforce safe goroutine execution and bounded channel usage for stable concurrent processing.

How do I refactor Go code for performance and review-ready architecture?

Refactoring Go code for performance and review-ready architecture involves applying coherent error contracts and disciplined concurrency. Established patterns transform brittle services and shared packages into maintainable, production-grade modules.

Can I use these Go patterns for CLIs and shared packages?

Yes, these Go patterns apply across services, workers, CLIs, and shared packages. They enforce explicit context propagation and robust error wrapping regardless of the module type, ensuring review-ready architecture.

Why does scattered context handling cause maintenance challenges in Go?

Scattered context handling causes maintenance challenges because it breaks explicit context propagation and weakens error contracts. Disciplined Go coding patterns resolve this by enforcing coherent error wrapping and explicit data flow.

How do I debug complex goroutine interactions in Go workers?

Debugging complex goroutine interactions in Go workers involves applying disciplined concurrency patterns to identify unsafe lifecycles and unbounded channels. Established patterns provide structured approaches to resolve brittle interactions.