From backend-golang
Use when writing or reviewing Go code — enforces idiomatic Go patterns including error handling with explicit checks, interface-based design, goroutine safety, naming conventions, and effective Go principles
How this skill is triggered — by the user, by Claude, or both
Slash command
/backend-golang:golang-codingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
| Element | Convention | Example |
| Element | Convention | Example |
|---|---|---|
| Package | lowercase, single word | order, payment, auth |
| Exported func/type | PascalCase | CreateOrder, OrderService |
| Unexported | camelCase | validateItems, orderRepo |
| Interface | -er suffix for single method | Reader, Writer, OrderRepository |
| Acronyms | All caps | HTTPClient, UserID, APIURL |
| Receiver | 1-2 letter abbreviation | func (s *OrderService) Create(...) |
// Good — always check errors explicitly
result, err := repo.FindByID(ctx, id)
if err != nil {
return fmt.Errorf("find order %d: %w", id, err)
}
// Bad — ignoring errors
result, _ := repo.FindByID(ctx, id)
err != nil immediately after the callfmt.Errorf("context: %w", err)errors.Is() and errors.As() for error inspectionvar ErrNotFound = errors.New("not found")panic for expected errors — only for programmer bugsio.Reader, io.Writer from stdlib where possible// Good — interface at consumer, small
type OrderRepository interface {
FindByID(ctx context.Context, id int64) (*Order, error)
Save(ctx context.Context, order *Order) error
}
// Bad — large interface defined at implementation
type OrderStore interface {
FindByID(...) ...
FindAll(...) ...
Save(...) ...
Delete(...) ...
Count(...) ...
// too many methods
}
context.Contextcontext.WithTimeout for external callssync.WaitGroup or errgroup.Group for goroutine lifecyclecontext.Context for cancellationg, ctx := errgroup.WithContext(ctx)
for _, item := range items {
item := item // capture loop variable
g.Go(func() error {
return processItem(ctx, item)
})
}
if err := g.Wait(); err != nil {
return fmt.Errorf("process items: %w", err)
}
Order{ID: 1, Name: "test"}var buf bytes.Buffer — ready to useok pattern for maps: val, ok := m[key]npx claudepluginhub gagandeepp/software-agent-teams --plugin backend-golangGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.