go-practices
Go conventions for hexagonal architecture, project structure, error handling, testing, and observability. Use when writing Go services.
$ Installer
git clone https://github.com/eser/stack /tmp/stack && cp -r /tmp/stack/.claude/skills/go-practices ~/.claude/skills/stack// tip: Run this command in your terminal to install the skill
SKILL.md
name: go-practices description: Go conventions for hexagonal architecture, project structure, error handling, testing, and observability. Use when writing Go services.
go-practices
Quick Start
- Follow hexagonal architecture: business logic in
pkg/api/business/, adapters inpkg/api/adapters/ - Use snake_case for all Go files
- Wrap errors:
fmt.Errorf("%w: %w", ErrSentinelError, err) - Run tests with race detection:
go test -race ./...
Key Principles
- Business logic has NO external dependencies
- All external interactions through interfaces
- Composition via AppContext (composition root)
- Table-driven tests with
t.Parallel() - OpenTelemetry for observability
References
See rules.md for complete conventions.
