golang-rules

Define and enforce Go coding rules covering style, testing, and security.

24|5|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/Luohaothu/everything-codex --skill golang-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-rules
Source: https://github.com/Luohaothu/everything-codex/tree/main/skills/golang-rules
Command: npx skills add https://github.com/Luohaothu/everything-codex --skill golang-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go projects often suffer from inconsistent style and fragile error handling, making maintenance costly and error-prone.

Core Features & Use Cases

  • Enforces immutability by guiding new objects creation and discouraging in-place mutations.
  • Standardizes formatting with gofmt and goimports, and promotes small, focused interfaces.
  • Provides a robust testing and security baseline including 80%+ test coverage, error wrapping, and input validation.

Quick Start

Adopt gofmt, goimports, and a minimum 80% test coverage to ensure consistent, high-quality Go code.

Frequently Asked Questions about golang-rules

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

FAQPage Schema
How do I enforce consistent Go coding standards and error handling across my project?

You can enforce Go coding standards by applying mandatory gofmt and goimports checks, standardizing error wrapping, and validating inputs. This ensures consistent, safer, and more maintainable code across your project.

What is the recommended minimum test coverage for a Go project?

The recommended minimum test coverage for a Go project is 80%. Establishing this testing baseline alongside security practices and input validation improves overall code reliability and safety.

How do I implement immutability in Go to prevent in-place mutations?

To implement immutability in Go, guide the creation of new objects rather than performing in-place mutations. This approach reduces side effects and makes your codebase cleaner and more predictable.

Does this Go coding ruleset require any specific external dependencies or tools?

No external dependencies are required to apply these Go coding rules. The guidelines leverage standard Go practices like gofmt, goimports, and native error wrapping to enforce consistency and security without extra tools.

Why does my Go code suffer from fragile error handling and costly maintenance?

Go code suffers from fragile error handling when style is inconsistent and errors are not properly wrapped. Enforcing standardized formatting, input validation, and comprehensive coding rules reduces these maintenance costs.