Agent skill

Go Guidelines

by mhmtszr in mhmtszr/go-guidelines

Applies version-aware Go guidance when writing or reviewing Go code, loading only the reference files that match the task, from syntax and performance to concurrency and testing.

MITAuto-check: warningsDevelopment

Install Go Guidelines

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add mhmtszr/go-guidelines --skill go-guidelines -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mhmtszr/go-guidelines go-guidelines --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mhmtszr/go-guidelines.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/go-guidelines .claude/skills/go-guidelines && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
go-guidelines
GitHub stars
104
Token cost
~885 tokens
SKILL.md length
369 words
Files
11 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Applies version-aware Go guidance when writing or reviewing Go code, loading only the reference files that match the task, from syntax and performance to concurrency and testing.

  • Writing new Go code that should match the project's Go version
  • SKILL.md covers Detected Go Version, How to Use, Reference Loading and After Making Changes
  • Calls go
  • Reviewing Go code for concurrency, error handling or performance issues

What it does

A shell command embedded in the SKILL.md reads the `go` line from `go.mod` files and reports the most common version, and the agent is told to use that result and not search for the version itself. When a version is found, it states that it will follow Go practices and modern syntax up to that version, offers to change the target, and neither lists features nor asks for confirmation. When the result is unknown, it says so and asks which version to target, offering 1.20 through 1.27.

References are loaded one topic at a time and never all at once, and the agent stops at the detected version boundary so newer features are ignored. Ten files cover modern syntax, performance and struct layout, concurrency, patterns such as HTTP servers, shutdown and middleware, testing with mocks, benchmarks and fuzzing, error handling, slices and maps, context, generics, and pitfalls like nil traps and shadowing. A task can need several, for instance a concurrent function with tests uses the syntax, concurrency and testing files. The excerpt stops before the section on what to do after making changes.

When your agent uses it

  • Writing new Go code that should match the project's Go version
  • Reviewing Go code for concurrency, error handling or performance issues
  • Adding tests, benchmarks or fuzz tests to a Go package
  • Introducing generics or context cancellation into existing Go code

Example prompts

  • “Write an HTTP server in Go with graceful shutdown and a health check.”
  • “Review this Go worker pool for goroutine leaks and false sharing.”
  • “Add table-driven tests and a benchmark for the parser package.”
  • “Convert this utility to generics using the features my Go version supports.”

Requirements

  • A Go project, ideally with a go.mod file so the version can be detected

What it can do on your machine

Read from SKILL.md and the folder at commit fbd5535. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • go.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Go Guidelines loads about 885 tokens when it runs, and up to ~25k if it reads all its reference files. Until then it costs about 41 tokens; SKILL.md has 369 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~41
When it runs · the whole SKILL.md, loaded when a task matches
~885
With references · SKILL.md plus every file in references/, read only if the agent opens them
~25k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: warnings

The automated check found patterns that need a careful read before installing.

  • WarningTells the agent its actions are pre-authorized / not to stop for confirmationSKILL.md:18
    - Do NOT list features, do NOT ask for confirmation

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mhmtszr/go-guidelines at commit fbd5535, republished under its MIT licence (© mhmtszr). 369 words, ~885 tokens.

Download SKILL.mdSave it as .claude/skills/go-guidelines/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
go-guidelines
description
Go best practices for performance, modern syntax, generics, patterns, testing, error handling, and concurrency. Use when writing or reviewing Go code.

Go Guidelines

Detected Go Version

!grep -rh "^go " --include="go.mod" . 2>/dev/null | cut -d' ' -f2 | sort | uniq -c | sort -nr | head -1 | xargs | cut -d' ' -f2 | grep . || echo unknown

How to Use

DO NOT search for go.mod files or try to detect the version yourself. Use ONLY the version shown above.

If version detected (not "unknown"):

  • Say: "This project is using Go X.XX, so I'll follow Go best practices and modern syntax up to and including this version. If you'd prefer a different target version, just let me know."
  • Do NOT list features, do NOT ask for confirmation

If version is "unknown":

  • Say: "Could not detect Go version in this repository"
  • Use AskUserQuestion: "Which Go version should I target?" with options ... / [1.20] / [1.21] / [1.22] / [1.23] / [1.24] / [1.25] / [1.26] / [1.27] / ...

Reference Loading

Read ONLY the reference file(s) relevant to your current task. Do NOT load all files at once.

When reading reference files, stop at the detected Go version boundary — ignore features from newer versions.

When you are...Read this reference
Using version-specific Go syntax or idiomsreferences/modern-syntax.md
Optimizing performance, struct layout, escape analysisreferences/performance.md
Working with goroutines, channels, sync, select, false sharingreferences/concurrency.md
Writing HTTP servers, shutdown, health checks, middleware, interfaces, io.Readerreferences/patterns.md
Writing tests, mocks, benchmarks, fuzz testsreferences/testing.md
Handling errors, wrapping, custom error typesreferences/error-handling.md
Working with slices, maps, append, memory leaksreferences/slices-and-maps.md
Using context.Context, values, cancellation, timeoutsreferences/context-patterns.md
Using generics, type parameters, constraintsreferences/generics.md
Debugging subtle bugs, nil traps, shadowing, sync copying, defer, timereferences/pitfalls.md

Multiple topics may apply. For example, writing a concurrent function with tests: load modern-syntax.md + concurrency.md + testing.md.


Show full SKILL.md (107 more words)Show less

After Making Changes

After making Go code changes, run static analysis and tests on the changed packages:

bash
which golangci-lint >/dev/null 2>&1 && golangci-lint run ./path/to/changed/package/... || go vet ./path/to/changed/package/...
go test ./path/to/changed/package/... -race

If the detected Go version is 1.26 or newer, also run go fix on the changed packages (Using go fix to modernize Go code):

bash
go fix ./path/to/changed/package/...
  • Prefer golangci-lint when available, fall back to go vet
  • Always run tests with the race detector
  • On Go 1.26+, always run go fix after changes (use go fix -diff to preview; run twice if needed until a fixed point)
  • Fix all reported issues in the changed code before finishing
  • Do not fix pre-existing issues in unrelated code
  • If neither linter is available, skip silently and continue

© mhmtszr, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files (references) in skills/go-guidelines of mhmtszr/go-guidelines.

  • SKILL.md
  • references/concurrency.md
  • references/context-patterns.md
  • references/error-handling.md
  • references/generics.md
  • references/modern-syntax.md
  • references/patterns.md
  • references/performance.md
  • references/pitfalls.md
  • references/slices-and-maps.md
  • references/testing.md

Open the folder on GitHubat commit fbd5535

Compare with similar skills

Go Guidelines next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Go Guidelines compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go Guidelines this skillmhmtszr/go-guidelines104—~885Automated safety check: WarnMIT
Go Development Guidelinesjumppad-labs/jumppad263—~1.5kAutomated safety check: PassMPL-2.0
Strict Programming Practicescode-yeongyu/oh-my-openagent70k—~9.5kAutomated safety check: PassCustom licence
R Function Input Validationtidyverse/dplyr5.1k1 repos~2.3kAutomated safety check: PassCustom licence
Code Review Specialistluongnv89/claude-howto42k—~764Automated safety check: PassMIT
Cross-Language Coding Standardszereight/gitlab-mcp2k1 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Go Development Guidelines

    jumppad-labs/jumppad

    Sets idiomatic Go conventions with a test-first workflow, using testify/require for assertions and mockery for mocks, for new features, packages and refactors.

    263 GitHub stars~1.5k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Strict Programming Practices

    code-yeongyu/oh-my-openagent

    Applies strict, type-first coding rules for Python, Rust, TypeScript and Go, loading the matching language reference before the agent writes or edits any code.

    70k GitHub stars~9.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Validates arguments of exported R functions with the standalone check_* type checkers from rlang, in tidyverse style with clear error messages.

    5.1k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Code Review Specialist

    luongnv89/claude-howto

    Reviews code for security, performance, quality and maintainability, using a checklist, a finding template and two metrics scripts.

    42k GitHub stars~764 tokensUpdated 9 days ago
    DevelopmentAuto-check passed
  • Shared reference for naming, function size, complexity and error handling rules that reviewer agents apply across TypeScript, Python, Go, Rust, Java, C# and Swift.

    2k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Code Quality

    piomin/claude-ai-spring-boot

    Comprehensive code review for Java - clean code principles, API contracts, null safety, exception handling, and performance.

    1.3k GitHub stars~2.2k tokensUpdated 5 mo ago
    DevelopmentAuto-check passed

Works with

Categories

Questions about Go Guidelines

What does Go Guidelines do?

Applies version-aware Go guidance when writing or reviewing Go code, loading only the reference files that match the task, from syntax and performance to concurrency and testing. mod` files and reports the most common version, and the agent is told to use that result and not search for the version itself. When a version is found, it states that it will follow Go practices and modern syntax up to that version, offers to change the target, and neither lists features nor asks for confirmation.

When should I use Go Guidelines?

Go Guidelines fits situations like: writing new Go code that should match the project's Go version; reviewing Go code for concurrency, error handling or performance issues; adding tests, benchmarks or fuzz tests to a Go package; introducing generics or context cancellation into existing Go code.

How do I install Go Guidelines in Claude Code?

Run `npx skills add mhmtszr/go-guidelines --skill go-guidelines -a claude-code`. Or copy the skill folder (skills/go-guidelines in mhmtszr/go-guidelines) into .claude/skills/go-guidelines in your project. Claude Code loads it when a task matches its description.

How do I install Go Guidelines in Codex?

Run `npx skills add mhmtszr/go-guidelines --skill go-guidelines -a codex`. Or copy the skill folder (skills/go-guidelines in mhmtszr/go-guidelines) into .agents/skills/go-guidelines in your project. Codex loads it when a task matches its description.

Can I use Go Guidelines in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mhmtszr/go-guidelines --skill go-guidelines -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/go-guidelines, .gemini/skills/go-guidelines, .github/skills/go-guidelines and .opencode/skills/go-guidelines in your project.

What does Go Guidelines need to run?

Going by SKILL.md and its folder, Go Guidelines needs the command-line tools its instructions call (go). Our summary lists: A Go project, ideally with a go.mod file so the version can be detected.

Does Go Guidelines access the network?

SKILL.md names 1 domain. As links in the text: go.dev. This is read from the text; nothing was executed.

Is Go Guidelines safe to install?

Our automated static check of SKILL.md flagged 1 warning(s): tells the agent its actions are pre-authorized / not to stop for confirmation. Read the flagged lines before installing; the check is not a guarantee either way.

What licence does Go Guidelines use?

Go Guidelines is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Go Guidelines use?

About 885 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 24k tokens, read only when the agent opens those files.

What are the alternatives to Go Guidelines?

Skills that share tags, products or a category with Go Guidelines: Go Development Guidelines (jumppad-labs/jumppad, 263 stars), Strict Programming Practices (code-yeongyu/oh-my-openagent, 70k stars), R Function Input Validation (tidyverse/dplyr, 5.1k stars) and Code Review Specialist (luongnv89/claude-howto, 42k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go Guidelines?

mhmtszr (a GitHub user) maintains it in mhmtszr/go-guidelines, which has 104 GitHub stars. The repository was last updated on August 28, 2026.

Source: mhmtszr/go-guidelines on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.