go

Enforces Go coding standards including error wrapping, context, SQLBoiler, and table-driven tests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/plutowang/term.conf --skill go-plutowang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go
Source: https://github.com/plutowang/term.conf/tree/main/opencode/skills/inventory/go
Command: npx skills add https://github.com/plutowang/term.conf --skill go-plutowang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces a standard set of Go development constraints to improve reliability and readability, including error handling, context usage, DB access patterns, and test discipline.

Core Features & Use Cases

  • Error handling: wrap errors with fmt.Errorf("...: %w", err).
  • Context: ensure context.Context is the first argument for functions requiring cancellation.
  • DB access: use SQLBoiler models/executors; avoid GORM and raw SQL.
  • Testing: employ table-driven tests with testify/require.
  • Project layout: adhere to nx-monorepo layout if nx.json exists, otherwise standard cmd/, internal/, pkg/.

Quick Start

Use the Go skill to layout your project, write tests, and build apps with the defined rules (e.g., go test -v ./..., go build ./cmd/<app>, gofmt -w .).

Frequently Asked Questions about go

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

FAQPage Schema
How do I enforce standard Go error wrapping and context constraints across my project?

To enforce Go constraints, wrap errors using fmt.Errorf("...: %w", err) and ensure context.Context is the first argument for functions requiring cancellation. This improves reliability and readability across backend services and libraries.

What is the best way to structure table-driven tests in a Golang project?

The best way to structure table-driven tests in Go is by using the testify/require package alongside table-driven test patterns. This enforces testing discipline and ensures robust validation across your backend services and libraries.

Does this Go development approach support SQLBoiler or do I need to use GORM?

This Go development approach supports SQLBoiler for database access and explicitly avoids GORM and raw SQL. You must use SQLBoiler models and executors to satisfy the database access constraints enforced across your projects.

How do I layout a Go project in an nx-monorepo environment?

To layout a Go project in an nx-monorepo, adhere to the nx-monorepo layout if an nx.json file exists. If nx.json is not present, fall back to the standard Go project layout using cmd/, internal/, and pkg/ directories.

Why should I pass context.Context as the first argument in Go functions?

You should pass context.Context as the first argument in Go functions to ensure proper cancellation and timeout handling. Enforcing this constraint standardizes context usage across backend services and libraries, improving overall reliability.

Can I run standard Go build and test commands with these development constraints?

Yes, you can run standard Go build and test commands such as go test -v ./... and go build ./cmd/<app> with these constraints. You can also use gofmt -w . to format your code according to the enforced rules.