Sandbox
@madflojo/go-style-agent-skill

Go style skill for agent code review and refactoring

This is a packaged skill for Go engineering decisions that agents can use while designing, reviewing, and refactoring code. It centers on `skills/go-style-guide/SKILL.md`, with reference docs for constructors, interfaces, errors, logging, documentation, layout, benchmarks, testing, and concurrency.

35 stars3 forksMakefileUpdated 3mo ago
Who it's for

Builders who use coding agents and want them to follow a shared Go style guide.

What it delivers

You can get more consistent Go packages, clearer errors, better tests, and review comments that match your codebase style.

What it does

Opinionated Go guidance

Covers package design, constructors and config, interfaces, errors, logging, documentation, layout, and benchmarks.

Reference docs by topic

Uses separate files under `skills/go-style-guide/references/` so an agent can look up only the guidance it needs.

Installation options

Supports GitHub CLI install, `npx` install, or manual copy into a skill directory.

Review checklist

Includes a dedicated checklist for Go code review in `skills/go-style-guide/references/REVIEW-CHECKLIST.md`.

How to get it

  1. 1Install with GitHub CLI
    gh skill install madflojo/go-style-agent-skill
  2. 2Install with npm via npx
    npx skills add -g -y madflojo/go-style-agent-skill
  3. 3Optional: pin the GitHub CLI install to a release tag or commit SHA when you want…
    gh skill install madflojo/go-style-agent-skill@v1.0.0
    gh skill install madflojo/go-style-agent-skill@<commit-sha>

README

Go Style Guide Skill

An opinionated agent skill for designing, reviewing, and refactoring Go code.

This repository packages a reusable skill plus supporting reference material for Go engineering decisions around package design, constructors and config, interfaces, errors, logging, documentation, layout, and benchmarks.

What this is

The go-style-guide skill is a practical Go engineering guide for:

  • new package and API design
  • refactors and restructures
  • code review
  • testability and dependency injection decisions
  • error and logging contracts
  • performance-sensitive code that should be benchmarked

It is designed to be useful to both human engineers and coding agents.

Opinionated by design

This guide reflects personal preferences. It is not intended to be a universal or official Go style guide.

The goal is consistency, maintainability, and production readiness in real codebases. If your repository already has established conventions, those should still win.

What it emphasizes

  • testability-first package design
  • Config-driven constructors with explicit validation and defaults
  • boundary-driven interfaces, following "accept interfaces, return structs"
  • sentinel-first error contracts with preserved wrapping semantics
  • application-owned logging instead of hidden package logging
  • standard-library-first dependency choices with third-party packages only when they add meaningful, well-maintained abstraction
  • idiomatic godoc and durable comments for public and important internal code
  • benchmarks for performance-sensitive code paths
  • shallow, domain-oriented package layouts

Repository layout

skills/
  go-style-guide/
    SKILL.md
    references/
      BENCHMARKS.md
      CONFIG.md
      CONCURRENCY.md
      DOCUMENTATION.md
      ERRORS.md
      INTERFACES.md
      LAYOUT.md
      LOGGING.md
      REVIEW-CHECKLIST.md
      TESTING.md
  • skills/go-style-guide/SKILL.md is the main skill prompt.
  • skills/go-style-guide/references/ contains deeper reference material that the skill can rely on when needed.

Installing the skill

You can install this skill with either GitHub CLI or the skills npm package.

Install with GitHub CLI:

gh skill install madflojo/go-style-agent-skill

Install with npm via npx:

npx skills add -g -y madflojo/go-style-agent-skill

Optional: pin the GitHub CLI install to a release tag or commit SHA when you want reproducible installs:

gh skill install madflojo/go-style-agent-skill@v1.0.0
gh skill install madflojo/go-style-agent-skill@<commit-sha>

Both commands install the skill into the appropriate user-level skill directory automatically.

If you prefer a manual install, copy the skills/go-style-guide/ directory into either:

  • your repository's .agents/skills/ directory
  • your user-level ~/.agents/skills/ directory

Adapt the destination to your agent tool's skill-directory convention if it differs.

Once installed, invoke it using the mechanism your agent tool provides for running skills. The skill identifier is go-style-guide.

Compatibility notes

The examples in this repository assume modern Go and use standard-library features such as errors.Join and log/slog. Go 1.21+ is a good baseline.

If you apply this guide to an older repository, adapt the recommendations to the Go version that repository actually supports.

Reference documents

The supporting documents are organized by topic and are intended for on-demand lookup. Agents should start with SKILL.md and read only the specific references/*.md files needed for the current task:

Contributing

Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request.

License

This project is licensed under Apache-2.0.

Files in the repo

Repository payload12 top-level entries
  • .github
  • evals
  • skills
  • .gitignore
  • .markdownlint.jsonc
  • .release-please-manifest.json
  • CHANGELOG.md
  • CONTRIBUTING.md
  • LICENSE
  • Makefile
  • README.md
  • release-please-config.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More skills

obra/
superpowers

An agentic skills framework & software development methodology that works.

285k
1 add

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

117k
1 add
Vincentwei1021/
anything2explainer

Topic in, narrated explainer video out. A Claude Code / Codex skill that turns any topic into a black-canvas motion-graphics explainer video with TTS voiceover, subtitles and a chapter progress bar. Chinese or English; every frame drawn in code with Remotion.

666

Open-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)

71k