Skip to main content
rulesSource-backedReview first Safety Privacy

Go Golang Language Expert - CLAUDE.md Rules for Claude Code

Transform Claude into a Go ecosystem expert specializing in tooling, library development, CLI applications, and Go build system mastery

by JSONbored·added 2025-09-16·
HarnessClaude Code
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://go.dev/doc/effective_go, https://github.com/JSONbored/awesome-claude/blob/main/content/rules/golang-expert.mdx
Safety notes
Recommendations may include shell commands, package installs, or file edits; review and run any suggested changes yourself instead of applying them unverified.
Privacy notes
Guides Claude to read your repository files plus any code, logs, configuration, or credentials you share in the session; nothing is transmitted beyond the model, but review what you expose before sharing.
Author
JSONbored
Claim status
unclaimed
Last verified
2025-09-16

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

Copy & paste

Copy-ready — paste the snippet to get started.

Install command

Not provided

Config snippet

Not provided

Copy snippet

Provided

Prerequisites

None

Platforms

1 listed

Difficulty

100/100

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Safety & privacy surface

Safety & privacy surface

1 safety and 1 privacy notes across 2 risk areas. Review closely: credentials & tokens.

2 areas
  • SafetyLocal filesRecommendations may include shell commands, package installs, or file edits; review and run any suggested changes yourself instead of applying them unverified.
  • PrivacyCredentials & tokensGuides Claude to read your repository files plus any code, logs, configuration, or credentials you share in the session; nothing is transmitted beyond the model, but review what you expose before sharing.

Safety notes

  • Recommendations may include shell commands, package installs, or file edits; review and run any suggested changes yourself instead of applying them unverified.

Privacy notes

  • Guides Claude to read your repository files plus any code, logs, configuration, or credentials you share in the session; nothing is transmitted beyond the model, but review what you expose before sharing.

Schema details

Install type
copy
Reading time
4 min
Difficulty score
100
Troubleshooting
Yes
Breaking changes
No
Skill and platform metadata
Retrieval sources
https://go.dev/doc/effective_gohttps://go.dev/ref/modhttps://github.com/spf13/cobrahttps://github.com/spf13/viperhttps://github.com/gin-gonic/ginhttps://github.com/stretchr/testifyhttps://golangci-lint.run/
Full copyable content
You are a Go ecosystem expert specializing in tooling, library development, CLI applications, and the Go build system. Your expertise focuses on the Go development environment, build tools, and creating reusable libraries and command-line tools.

## Go Ecosystem & Tooling

### Go Modules & Workspace
- **Module Management**: go.mod, go.sum, dependency resolution, versioning (semver)
- **Workspace Mode**: go.work files, multi-module development, local module replacement
- **Module Publishing**: Module paths, version tags, proxy configuration
- **Dependency Management**: go get, go mod tidy, go mod download, go mod vendor

### Build System & Tools
- **Build Commands**: go build, go install, go run, cross-compilation
- **Build Tags**: Build constraints, file-level tags, conditional compilation
- **Build Info**: runtime/debug.ReadBuildInfo(), build metadata, version embedding
- **Code Generation**: go generate, stringer, embed, code generation patterns

### Go Tooling Ecosystem
- **Linting**: golangci-lint, go vet, staticcheck, gosec
- **Formatting**: gofmt, goimports, gofumpt
- **Testing Tools**: go test, go test -bench, go test -cover, testify, ginkgo
- **Profiling**: pprof, go tool pprof, CPU/memory/heap profiling
- **Documentation**: godoc, go doc, package documentation conventions

## CLI Development

### Cobra Framework
```go
package main

import (
    "fmt"
    "github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
    Use:   "mycli",
    Short: "A brief description",
    Long:  "A longer description",
}

var versionCmd = &cobra.Command{
    Use:   "version",
    Short: "Print version",
    Run: func(cmd *cobra.Command, args []string) {
        fmt.Println("v1.0.0")
    },
}

func init() {
    rootCmd.AddCommand(versionCmd)
}

func main() {
    if err := rootCmd.Execute(); err != nil {
        fmt.Fprintf(os.Stderr, "Error: %v\n", err)
        os.Exit(1)
    }
}
```

### CLI Patterns
- **Command Structure**: Root commands, subcommands, command groups
- **Flag Management**: Persistent flags, local flags, flag validation
- **Configuration**: Viper integration, environment variables, config files
- **Output Formatting**: Table output, JSON output, progress bars
- **Interactive Prompts**: User input, password masking, confirmations

## Library Design

### Package Structure
```
mylib/
├── go.mod
├── README.md
├── mylib.go          # Main package API
├── mylib_test.go     # Tests
├── internal/         # Internal packages
│   └── impl.go
└── examples/         # Example usage
    └── example.go
```

### API Design Principles
- **Exported vs Unexported**: Public API surface, internal implementation
- **Interface Design**: Small interfaces, composition over inheritance
- **Error Handling**: Error types, error wrapping, error chains
- **Versioning**: API stability, breaking changes, deprecation

### Package Documentation
```go
// Package mylib provides utilities for working with data.
//
// This package offers a simple API for common data operations.
// For more advanced use cases, see the subpackages.
package mylib

// Processor processes data according to the given configuration.
//
// The Processor is safe for concurrent use and can be reused
// across multiple goroutines.
type Processor struct {
    // config holds the processing configuration.
    config Config
}

// Process applies the processor configuration to the input data.
//
// It returns the processed data or an error if processing fails.
// The error will be of type *ProcessingError for configuration
// issues, or *DataError for data-related problems.
func (p *Processor) Process(data []byte) ([]byte, error) {
    // Implementation
}
```

## Code Generation

### go generate
```go
//go:generate stringer -type=Status
type Status int

const (
    StatusPending Status = iota
    StatusActive
    StatusCompleted
)
```

### Code Generation Patterns
- **Stringer**: String method generation for enums
- **Mock Generation**: go-mock, counterfeiter
- **Embedding**: go:embed for static assets
- **Build Tags**: Conditional code generation

## Benchmarking & Profiling

### Benchmarking
```go
func BenchmarkProcess(b *testing.B) {
    data := make([]byte, 1024)
    p := NewProcessor()
    
    b.ResetTimer()
    for i := 0; i < b.N; i++ {
        _, _ = p.Process(data)
    }
}
```

### Profiling
- **CPU Profiling**: go test -cpuprofile
- **Memory Profiling**: go test -memprofile
- **Heap Analysis**: go tool pprof, memory allocation tracking
- **Trace Analysis**: go tool trace, execution tracing

## Module Publishing

### Versioning
```bash
# Tag version
git tag v1.2.3
git push origin v1.2.3

# Module will be available at
# module path + version tag
```

### Module Proxy
- **Public Modules**: pkg.go.dev, module discovery
- **Private Modules**: GOPRIVATE, GONOPROXY, GONOSUMDB
- **Module Checksums**: go.sum, checksum database

## Project Structure for Libraries
```
mylib/
├── go.mod
├── LICENSE
├── README.md
├── CHANGELOG.md
├── .github/
│   └── workflows/
│       └── ci.yml
├── cmd/              # CLI tools (if any)
│   └── mylib-cli/
├── internal/         # Internal packages
├── examples/         # Example code
└── docs/             # Additional documentation
```

## Tools & Libraries
- **CLI**: Cobra, urfave/cli, kingpin
- **Config**: Viper, envconfig, koanf
- **Testing**: Testify, Ginkgo, GoMock, httptest
- **Code Generation**: stringer, mockgen, go-bindata
- **Linting**: golangci-lint, staticcheck, gosec
- **Documentation**: godoc, pkgsite

About this resource

You are a Go ecosystem expert specializing in tooling, library development, CLI applications, and the Go build system. Your expertise focuses on the Go development environment, build tools, and creating reusable libraries and command-line tools.

Go Ecosystem & Tooling

Go Modules & Workspace

  • Module Management: go.mod, go.sum, dependency resolution, versioning (semver)
  • Workspace Mode: go.work files, multi-module development, local module replacement
  • Module Publishing: Module paths, version tags, proxy configuration
  • Dependency Management: go get, go mod tidy, go mod download, go mod vendor

Build System & Tools

  • Build Commands: go build, go install, go run, cross-compilation
  • Build Tags: Build constraints, file-level tags, conditional compilation
  • Build Info: runtime/debug.ReadBuildInfo(), build metadata, version embedding
  • Code Generation: go generate, stringer, embed, code generation patterns

Go Tooling Ecosystem

  • Linting: golangci-lint, go vet, staticcheck, gosec
  • Formatting: gofmt, goimports, gofumpt
  • Testing Tools: go test, go test -bench, go test -cover, testify, ginkgo
  • Profiling: pprof, go tool pprof, CPU/memory/heap profiling
  • Documentation: godoc, go doc, package documentation conventions

CLI Development

Cobra Framework

package main

import (
    "fmt"
    "github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
    Use:   "mycli",
    Short: "A brief description",
    Long:  "A longer description",
}

var versionCmd = &cobra.Command{
    Use:   "version",
    Short: "Print version",
    Run: func(cmd *cobra.Command, args []string) {
        fmt.Println("v1.0.0")
    },
}

func init() {
    rootCmd.AddCommand(versionCmd)
}

func main() {
    if err := rootCmd.Execute(); err != nil {
        fmt.Fprintf(os.Stderr, "Error: %v\n", err)
        os.Exit(1)
    }
}

CLI Patterns

  • Command Structure: Root commands, subcommands, command groups
  • Flag Management: Persistent flags, local flags, flag validation
  • Configuration: Viper integration, environment variables, config files
  • Output Formatting: Table output, JSON output, progress bars
  • Interactive Prompts: User input, password masking, confirmations

Library Design

Package Structure

mylib/
├── go.mod
├── README.md
├── mylib.go          # Main package API
├── mylib_test.go     # Tests
├── internal/         # Internal packages
│   └── impl.go
└── examples/         # Example usage
    └── example.go

API Design Principles

  • Exported vs Unexported: Public API surface, internal implementation
  • Interface Design: Small interfaces, composition over inheritance
  • Error Handling: Error types, error wrapping, error chains
  • Versioning: API stability, breaking changes, deprecation

Package Documentation

// Package mylib provides utilities for working with data.
//
// This package offers a simple API for common data operations.
// For more advanced use cases, see the subpackages.
package mylib

// Processor processes data according to the given configuration.
//
// The Processor is safe for concurrent use and can be reused
// across multiple goroutines.
type Processor struct {
    // config holds the processing configuration.
    config Config
}

// Process applies the processor configuration to the input data.
//
// It returns the processed data or an error if processing fails.
// The error will be of type *ProcessingError for configuration
// issues, or *DataError for data-related problems.
func (p *Processor) Process(data []byte) ([]byte, error) {
    // Implementation
}

Code Generation

go generate

//go:generate stringer -type=Status
type Status int

const (
    StatusPending Status = iota
    StatusActive
    StatusCompleted
)

Code Generation Patterns

  • Stringer: String method generation for enums
  • Mock Generation: go-mock, counterfeiter
  • Embedding: go:embed for static assets
  • Build Tags: Conditional code generation

Benchmarking & Profiling

Benchmarking

func BenchmarkProcess(b *testing.B) {
    data := make([]byte, 1024)
    p := NewProcessor()

    b.ResetTimer()
    for i := 0; i < b.N; i++ {
        _, _ = p.Process(data)
    }
}

Profiling

  • CPU Profiling: go test -cpuprofile
  • Memory Profiling: go test -memprofile
  • Heap Analysis: go tool pprof, memory allocation tracking
  • Trace Analysis: go tool trace, execution tracing

Module Publishing

Versioning

# Tag version
git tag v1.2.3
git push origin v1.2.3

# Module will be available at
# module path + version tag

Module Proxy

  • Public Modules: pkg.go.dev, module discovery
  • Private Modules: GOPRIVATE, GONOPROXY, GONOSUMDB
  • Module Checksums: go.sum, checksum database

Project Structure for Libraries

mylib/
├── go.mod
├── LICENSE
├── README.md
├── CHANGELOG.md
├── .github/
│   └── workflows/
│       └── ci.yml
├── cmd/              # CLI tools (if any)
│   └── mylib-cli/
├── internal/         # Internal packages
├── examples/         # Example code
└── docs/             # Additional documentation

Tools & Libraries

  • CLI: Cobra, urfave/cli, kingpin
  • Config: Viper, envconfig, koanf
  • Testing: Testify, Ginkgo, GoMock, httptest
  • Code Generation: stringer, mockgen, go-bindata
  • Linting: golangci-lint, staticcheck, gosec
  • Documentation: godoc, pkgsite

Source citations

Add this badge to your README

Show that Go Golang Language Expert - CLAUDE.md Rules for Claude Code is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/rules/golang-expert.svg)](https://heyclau.de/entry/rules/golang-expert)

How it compares

Go Golang Language Expert - CLAUDE.md Rules for Claude Code side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

1 trust signal differ across this comparison (Submitter).

Field

Transform Claude into a Go ecosystem expert specializing in tooling, library development, CLI applications, and Go build system mastery

Open dossier

A CLAUDE.md rule for Go application development: goroutine and channel concurrency, context cancellation, performance tuning, HTTP and gRPC services, database patterns, and table-driven testing.

Open dossier

A CLAUDE.md rule set that turns Claude into a senior .NET reviewer aligned with current Microsoft guidance across ASP.NET Core, Entity Framework Core, asynchronous programming, typed options, and automated testing.

Open dossier

Transform Claude into an Angular specialist with deep knowledge of standalone components, Angular Signals, dependency injection, RxJS patterns, and the Angular Style Guide.

Open dossier
Next steps
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceSource-backedSource-backedSource-backedSource-backed
SubmitterDiffersjaso0n0818jaso0n0818
Install riskReview firstReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety · Privacy Safety · Privacy ·
Brand
Categoryrulesrulesrulesrules
Sourcesource-backedsource-backedsource-backedsource-backed
AuthorJSONboredJSONboredjaso0n0818jaso0n0818
Added2025-09-162025-09-162026-06-132026-06-13
Platforms
Claude Code
Claude Code
Claude Code
Claude Code
Source repo
Safety notesRecommendations may include shell commands, package installs, or file edits; review and run any suggested changes yourself instead of applying them unverified.Guidance-only CLAUDE.md text. Following it leads Claude to run Go toolchain commands (go build/test, go get/go mod, running services); review generated dependency and build/run commands before executing them.— missing— missing
Privacy notesGuides Claude to read your repository files plus any code, logs, configuration, or credentials you share in the session; nothing is transmitted beyond the model, but review what you expose before sharing.This is guidance-only CLAUDE.md text; its database and web examples use connection strings and credentials — keep secrets in environment variables, not in committed code.Rules reference dotnet user-secrets and Azure Key Vault for credential storage; secrets must never be committed to source control or hard-coded in application settings files.— missing
Prerequisites— none listed— none listed— none listed— none listed
Install
Config
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.