rules-golang

Enforces Go coding conventions and error handling guidance for style reviews.

4|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/NSObjects/specpowers --skill rules-golang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rules-golang
Source: https://github.com/NSObjects/specpowers/tree/main/skills/rules-golang
Command: npx skills add https://github.com/NSObjects/specpowers --skill rules-golang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill keeps Go projects aligned with community conventions, preventing sloppy naming, formatting, error handling, and concurrency practices that break gofmt, go test, and idiomatic Go expectations.

Core Features & Use Cases

  • Naming & Formatting: Enforces PascalCase exports, camelCase internals, acronym rules, gofmt/goimports formatting, and package structuring that satisfy Go tooling.
  • Error Handling & Testing: Requires explicit error returns, wrapping policies, table-driven tests, and sensible use of testing helpers like testify or go-cmp for clarity.
  • Concurrency & Architecture: Sets channel discipline, goroutine lifecycle plans, context-based cancellations, dependency injection guidance, SQL safety, and Git hygiene for Go-specific workflows.

Quick Start

Ask the agent to apply these Go coding rules before reviewing or writing any Go module.

Frequently Asked Questions about rules-golang

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

FAQPage Schema
How do I enforce consistent Go coding conventions and error handling in code reviews?

Enforcing Go coding conventions involves applying rules for naming, gofmt formatting, error wrapping, and testing strategies. This ensures Go projects stay aligned with community standards during style reviews and prevents sloppy error handling practices.

What are the best practices for structuring table-driven tests and using testify in Go?

Best practices for table-driven tests in Go include using sensible testing helpers like testify or go-cmp for clarity. Explicit error returns and wrapping policies are also required to maintain idiomatic Go expectations and pass go test checks.

How do I manage goroutine lifecycles and context-based cancellations for Go concurrency?

Managing Go concurrency requires setting channel discipline, goroutine lifecycle plans, and context-based cancellations. These concurrency safeguards prevent leaks and ensure safe dependency injection practices within Go modules.

Does this Go coding rules Skill cover SQL safety standards and Git workflow preparation?

Yes, this Go coding rules Skill covers SQL safety standards and Git hygiene requirements tailored for Go projects. It applies to SQL usage and Git workflow preparation during code reviews to maintain repository alignment.

Do I need gofmt and goimports to apply these Go-specific coding and review rules?

Yes, gofmt and goimports are mandated by these Go-specific coding rules to satisfy Go tooling. Enforcing PascalCase exports, camelCase internals, and acronym rules depends on proper formatting tool integration.