go-developer

Generate idiomatic Go code following community standards and gofmt formatting.

Updated Nov 27, 2025
One-click install
npx skills add https://github.com/barrydobson/dotfiles_extra --skill go-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-developer
Source: https://github.com/barrydobson/dotfiles_extra/tree/main/packages/claude/dot-claude/skills/go-developer
Command: npx skills add https://github.com/barrydobson/dotfiles_extra --skill go-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures all Go code adheres to idiomatic practices, community standards, and established style guides (Effective Go, Go Code Review Comments, Google's Go Style Guide). It prevents common Go pitfalls, promotes consistency, and reduces the need for extensive code review feedback on style and best practices.

Core Features & Use Cases

  • Idiomatic Go Practices: Guides on writing simple, clear, and Go-native code, favoring clarity over cleverness.
  • Naming Conventions: Provides detailed rules for naming packages, variables, functions, interfaces, and constants.
  • Code Style & Formatting: Enforces gofmt and goimports usage, comment best practices (why, not what), and error handling.
  • Concurrency & Architecture: Offers guidance on goroutines, channels, synchronization, package organization, and API design.
  • Use Case: When writing any new Go service or feature, this skill acts as an on-demand expert, ensuring your code is immediately compliant with best practices, from package declarations to error handling and concurrency patterns.

Quick Start

I need to write a new Go package for user authentication. Guide me through the process, focusing on idiomatic Go practices for package naming, function signatures, error handling, and concurrency if applicable.

Frequently Asked Questions about go-developer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write idiomatic Go code that follows community standards?

Idiomatic Go emphasizes clarity and simplicity using standard library features, proper naming conventions, and established patterns from Effective Go and Go Code Review Comments. Apply gofmt and goimports formatting, use concise error handling, keep nesting minimal, and organize packages following Go's module and packaging rules for maintainable, community-compliant code.

What are Go naming conventions for packages, functions, and interfaces?

Go naming follows specific rules: package names are lowercase, single words; exported functions and types start with uppercase; unexported identifiers start with lowercase; interface names typically end in 'er' for single-method types; constants use CamelCase. These conventions ensure code readability and consistency across Go projects.

How should I handle errors in Go following best practices?

Go error handling prioritizes explicit checks over exceptions. Return errors as values, check them immediately after operations, avoid wrapping unnecessary context, and use simple if err != nil patterns. This approach keeps code clear and makes error flow visible, aligning with idiomatic Go standards.

What's the best way to structure goroutines and channels in Go?

Idiomatic Go concurrency uses goroutines for lightweight parallelism and channels for safe communication between them. Design channel ownership clearly, close channels from the sender side only, use select for multiplexing, and avoid shared memory. This pattern prevents race conditions and deadlocks.

Do I need to format Go code manually with gofmt and goimports?

No—automate formatting with gofmt and goimports as part of your development workflow or CI/CD pipeline. These tools enforce consistent style across your codebase, eliminate style review feedback, and ensure all Go code adheres to community formatting standards without manual effort.

How do I document exported APIs in Go?

Document exported packages, functions, types, and constants with comments in English placed immediately before the declaration. Comment the why and behavior, not the obvious what. Package comments describe the package purpose; function comments start with the function name. Godoc automatically generates documentation from these comments.