# Go coding standards

> Go coding standards is an open-source agent skill for developer tools. Applies Go style and formatting conventions to code you write or review. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(code-quality)/go-coding-standards
- **Repository:** https://github.com/eduardo-sl/go-agent-skills
- **GitHub stars:** 90
- **License:** MIT
- **Skill name:** go-coding-standards
- **Collection:** https://github.com/eduardo-sl/go-agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill gives the agent a set of Go style rules to follow while writing or reviewing code. It covers import grouping, how to declare variables, struct literal rules, early returns to reduce nesting, declaration ordering, line length, defer usage, enum zero values, time.Duration handling, receiver consistency and struct tag hygiene.

The skill points the agent to goimports, go vet and staticcheck or golangci-lint as checks that code should pass. Naming, architecture, concurrency and performance are handled by separate skills, and the skill notes that a project-level rule can override it.

It relies on the Go toolchain being installed. Two reference files hold longer material on file organization and receiver and tag examples, which the agent reads only when needed.

## When your agent uses it

> Go coding standards and style conventions grounded in Effective Go, Go Code Review Comments, and production-proven idioms. Use when writing or reviewing Go code for import ordering, variable declarations, struct initialization, nesting, receivers, struct tags, or formatting rules. Trigger examples: "check Go style", "fix formatting", "Go conventions", "struct initialization". Not for: naming (go-naming), architecture (go-architecture-review), concurrency (go-concurrency-review), performance tuning (go-performance-review).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(code-quality)/go-coding-standards)
- [Asks for: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*), Bash(golangci-lint:*)](https://github.com/eduardo-sl/go-agent-skills/blob/HEAD/skills/(code-quality)/go-coding-standards/SKILL.md)
- [License: MIT](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(code-quality)/go-coding-standards)

## Features

- **Import grouping rules:** Orders imports into standard library, external and project groups, and bans dot imports.
- **Declaration and literal style:** Guides when to use var versus short declarations and requires field names in struct literals.
- **Control flow cleanup:** Favors guard clauses and early returns to keep the happy path unindented.
- **Receiver and tag consistency:** Keeps one receiver kind per type and requires explicit, checked struct tags on serialized fields.
- **Time and enum conventions:** Uses time.Duration instead of raw integers and reserves zero values for Unknown sentinels.
- **Pre-completion checklist:** Ends with a verification list covering vet, lint, imports and receiver consistency.

## Good for

- Review this Go file for style and formatting issues
- Fix import ordering across a Go package
- Clean up deeply nested error handling in a Go function
- Make struct literals use field names throughout a module
- Check that struct tags are complete before a JSON API change

## Install

### Any agent

Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.

## FAQ

### What does Go coding standards need to run?

It requires the Go toolchain. golangci-lint is optional.

### Does Go coding standards overlap with naming or performance review?

No. Naming, architecture, concurrency and performance tuning are assigned to separate skills.

### Can a project override these rules?

Yes. A project skill or agent-config rule that explicitly supersedes it takes precedence.

### Does Go coding standards run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Go coding standards?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Go coding standards?

The closest alternatives to Go coding standards are Go code review, Go naming, Go defensive coding, Go documentation and Go architecture review.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Go code review](https://ai-powered.com/skills/go-code-review): Go code review is an open-source agent skill for developer tools.
- [Go naming](https://ai-powered.com/skills/go-naming): Go naming is an open-source agent skill for developer tools.
- [Go defensive coding](https://ai-powered.com/skills/go-defensive-coding): Go defensive coding is an open-source agent skill for developer tools.
- [Go documentation](https://ai-powered.com/skills/go-documentation): Go documentation is an open-source agent skill for developer tools.
- [Go architecture review](https://ai-powered.com/skills/go-architecture-review): Go architecture review is an open-source agent skill for developer tools.
- [Readable code](https://ai-powered.com/skills/readable-code): Readable code is an open-source agent skill for developer tools.
- [Coding standards](https://ai-powered.com/skills/coding-standards-smartworldarafath): Coding standards is an open-source agent skill for developer tools.
- [Go interface design](https://ai-powered.com/skills/go-interface-design): Go interface design is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/go-coding-standards
