go-build

A command for diagnosing and fixing Go build errors, vet warnings, and linter problems in small, incremental changes. Go is a programming language, and these tools check whether Go code builds and follows common rules.

In plain words
What is it for?
Use it when Go code fails to build, static analysis reports problems, dependencies are inconsistent, or a recent change has broken the project.
Why use it?
It groups confusing compiler and analysis output, fixes one issue at a time, and checks the result after each change.

Command

Part of the everything-claude-code plugin — 18 skills, 24 commands, 15 agents, 6 hooks shipped together

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.

agentmods
npx agentmods add commands/codelably/harmony-claude-code/go-build
Clone the repo
git clone --depth 1 https://github.com/codelably/harmony-claude-code

Or install everything-claude-code, the plugin that ships this one along with the rest of its 18 skills, 24 commands, 15 agents, 6 hooks.

Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,232 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00049 $0.01232
Opus 5 $0.00024 $0.00616
Sonnet 5 $0.00010 $0.00246
Haiku 4.5 $0.00005 $0.00123

Measured 3d ago against content hash 34dabb5f8d9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

go-build 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 3d 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.

commands/go-build.md · 184 lines

How it starts

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

Go 构建与修复 (Go Build and Fix)

此命令会调用 go-build-resolver 智能体(Agent),以最小的改动增量修复 Go 构建错误。

此命令的作用

  1. 运行诊断:执行 go buildgo vetstaticcheck
  2. 解析错误:按文件分组并按严重程度排序
  3. 增量修复:一次修复一个错误
  4. 验证每次修复:每次更改后重新运行构建
  5. 报告摘要:显示已修复的内容和剩余的问题

何时使用

在以下情况下使用 /go-build

  • go build ./... 失败并报错
  • go vet ./... 报告问题
  • golangci-lint run 显示警告
  • 模块依赖关系损坏
  • 拉取了破坏构建的更改后

运行的诊断命令

# 主要构建检查
go build ./...

# 静态分析
go vet ./...

# 扩展 lint 检查(如果可用)
staticcheck ./...
golangci-lint run

# 模块问题
go mod verify
go mod tidy -v

会话示例

User: /go-build

Agent:
# Go 构建修复 (Go Build Resolution)

## 初始诊断

```bash
$ go build ./...
internal/service/user.go:25:15: undefined: UserRepository
internal/handler/api.go:42:9: cannot use x (type string) as type int
internal/handler/api.go:58:2: missing return at end of function

发现错误:3

修复 1:未定义标识符 (Undefined Identifier)

文件:internal/service/user.go:25 错误:undefined: UserRepository 原因:缺少导入 (Missing import)

// 添加了导入
import "project/internal/repository"

// 更改了
var repo UserRepository
// 为
var repo repository.UserRepository
$ go build ./...
# 剩余 2 个错误

修复 2:类型不匹配 (Type Mismatch)

文件:internal/handler/api.go:42 错误:cannot use x (type string) as type int

// 更改了
count := params.Get("count")
// 为
countStr := params.Get("count")
count, _ := strconv.Atoi(countStr)
$ go build ./...
# 剩余 1 个错误

修复 3:缺少返回 (Missing Return)

文件:internal/handler/api.go:58 错误:missing return at end of function

func GetUser(id string) (*User, error) {
    if id == "" {
        return nil, ErrInvalidID
    }
    user := findUser(id)
    // 添加了缺少的 return
    return user, nil
}
$ go build ./...
# 构建成功!

最终验证

$ go vet ./...
# 无问题

$ go test ./...
ok      project/internal/service   0.015s
ok      project/internal/handler   0.023s

摘要

指标 计数
已修复构建错误 3
已修复 Vet 警告 0
修改的文件 2
剩余问题 0

构建状态:✅ 成功 (SUCCESS)

Read the full file on GitHub · 184 lines

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. 3d ago First seen · 184 lines · 49 tokens per session scan A 34dabb5f8d9b

Subscribe to this mod's changes

go-build is a command published in the GitHub repository codelably/harmony-claude-code (42 stars, last pushed 6mo ago), licensed MIT. It adds 49 tokens to every session and 1,232 once invoked, about $0.0002 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-30.