go-stack

Guides Go code design with explicit error handling, concurrency discipline, and narrow interfaces.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/astroville/sprout --skill go-stack-astroville
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: go-stack
Source: https://github.com/astroville/sprout/tree/main/.claude/skills/go-stack
Command: npx skills add https://github.com/astroville/sprout --skill go-stack-astroville

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Go codebases often drift toward bloated packages, interface-first overdesign, goroutine leaks, and unclear error handling. This Skill provides consistent guidance for writing Go code that stays simple, traceable, and safe in production. ## Core Features & Use Cases - Package Design Guidance: Keeps packages small with clear responsibilities and narrow, justified interfaces. - Error Handling & Control Flow: Enforces explicit error handling and direct control flow instead of hidden abstractions. - Concurrency Guardrails: Promotes consistent context usage for cancellation and deadlines while flagging goroutine leaks, data races, blocking behavior, and retry mistakes. - Use Case: When implementing a new Go service or reviewing a pull request, apply this guidance to decide whether an interface is justified, whether concurrency actually helps, and whether errors are handled explicitly. ## Quick Start Review my Go package for interface overuse, goroutine leaks, and missing context propagation using the go-stack guidance.

Frequently Asked Questions about go-stack

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

FAQPage Schema
How do I structure Go packages for maintainability?▼

Keep packages small with a single clear responsibility, and avoid splitting code by technical layer alone. Add interfaces only when a real substitution need exists, not as a default design step.

How should I handle errors in Go code?▼

Handle errors explicitly at each call site with direct control flow rather than hiding them behind abstractions. Return errors to the caller who can act on them, and keep the handling path easy to trace.

When should I use goroutines and channels in Go?▼

Add concurrency only where it clearly helps, such as parallel I/O or independent work units. Always pair goroutines with context-based cancellation and deadlines so they terminate predictably.

How do I prevent goroutine leaks and data races in Go?▼

Ensure every goroutine has a defined exit path, typically via context cancellation or closed channels. Protect shared state with clear ownership or synchronization, and watch for blocking sends and unbounded retries.

When is interface-first design a mistake in Go?▼

Interface-first design is a mistake when there is no real substitution need, such as multiple implementations or test doubles. Prefer concrete types first and extract narrow interfaces only when a consumer requires them.