Agent Skills: Go Quality Gate

Runs Go code quality checks — formatting, static analysis, and tests. Use when checking Go code quality, linting Go code, running Go checks, validating Go code, go quality gate, check my Go project, or run go lint.

UncategorizedID: philoserf/claude-code-setup/go-quality-gate

Install this agent skill to your local

pnpm dlx add-skill https://github.com/philoserf/claude-code-setup/tree/HEAD/skills/go-quality-gate

Skill Files

Browse the full folder contents for go-quality-gate.

Download Skill

Loading file tree…

skills/go-quality-gate/SKILL.md

Skill Metadata

Name
go-quality-gate
Description
Runs Go code quality checks. Use when checking Go code quality, linting, running checks, or validating a Go project. Covers formatting with gofmt, static analysis with go vet, and test execution.

Go Quality Gate

Run a standardized set of Go quality checks. Auto-fix what's fixable, report the rest with specific locations.

Prerequisites

Verify these tools are available before running checks. If missing, suggest installation.

  • gofumpt — stricter gofmt (go install mvdan.cc/gofumpt@latest)
  • golangci-lint — meta-linter (go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)

Check Sequence

Run checks in this order. Each phase builds on the previous — formatting first so later tools analyze clean code.

1. Format (auto-fix)

Run gofumpt -extra -w . — report which files were modified. If no files changed, report "formatting clean."

2. Go fix (auto-fix)

Run go fix ./... — apply automated fixes for API changes. Report any fixes applied.

3. Go vet (report)

Run go vet ./... — report issues with file, line, and message. Do not attempt to auto-fix vet findings without user confirmation, as they often involve subtle correctness issues.

4. Build (report)

Run go build ./... — verify the project compiles. If this fails, report errors and stop — test and lint results are unreliable against code that doesn't build.

5. Test (report)

Run go test -race -count=1 ./... — race detector enabled, -count=1 disables test caching for a fresh run. Report pass/fail per package.

6. Lint (report)

Run golangci-lint run ./... — if a .golangci.yml exists, it's picked up automatically. Report issues grouped by linter with file and line.

Output

After all checks complete, present a summary table:

| Check          | Status | Details           |
|----------------|--------|-------------------|
| gofumpt        | FIXED  | 3 files formatted |
| go fix         | CLEAN  |                   |
| go vet         | PASS   |                   |
| go build       | PASS   |                   |
| go test        | FAIL   | 2/15 packages     |
| golangci-lint  | WARN   | 4 issues          |

Then list specific issues grouped by file, with line numbers. Offer to fix reported issues if the user wants.