golang-analyze

golang-analyze is a skill for Claude Code, Codex from eaglesakura/agent-skills. It costs 216 tokens per session (1,541 once invoked), scanned A, original, MIT.

A Go code-quality check that formats code, runs a linter to find common problems, and runs tests during or after development. It also covers whole workspaces and tests that use build tags.

In plain words
What is it for?
Use it to run go fmt, golangci-lint, and go test in a Go repository, including repositories with a go.work workspace file or tagged tests.
Why use it?
It gives Go projects a consistent check before changes are considered complete. Test failures are reported without changing the code automatically, and potentially disruptive fixes are left for the user to approve.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to run go fmt, golangci-lint, and go test in a Go repository, including repositories with a go.work workspace file or tagged tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eaglesakura/agent-skills/golang-analyze
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add eaglesakura/agent-skills --skill golang-analyze
Clone the repo
git clone --depth 1 https://github.com/eaglesakura/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for golang-analyze

README.md
[![agentmods](https://agentmods.dev/badge/skills/eaglesakura/agent-skills/golang-analyze/github.svg)](https://agentmods.dev/skills/eaglesakura/agent-skills/golang-analyze)
Your own site
<a href="https://agentmods.dev/skills/eaglesakura/agent-skills/golang-analyze"><img src="https://agentmods.dev/badge/skills/eaglesakura/agent-skills/golang-analyze/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for golang-analyze

Your own site · 80×15
<a href="https://agentmods.dev/skills/eaglesakura/agent-skills/golang-analyze"><img src="https://agentmods.dev/badge/skills/eaglesakura/agent-skills/golang-analyze.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 216 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,541 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00216 $0.01541
Opus 5 $0.00108 $0.00771
Sonnet 5 $0.00043 $0.00308
Haiku 4.5 $0.00022 $0.00154

Measured 11d ago against content hash fbed6fc58f61, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

golang-analyze scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/golang/.apm/skills/golang-analyze/SKILL.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Golang / コード品質(fmt・lint・test)

Go 実装のあと(または途中の節目)に、フォーマット → 静的解析 → ユニットテストで品質を確認する。 コマンド例は go / golangci-lint 本体で示す(mise 等のラッパーはリポジトリ規約に任せる)。

いつ使うか

  • AI / 人手のコーディング完了後、または区切りのよい途中経過での品質チェック
  • go fmt / golangci-lint / go test の実行方針を揃えるとき
  • go.work があるリポジトリで workspace 全体/個別 package を回すとき
  • ビルドタグ付きテスト(-tags=...)の付け方を決めるとき

いつ使わないか

  • *.go の書き方・コメント・データオブジェクト規約だけ → golang-coding-rules
  • ConnectRPC / Repository / Usecase 等の設計そのもの → 該当 golang.architecture.*
  • CI ワークフロー YAML の書き方(GitHub Actions 等の専用 SKILL がある場合はそちら)
  • Dart / Flutter の analyze・format(該当言語向けの品質 SKILL がある場合はそちら)

作業手順

  1. 作業ディレクトリを決める — 原則 go.work があるリポジトリルート(なければ対象 module ルート)
  2. Formatter を実行する
  3. Analyzer(golangci-lint) を実行する。指摘のうち 非破壊なら自動適用してよい
  4. Unit Test を実行する。Fail したら エラー内容のみ提示し、勝手に修正しない
  5. 破壊的になりそうな lint 修正案は、ユーザーに提示するだけにとどめる

Formatter

コーディング完了後(または区切り)に必ず実行する。結果はべき等で、副作用はない。

# go.work のディレクトリで実施する
go fmt ./...

Analyzer

コーディング完了後(または区切り)に必ず実行する。結果はべき等で、副作用はない。 提示された問題点のうち、非破壊的であれば自動的に実施してよい。

golangci-lint run ./...

ガードレール条項

  • ロジックの変更等、破壊的変更が生じる場合はユーザーに作業内容を提示するのみで、作業の実施は行わない

Unit Test

コーディング完了後(または区切り)に必ず実行する。結果はべき等であり、基本的に副作用はない。 外部 API 等に依存する場合は、環境・状況依存で失敗しうる。

  • Fail した場合、エラー内容のみをユーザーに提示する修正は行わない
  • リポジトリが //go:build タグを使う場合は、go test-tags={tags...} を付与する。{tags...} はプレースホルダであり、実行時にプロジェクト方針どおりのカンマ区切りタグ(例: dev,test)へ置き換える
# ビルドタグが必要な場合は {tags...} をカンマ区切りに置き換える(例: dev,test)
# workspace 全体(go.work があるリポジトリルート)
go test -tags={tags...} ./...

# 個別: パッケージ(ディレクトリ)単位
go test -tags={tags...} ./path/to/module

# 個別: 特定のテスト関数のみ(-run は正規表現)
go test -tags={tags...} ./path/to/module -run '^TestExample$'

ビルドタグが不要なプロジェクトでは -tags=... を付けない。

ナレッジベース

DO: fmt → lint → test の順で区切りごとに回す

  • フォーマットと静的解析を先に通してからテスト結果を読むと、ノイズが減る

DO: go.work ルートを起点にし、必要なら package / -run で絞る

  • 全体 ./... が重い・無関係な失敗が多いときは対象を狭める

DO: ビルドタグ方針があるなら -tags を忘れない

  • タグ無しだとテスト/コードがそもそもコンパイル対象外になることがある

Read the full file on GitHub · 107 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 107 lines · 216 tokens per session scan A fbed6fc58f61

Subscribe to this mod's changes

golang-analyze is a skill published in the GitHub repository eaglesakura/agent-skills (2 stars, last pushed 5d ago), licensed MIT. It adds 216 tokens to every session and 1,541 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

golang-testing

Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.

affaan-m/ECC · 37 tokens

timeouts-and-async

Make Ginkgo specs interruptible and test asynchronous behavior — SpecContext/context.Context cancellable nodes, NodeTimeout/SpecTimeout/GracePeriod, the --timeout flag, Abort and SIGINT behavior, Gomega Eventually/Consistently (the func(g Gomega) form, .WithContext), and the defer GinkgoRecover() rule for goroutines.…

onsi/ginkgo · 106 tokens

setup

Wire Ginkgo into a Go package — install the ginkgo CLI and Ginkgo+Gomega, ginkgo bootstrap to generate the suitetest.go (TestXxx/RegisterFailHandler(Fail)/RunSpecs), the package xxxtest convention, dot-import alternatives (aliased import, dsl/ subpackages, --nodot), ginkgo generate, and testing.T interop via…

onsi/ginkgo · 118 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens

overview

The Ginkgo mental model for writing Go tests — the one idea that explains everything (Ginkgo builds a spec tree at construction time, then runs it) and its consequences for how you write specs, plus spec independence and the node taxonomy. Use this first when you start working with Ginkgo in a project, or to decide…

onsi/ginkgo · 84 tokens

golang-stretchr-testify

Comprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use when writing tests with testify, creating mocks, setting up test suites, or choosing between assert and require. Covers testify assertions, mock expectations, argument matchers, call verification…

samber/cc-skills-golang · 97 tokens