programming-go

Guide idiomatic Go architecture, error handling, and concurrency design.

3|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/Muvon/octomind-tap --skill programming-go-muvon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: programming-go
Source: https://github.com/Muvon/octomind-tap/tree/main/skills/programming-go
Command: npx skills add https://github.com/Muvon/octomind-tap --skill programming-go-muvon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design Go codebases that stay readable and maintainable by enforcing idiomatic architecture, safe error handling, and practical concurrency patterns.

Core Features & Use Cases

  • Idiomatic architecture guidance: Keeps package boundaries capability-driven (e.g., auth/billing) rather than layered (controllers/services).
  • Robust error handling: Uses error-as-values, wraps with %w, and encourages typed/sentinel error patterns for inspection.
  • Practical concurrency design: Promotes context-first I/O, disciplined goroutine lifecycles, and correct channel ownership semantics.
  • Standard-library-first implementation: Recommends net/http, encoding/json, and log/slog before pulling in frameworks.

Quick Start

Ask the AI to refactor your Go service design to be idiomatic: improve package boundaries, fix error-wrapping and sentinel/typed errors, and revise your concurrency and context usage according to Go best practices.

Frequently Asked Questions about programming-go

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

FAQPage Schema
How do I structure Go packages for maintainable long-lived services?

Structure Go packages by capability-driven boundaries like auth or billing rather than layered controllers and services. This idiomatic architecture keeps package boundaries clear and ensures your codebase stays readable and maintainable as the system grows.

What's the best way to handle errors in Go using wrapping and sentinel patterns?

Handle errors in Go by treating them as values, wrapping them with %w for proper error chains, and using typed or sentinel error patterns. This approach allows callers to inspect errors reliably using standard library functions like errors.Is and errors.As.

How do I prevent goroutine leaks and race conditions in Go concurrency?

Prevent goroutine leaks and race conditions by enforcing disciplined goroutine lifecycle management, using context-first I/O for cancellation, and establishing clear channel ownership semantics. This ensures safe parallel work without leaking resources or creating data races.

Should I use a web framework or the Go standard library for building APIs?

You should use the Go standard library first, utilizing net/http, encoding/json, and log/slog before pulling in external frameworks. This standard-library-first approach keeps dependencies minimal and aligns with idiomatic Go architecture.

How do I refactor an existing Go service to follow idiomatic architecture?

Refactor an existing Go service by asking the AI to improve package boundaries, fix error-wrapping with %w, implement sentinel or typed errors, and revise concurrency and context usage according to Go best practices.

Why does my Go service have race conditions when using channels and goroutines?

Race conditions in Go often occur due to unclear channel ownership semantics and undisciplined goroutine lifecycles. Fix them by establishing strict channel ownership rules, using context-first I/O for cancellation, and managing goroutine lifecycles to avoid concurrent access issues.