Sandbox
@cxuu/golang-skills

Go agent skills for Claude Code, Codex, and Cursor

This repository packages 20 Go-focused Agent Skills that help coding assistants follow idiomatic style, handle reviews, and choose the right patterns. The skills use progressive disclosure, so the agent gets core rules first and loads deeper references only when needed, with bundled scripts for checks like linting, naming, docs, and tests.

158 stars18 forksHTMLUpdated 2mo ago
Who it's for

Builders who use agent assistants to write, review, and maintain Go code.

What it delivers

You can get more consistent Go code and reviews without re-explaining style, error handling, tests, or naming rules every session.

What it does

Go skill pack

20 modular skills cover concurrency, context, control flow, data structures, declarations, defensive code, docs, error handling, functional options, functions, generics, interfaces, linting, logging,

Procedural guidance

The skills use decision trees and step-by-step instructions for multi-step tasks like code review and choosing error-handling strategies.

Progressive disclosure

Core guidance stays in each `SKILL.md`, while detailed reference files load only when a situation calls for them.

Bundled checks

Scripts such as `pre-review.sh`, `check-naming.sh`, `check-docs.sh`, `check-errors.sh`, and `gen-table-test.sh` automate common Go checks.

Output templates

Asset templates keep generated output consistent across skills.

Evaluation coverage

`evals/` contains trigger and quality eval definitions, sample files, and fixtures for testing skill behavior.

How to get it

  1. 1The easiest way to install across any AI coding agent. Supports Cursor, Codex, OpenCode,…
    npx skills add cxuu/golang-skills --all
  2. 2Run
    # Add the marketplace (one time)
    /plugin marketplace add cxuu/golang-skills
    
    # Install the skills
    /plugin install golang-skills@cxuu-golang-skills

README

Agent Skills For Go

AI Agent Skills for writing idiomatic, production-quality Go code. 20 modular skills teach AI coding assistants Go best practices derived from:

Skills are tuned following agentskills.io best practices: content the agent already knows is omitted, procedural decision trees guide multi-step tasks, 48 reference files load on demand via progressive disclosure, 8 bundled scripts automate common checks, and 4 asset templates ensure consistent output.

Skills Included

SkillDescription
go-code-reviewSystematic checklist for reviewing Go code and PR submissions
go-concurrencyGoroutine lifecycle, channels, mutexes, parallelization, thread-safety
go-contextContext.Context placement, cancellation, deadlines, request-scoped data
go-control-flowIdiomatic conditionals, loops, switch/break behavior, guard clauses
go-data-structuresSlices, maps, arrays — allocation with new vs make, append, copying
go-declarationsVariable/const/type declarations, var vs :=, iota enums, shadowing
go-defensiveAPI boundary hardening, defer cleanup, Must functions, time handling
go-documentationDoc comments, package docs, godoc formatting, runnable examples
go-error-handlingError strategy decisions, wrapping (%v vs %w), sentinels, logging patterns
go-functional-optionsFunctional options pattern for constructors with optional config
go-functionsFunction ordering, signature formatting, Printf verbs, Stringer interface
go-genericsWhen to use generics, constraints, common pitfalls, type aliases
go-interfacesInterface design, abstractions, embedding, "accept interfaces return structs"
go-lintingLinters, golangci-lint setup, nolint directives, CI/CD integration
go-loggingStructured logging with slog, log levels, request-scoped context, migration
go-namingNaming decision flow for packages, types, functions, variables, receivers
go-packagesPackage organization, imports, package size, CLI/flag patterns
go-performanceString optimization, capacity hints, benchmarking, strconv over fmt
go-style-coreFormatting, nesting reduction, style principles, fallback style guide
go-testingTable-driven tests, subtests, test helpers, assertions, test organization

Bundled Scripts

8 scripts automate common Go checks. All support --help, --json for structured output, and meaningful exit codes (0 = clean, 1 = issues found, 2 = error). Analysis scripts support --limit to cap output size, and destructive scripts require --force to overwrite existing files.

ScriptSkillPurpose
pre-review.shgo-code-reviewRun gofmt + go vet + golangci-lint before review
check-naming.shgo-namingDetect SCREAMING_SNAKE, Get-prefixed getters, bad package names
check-docs.shgo-documentationFind exported symbols missing doc comments
check-errors.shgo-error-handlingCatch bare returns, string comparison on errors, log-and-return
check-interface-compliance.shgo-interfacesFind interfaces missing compile-time verification
bench-compare.shgo-performanceRun benchmarks with optional benchstat comparison
setup-lint.shgo-lintingGenerate .golangci.yml with recommended linters
gen-table-test.shgo-testingScaffold a table-driven test file

Quick Install

Using npx skills (Recommended)

The easiest way to install across any AI coding agent. Supports Cursor, Codex, OpenCode, Cline, GitHub Copilot, Windsurf, Roo Code, and 25+ more agents.

npx skills add cxuu/golang-skills --all

Claude Code

# Add the marketplace (one time)
/plugin marketplace add cxuu/golang-skills

# Install the skills
/plugin install golang-skills@cxuu-golang-skills

Cursor (Native Remote Rule)

  1. Open Cursor Settings (Cmd+Shift+J on Mac, Ctrl+Shift+J on Windows/Linux)
  2. Navigate to RulesAdd RuleRemote Rule (Github)
  3. Enter: https://github.com/cxuu/golang-skills

How It Works

These skills follow the Agent Skills open standard, which works across multiple AI coding tools. When you're writing Go code:

  1. Automatic activation: The AI agent loads relevant skills based on context (e.g., go-naming when you're writing a new function)
  2. Procedural guidance: Decision trees and step-by-step procedures for multi-step tasks like code review and error strategy selection
  3. Progressive disclosure: Core rules load immediately; 48 reference files load on demand when specific situations arise
  4. Automation: 8 bundled scripts handle repetitive checks so the agent focuses on higher-level guidance
  5. Conditional cross-references: Skills link to each other with "when" conditions to avoid unnecessary context loading
  6. Rule ownership: docs/RULE_OWNERSHIP.md keeps duplicated guidance out of non-owner skills

Project Structure

.
├── skills/
│   └── go-*/
│       ├── SKILL.md      # Core rules (< 225 lines each)
│       ├── references/   # Detailed guidance, loaded on demand
│       ├── scripts/      # Automation scripts and helpers
│       └── assets/       # Output templates (4 skills)
├── evals/
│   ├── evals.json        # Trigger and quality eval definitions
│   ├── files/            # Sample Go files for quality evals
│   └── fixtures/         # Test fixtures for script/eval coverage
├── docs/                 # Repository maintenance notes
├── .github/workflows/    # CI validation
└── source/               # Original style guide sources

Provenance and Compatibility

Bundled upstream source snapshots live under source/. Each source file keeps its own inline provenance header, and THIRD_PARTY_NOTICES.md summarizes the source path, upstream project, URL, license, and copyright at the repository level.

Go-version-sensitive guidance is tracked in COMPATIBILITY.md. When a skill recommends a standard-library API that depends on a specific Go release, the guidance should name the minimum Go version and include an older fallback where that helps users on maintained but older toolchains.

License

Project-authored skill files, scripts, assets, docs, and evals are licensed under the Apache License, Version 2.0. See LICENSE for details. Bundled upstream snapshots under source/ retain their upstream licenses; see THIRD_PARTY_NOTICES.md.

Files in the repo

Repository payload11 top-level entries
  • .claude-plugin
  • .github
  • docs
  • evals
  • skills
  • source
  • .gitignore
  • CHANGELOG.md
  • LICENSE
  • README.md
  • THIRD_PARTY_NOTICES.md

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