Agent skill

Go Linting

by cxuu in cxuu/golang-skills

A skill your agent uses when setting up linting for a Go project, configuring golangci-lint, or adding Go checks to a CI/CD pipeline.

Apache-2.0Auto-check passedDevelopment

Install Go Linting

skills CLI
$ npx skills add cxuu/golang-skills --skill go-linting -a claude-code

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

GitHub CLI
$ gh skill install cxuu/golang-skills go-linting --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/cxuu/golang-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/go-linting .claude/skills/go-linting && 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-linting
GitHub stars
173
Token cost
~1.4k tokens
SKILL.md length
496 words
Files
3 (incl. scripts, assets)
Skills in repo
20
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when setting up linting for a Go project, configuring golangci-lint, or adding Go checks to a CI/CD pipeline.

  • Works in 4 steps: Create .golangci.yml with… → Run golangci-lint run ./... → If errors appear, fix them category by… → …
  • Setting up linting for a Go project
  • SKILL.md covers Core Principle, Resource Routing, Setup Procedure and Minimum Recommended Linters, plus 7 more sections
  • Runs Shell scripts from its folder; calls go

What it does

Go Linting is an agent skill from cxuu/golang-skills. Use when setting up linting for a Go project, configuring golangci-lint, or adding Go checks to a CI/CD pipeline. Also use when starting a new Go project and deciding which linters to enable, even if the user only asks about "code quality" or "static analysis" without mentioning specific linter names. Does not cover code review process (see go-code-review).

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and assets (for example `assets/golangci.yml` and `scripts/setup-lint.sh`).

It sits in Development, covering Linting and formatting. The repository describes itself as: AI Agent Skills for idiomatic, production-ready Go code, distilled from Google, Uber, Community. The licence is Apache-2.0.

When your agent uses it

  • Setting up linting for a Go project
  • Configuring golangci-lint
  • Adding Go checks to a CI/CD pipeline
  • Starting a new Go project and deciding which linters to enable

Example prompts

  • “code quality”
  • “static analysis”
  • “/go-linting”

Requirements

  • A Bash shell
  • Pre-approved tools (allowed-tools): Bash(bash:*)

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Create .golangci.yml with scripts/setup-lint.sh or copy assets/golangci.yml
  2. Run golangci-lint run ./...
  3. If errors appear, fix them category by category (formatting first, then vet, then style)
  4. Re-run until clean

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(bash:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    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):

    • github.com
    • pkg.go.dev
    • staticcheck.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 Linting loads about 1.4k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 496 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~93
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

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 passed

The automated check found no risky patterns in SKILL.md.

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); the scripts in this folder are not scanned.

SKILL.md

The full file from cxuu/golang-skills at commit 91f0c2e, republished under its Apache-2.0 licence (© cxuu). 496 words, ~1,445 tokens.

Download SKILL.mdSave it as .claude/skills/go-linting/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
go-linting
description
Use when setting up linting for a Go project, configuring golangci-lint, or adding Go checks to a CI/CD pipeline. Also use when starting a new Go project and deciding which linters to enable, even if the user only asks about "code quality" or "static analysis" without mentioning specific linter names. Does not cover code review process (see go-code-review).
allowed-tools
Bash(bash:*)

Go Linting

Core Principle

More important than any "blessed" set of linters: lint consistently across a codebase.

Consistent linting helps catch common issues and establishes a high bar for code quality without being unnecessarily prescriptive.

Resource Routing

  • scripts/setup-lint.sh - Run when generating a .golangci.yml, validating the first lint pass, or producing JSON metadata.
  • assets/golangci.yml - Use as the v2 golangci-lint baseline for established projects.

Setup Procedure

  1. Create .golangci.yml with scripts/setup-lint.sh or copy assets/golangci.yml
  2. Run golangci-lint run ./...
  3. If errors appear, fix them category by category (formatting first, then vet, then style)
  4. Re-run until clean

After generating .golangci.yml, run golangci-lint config verify --config .golangci.yml to verify the configuration schema before relying on lint results.


These linters catch the most common issues while maintaining a high quality bar:

LinterPurpose
errcheckEnsure errors are handled
goimportsFormat code and manage imports
reviveCommon style mistakes (modern replacement for golint)
govetAnalyze code for common mistakes
staticcheckVarious static analysis checks

Note: revive is the modern, faster successor to the now-deprecated golint.


Lint Runner: golangci-lint

Use golangci-lint as your lint runner. See the example .golangci.yml from uber-go/guide.


Example Configuration

Use assets/golangci.yml as the maintained example. It targets golangci-lint v2 (verified with 2.10.1 on 2026-06-19), keeps goimports under formatters, and enables the core linters plus common production additions.

Running
bash
# Install the version this skill's config is verified against
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1

# Run all linters
golangci-lint run

# Run on specific paths
golangci-lint run ./pkg/...

Beyond the minimum set, consider these for production projects:

LinterPurposeWhen to enable
gosecSecurity vulnerability detectionAlways for services handling user input
ineffassignDetect ineffectual assignmentsAlways — catches dead code
misspellCorrect common misspellings in comments/stringsAlways
gocycloCyclomatic complexity thresholdWhen functions exceed ~15 complexity
exhaustiveEnsure switch covers all enum valuesWhen using iota enums
bodycloseDetect unclosed HTTP response bodiesAlways for HTTP client code

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

Nolint Directives

When suppressing a lint finding, always explain why:

go
//nolint:errcheck // fire-and-forget logging; error is not actionable
_ = logger.Sync()

Rules:

  • Use //nolint:lintername — never bare //nolint
  • Place the comment on the same line as the finding
  • Include a justification after //

CI/CD Integration

Run golangci-lint run ./... in CI after tests. Pin the golangci-lint version used by CI so local and release behavior do not drift.

Pre-commit Hook
bash
#!/bin/sh
# .git/hooks/pre-commit
golangci-lint run --new-from-rev=HEAD~1

Use --new-from-rev to lint only changed code, keeping the feedback loop fast.


Quick Reference

TaskCommand/Action
Install golangci-lintgo install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1
Run lintersgolangci-lint run
Run on pathgolangci-lint run ./pkg/...
Config file.golangci.yml in project root
CI integrationRun golangci-lint run in pipeline
Nolint directives//nolint:name // reason — never bare //nolint
CI integrationUse golangci/golangci-lint-action for GitHub Actions
Pre-commitgolangci-lint run --new-from-rev=HEAD~1
Linter Selection Guidelines
When you need...Use
Error handling coverageerrcheck
Import formattinggoimports
Style consistencyrevive
Bug detectiongovet, staticcheck
All of the abovegolangci-lint with config

  • Style foundations: See go-style-core when resolving style questions that linters enforce (formatting, nesting, naming)
  • Code review: See go-code-review when combining linter output with a manual review checklist
  • Error handling: See go-error-handling when errcheck flags unhandled errors and you need to decide how to handle them
  • Testing: See go-testing when running linters alongside tests in CI pipelines

© cxuu, Apache-2.0. 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 2 other files (scripts, assets) in skills/go-linting of cxuu/golang-skills.

  • SKILL.md
  • assets/golangci.yml
  • scripts/setup-lint.sh

Open the folder on GitHubat commit 91f0c2e

Compare with similar skills

Go Linting 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 Linting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go Linting this skillcxuu/golang-skills173—~1.4kAutomated safety check: PassApache-2.0
Minimizing Ty Ecosystem Changesastral-sh/ruff50k—~4.6kAutomated safety check: PassMIT
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.4k—~2.2kAutomated safety check: PassMIT
Babysit PR To Pass CIsgl-project/sglang37k2 repos~3kAutomated safety check: PassApache-2.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
Summarise Ecosystem Resultsastral-sh/ruff50k—~2.2kAutomated safety check: PassMIT

Similar skills

  • Official

    A skill your agent uses when a user says "minimize this ty ecosystem change", "reproduce this ecosystem result", "investigate a primer difference", "investigate a mypyprimer difference"…

    50k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.

    5.4k GitHub stars~2.2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Babysit PR To Pass CI

    sgl-project/sglang

    Start and persistently pursue a goal to babysit an SGLang pull request until selected GitHub Actions workflows pass on the latest PR head.

    37k GitHub starsUsed in 2 repos~3k tokens
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when a user says "summarise ecosystem results", "summarize this ty ecosystem report", "what changed in this ecosystem run?", or asks to summarise or summarize ty ecosystem…

    50k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Go Pedantry

    chromedp/chromedp

    This skill should be used when the user is writing Go code and needs guidance on Go-specific pedantry: error wrapping with fmt.Errorf and %w, interface design (accept interfaces return structs)…

    13k GitHub stars~3.7k tokensUpdated today
    DevelopmentAuto-check passed

More from cxuu/golang-skills

All 20 skills in this repo
  • Go Testing

    cxuu/golang-skills

    A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff.

    173 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Go Code Review

    cxuu/golang-skills

    A skill your agent uses when reviewing Go code or checking code against community style standards.

    173 GitHub stars~2.7k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Performance

    cxuu/golang-skills

    A skill your agent uses when optimizing Go code, investigating slow performance, or writing performance-critical sections.

    173 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Go Documentation

    cxuu/golang-skills

    A skill your agent uses when writing or reviewing documentation for Go packages, types, functions, or methods.

    173 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Error Handling

    cxuu/golang-skills

    A skill your agent uses when writing Go code that returns, wraps, or handles errors — choosing between sentinel errors, custom types, and fmt.Errorf (%w vs %v), structuring error flow, or deciding…

    173 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Interfaces

    cxuu/golang-skills

    A skill your agent uses when defining or implementing Go interfaces, designing abstractions, creating mockable boundaries for testing, or composing types through embedding.

    173 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed

Categories

Questions about Go Linting

What does Go Linting do?

A skill your agent uses when setting up linting for a Go project, configuring golangci-lint, or adding Go checks to a CI/CD pipeline. Go Linting is an agent skill from cxuu/golang-skills. Use when setting up linting for a Go project, configuring golangci-lint, or adding Go checks to a CI/CD pipeline.

When should I use Go Linting?

Go Linting fits situations like: setting up linting for a Go project; configuring golangci-lint; adding Go checks to a CI/CD pipeline; starting a new Go project and deciding which linters to enable.

How do I install Go Linting in Claude Code?

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

How do I install Go Linting in Codex?

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

Can I use Go Linting 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 cxuu/golang-skills --skill go-linting -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-linting, .gemini/skills/go-linting, .github/skills/go-linting and .opencode/skills/go-linting in your project.

What does Go Linting need to run?

Going by SKILL.md and its folder, Go Linting needs a shell for the scripts in its folder and the command-line tools its instructions call (go). Our summary lists: A Bash shell. Its frontmatter pre-approves these tools: Bash(bash:*).

Does Go Linting access the network?

SKILL.md names 3 domains. As links in the text: github.com, pkg.go.dev and staticcheck.dev. This is read from the text; nothing was executed.

Is Go Linting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Go Linting use?

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

How many tokens does Go Linting use?

About 1.4k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Go Linting?

Skills that share tags, products or a category with Go Linting: Minimizing Ty Ecosystem Changes (astral-sh/ruff, 50k stars), Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.4k stars), Babysit PR To Pass CI (sgl-project/sglang, 37k stars) and Rust Best Practices (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go Linting?

cxuu (a GitHub user) maintains it in cxuu/golang-skills, which has 173 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on June 20, 2026.

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