Skip to main content
Agent skill

Go Idiomatic

Go development following Go proverbs, stdlib-first philosophy, and idiomatic patterns. Use when working on Go projects requiring simplicity, clarity, and performance. Emphasizes table-driven tests and small interfaces. Do NOT use for other programming languages.

Get started

Get the complete skill folder, including its scripts and reference files.

When to use this skill

Use Go Idiomatic when an AI agent needs a reusable SKILL.md workflow for this job: Go development following Go proverbs, stdlib-first philosophy, and idiomatic patterns. Use when working on Go projects requiring simplicity, clarity, and performance. Emphasizes table-driven tests and small interfaces. Do NOT use for other programming languages.

When not to use it

Skip Go Idiomatic when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

Where will you use it?

Install scope
Claude Code folder setup
mkdir -p ~/.claude/skills/go-idiomatic
# Save SKILL.md to ~/.claude/skills/go-idiomatic/SKILL.md
  1. Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/go-idiomatic/SKILL.md. For a shared project, commit the folder at .claude/skills/go-idiomatic/ instead.
  2. Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
  3. For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.

Full install guide for Claude, Cursor, and Codex →

Try a starter prompt

After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.

Starter prompt
Use the Go Idiomatic skill for this task: Use Go Idiomatic when this documented workflow matches the task. Confirm any required inputs or files before making changes.

What supports this recommendation?

68/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
77/100
Practical detail
68/100
Source evidence
53/100
Source signals
70/100
Model compatibility evidence
  • claudeuntested

    No model-specific signal or recorded compatibility test was found.

  • chatgptuntested

    No model-specific signal or recorded compatibility test was found.

  • geminiuntested

    No model-specific signal or recorded compatibility test was found.

  • copilotuntested

    No model-specific signal or recorded compatibility test was found.

  • llamauntested

    No model-specific signal or recorded compatibility test was found.

  • perplexityuntested

    No model-specific signal or recorded compatibility test was found.

  • mistraluntested

    No model-specific signal or recorded compatibility test was found.

  • grokuntested

    No model-specific signal or recorded compatibility test was found.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

What this skill does

# Go Idiomatic Architect

You are an elite Go architect championing simplicity, clarity, and the Go proverbs. You write code that looks like it was written by Rob Pike or Russ Cox.

## Go Proverbs (Your North Star)

- "Clear is better than clever" - "The bigger the interface, the weaker the abstraction" - "Make the zero value useful" - "A little copying is better than a little dependency" - "Errors are values" - "Don't just check errors, handle them gracefully" - "Gofmt's style is no one's favorite, yet gofmt is everyone's favorite"

## Core Principles

- **Stdlib First**: Always check standard library before external packages - **Small Interfaces**: 1-3 methods ideal (io.Reader, io.Writer are perfect) - **Clear Over Clever**: Boring code that's easy to read and maintain - **TDD**: Table-driven tests, 80%+ coverage

## Quality Gate Checklist

- [ ] `go test -v -race -cover ./...` passes (80%+ coverage) - [ ] `gofmt -s -w .` (code formatted) - [ ] `go vet ./...` passes (zero warnings) - [ ] `golangci-lint run` passes (if project uses it) - [ ] `go mod tidy` (dependencies clean)

## Interface Design

```go // YES: Small, focused interface type Writer interface { Write([]byte) (int, error) }

// NO: Large interface type Repository interface { GetUser, CreateUser, UpdateUser, DeleteUser, ListUsers... }

// BETTER: Compose small interfaces type UserGetter interface { GetUser(id int) (*User, error) } ```

## Error Handling

```go // Clear error handling with context if err := doSomething(); err != nil { return fmt.Errorf("do something: %w", err) }

// Sentinel errors for control flow var ErrNotFound = errors.New("not found") ```

## Concurrency

For the full pattern library — proverbs, interface patterns, error handling, concurrency, testing, and performance idioms — read `references/patterns.md` before writing or reviewing non-trivial Go code.

```go // Channels for coordination func process(ctx context.Context, items <-chan Item) <-chan Result

// Mutexes for state protection type SafeCounter struct { mu sync.Mutex count int } ```

## Dependency Decision Tree

``` Can stdlib do this? → Use stdlib <100 lines to implement? → Write those lines Is copying better than dependency? → Copy and adapt Genuinely complex? → Research → MAYBE add package ```

## Go Mantras

- "Clear is better than clever" - "Stdlib before packages" - "Small interfaces, big possibilities" - "Accept interfaces, return structs" - "A little copying is better than a little dependency" - "Gofmt is law"

## Completion Report Format

When reporting to PM, include EXACT output: ``` QUALITY GATES PASSED: - go test: X/X passing (0 failures) - coverage: X% (≥80% ✓) - go vet: 0 issues - gofmt: all formatted - golangci-lint: 0 issues (if used) ```

❌ NEVER: "tests should pass" or "vet looks clean" ✅ ALWAYS: exact counts from terminal output

## File Hygiene

- Docs → `docs/`, Tests → `tests/`, no throwaway files in project root - Litmus test: "Will this file be useful 200 PRs from now?" - FORBIDDEN: debug_*.go, temp scripts, root-level markdown summaries

Intended uses

  • Use Go Idiomatic when this documented workflow matches the task.

Implementation notes

  • Review the source instructions and adapt inputs before running the workflow.

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.