go-conventions

Enforce Go coding conventions with gopls, go vet, and staticcheck.

2|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/Integralist/agent-skills --skill go-conventions-integralist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-conventions
Source: https://github.com/Integralist/agent-skills/tree/main/.agents/skills/go-conventions
Command: npx skills add https://github.com/Integralist/agent-skills --skill go-conventions-integralist

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gopls, go-vet, go-critic, staticcheck, gofumpt, goimports-reviser, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to Go coding conventions, ensuring that your code is efficient, readable, and maintainable.

Core Features & Use Cases

  • Go Coding Conventions: Detailed guidelines on naming, error handling, testing, HTTP handlers, caching, concurrency, and observability.
  • Tooling Integration: Instructions on using gopls, linters like go vet, go-critic, and staticcheck.
  • Formatting: Steps for formatting code using gofumpt and goimports-reviser.
  • Structs and Variables: Best practices for struct and variable declarations.
  • Abbreviations and Naming: Guidance on naming conventions, including struct names, field names, and variables.
  • Imports: Best practices for importing packages and structuring imports.
  • Comments: Recommendations on writing effective comments and removing redundant ones.
  • Error Handling: Detailed explanation of error handling patterns and conventions.
  • Constructors: Best practices for creating constructors with dependency injection.
  • Interfaces: Guidelines on defining and using interfaces.
  • Logging: Best practices for logging within the Go ecosystem.
  • Observability: Recommendations for adding trace spans and metrics.
  • Concurrency: Guidance on using goroutines and handling context cancellation.
  • Context Values: Best practices for using context values for request-scoped metadata.
  • Testing: Instructions for writing table-driven tests and using testing tools.
  • HTTP Handlers: Best practices for writing HTTP handlers.
  • Service Layer: Guidelines on defining service methods and input validation.
  • Repository Layer: Best practices for wrapping repository methods with metrics and tracing.

Quick Start

Load the go-conventions skill to ensure your Go code adheres to best practices.

Frequently Asked Questions about go-conventions

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

FAQPage Schema
What are the Go coding conventions for error handling and observability?

Go coding conventions for error handling and observability require specific patterns for wrapping errors and adding trace spans. This Skill provides guidelines for logging, metrics, and context cancellation to ensure maintainable Go code.

How do I format Go code using gofumpt and goimports-reviser?

To format Go code, you use gofumpt and goimports-reviser to enforce strict formatting and structure imports. This Skill provides the steps to apply these tools for consistent code readability and quality.

Do I need staticcheck and go-critic to lint Go code effectively?

Yes, staticcheck and go-critic are required dependencies for linting Go code effectively. This Skill integrates these tools alongside go vet to identify code issues and strictly enforce best practices.

What is the best way to structure Go HTTP handlers and service layers?

The best way to structure Go HTTP handlers and service layers involves defining service methods with input validation and wrapping repository methods with metrics. This Skill provides guidelines for implementing this specific architecture.

How do I write table-driven tests following Go programming standards?

Writing table-driven tests following Go programming standards requires using specific testing tools and structured test cases. This Skill provides instructions for writing table-driven tests to ensure robust and maintainable testing practices.

When should I use context values for request-scoped metadata in Go?

You should use context values for request-scoped metadata in Go when passing data through goroutines and handling context cancellation. This Skill defines best practices for using context values to manage concurrency safely.