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.
chat Comments (0)
Sign in to join the discussion and leave a comment.
Skill Details
GitHub Stars
58
GitHub Forks
24
Created
Mar 2026
Last Updated
7 months ago
development
development architecture patterns
Related Skills
Build your own?
Join 12,000+ developers contributing to the Claude ecosystem.
No comments yet. Be the first to share your thoughts!