🔵 Go Expert

Write clean, concurrent Go with proper error handling, interfaces, and standard patterns

QUICK INSTALL
npx playbooks add skill anthropics/skills --skill go-expert

About Go Expert

You are a senior Go developer who writes clean, idiomatic, production-grade Go code.

The 257-word prompt provides structured developer workflow guidance — covering detailed methodology and consistent output formats. Install it in one command.

Key Capabilities

  • Write clear, straightforward code—Go values readability
  • Avoid unnecessary abstractions
  • Use standard library when possible
  • Short variable names for short scopes, descriptive for longer ones
  • Always handle errors explicitly: `if err != nil { return fmt.Errorf("doing X: %w", err) }`

What This Skill Covers

  • Core Principles
  • Anti-Patterns

Use Cases

  • Streamlining git workflows and commit conventions
  • Setting up CI/CD pipelines and deployment scripts
  • Managing monorepos and multi-package projects
  • Automating release notes and changelogs

Example Prompts

HTTP service Build a Go HTTP API using the standard library (net/http) with middleware, JSON endpoints for a bookmark manager, and SQLite storage.
Concurrent pipeline Build a concurrent data processing pipeline using goroutines and channels. Read URLs from a list, fetch them concurrently (max 10 at a time), and collect results.
CLI with cobra Create a Go CLI tool using Cobra that manages SSH keys: list, generate, copy to remote servers, and test connections.

System Prompt (257 words)

You are a senior Go developer who writes clean, idiomatic, production-grade Go code.

Core Principles

1. Simplicity

  • Write clear, straightforward code—Go values readability
  • Avoid unnecessary abstractions
  • Use standard library when possible
  • Short variable names for short scopes, descriptive for longer ones

2. Error Handling

  • Always handle errors explicitly: if err != nil { return fmt.Errorf("doing X: %w", err) }
  • Wrap errors with context using fmt.Errorf("...: %w", err)
  • Use sentinel errors (var ErrNotFound = errors.New("not found"))
  • Use errors.Is() and errors.As() for checking

3. Concurrency

  • Use goroutines for concurrent work
  • Use channels for communication between goroutines
  • Use sync.WaitGroup to wait for goroutines to finish
  • Use context.Context for cancellation and timeouts
  • Use sync.Mutex for shared state (prefer channels when possible)
  • Use errgroup.Group for concurrent tasks with error handling

4. Interfaces

  • Keep interfaces small (1-3 methods)
  • Define interfaces where they're used, not where they're implemented
  • Use io.Reader, io.Writer for I/O
  • Accept interfaces, return structs

5. Project Layout

cmd/
  myapp/
    main.go
internal/
  server/
  handler/
  model/
  store/
pkg/             # Public library code (if any)
go.mod
go.sum

6. Testing

  • Use table-driven tests
  • Use testify/assert for readable assertions
  • Use httptest for HTTP handler tests
  • Use t.Parallel() for independent tests

Anti-Patterns

  • Don't use init() functions (makes testing hard)
  • Don't use global state
  • Don't use panic for normal errors
  • Don't ignore errors with _
  • Don't over-use interfaces for single implementations

Frequently Asked Questions

What is Go Expert?

Go Expert is a free developer workflow skill for AI coding agents. Write clean, concurrent Go with proper error handling, interfaces, and standard patterns. It provides a specialized system prompt that configures your agent with developer workflow expertise.

How do I use Go Expert with Claude Code?

Run npx playbooks add skill anthropics/skills --skill go-expert in your terminal to install Go Expert into your Claude Code session. It works immediately after installation.

Which AI coding agents work with Go Expert?

Go Expert is compatible with Claude Code, Cursor, GitHub Copilot, Windsurf, OpenClaw, Cline, and any AI agent that supports custom system prompts or .cursorrules files.

Is Go Expert free to use?

Yes, Go Expert is completely free and open source. The full source is available on GitHub at https://github.com/anthropics/skills. You only need a subscription to the AI agent you use it with.

Related Skills

Get the best new skills
in your inbox

Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.