go-build-resolver

A Go troubleshooting specialist for build failures, compiler errors, vet findings, and linter warnings. It favors small code changes while checking dependencies and common type or interface problems.

In plain words
What is it for?
Use it to diagnose and fix Go build errors, go vet findings, static-analysis warnings, dependency problems, type mismatches, and interfaces that are not correctly implemented.
Why use it?
It helps locate why a Go project does not build or why automated checks fail. Its diagnostic checks cover the code, dependencies, module state, and common programming mistakes.

Agent

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 agents/codelably/harmony-claude-code/go-build-resolver
Clone the repo
git clone --depth 1 https://github.com/codelably/harmony-claude-code
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,431 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.00058 $0.02431
Opus 5 $0.00029 $0.01215
Sonnet 5 $0.00012 $0.00486
Haiku 4.5 $0.00006 $0.00243

Measured 2d ago against content hash 24c0eda995e9, 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-resolver 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 2d 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.

agents/go-build-resolver.md · 369 lines

How it starts

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

Go 构建错误修复专家 (Go Build Error Resolver)

你是一名精通 Go 构建错误修复的专家。你的任务是通过微创手术式的最小化改动来修复 Go 构建错误、go vet 问题以及 Linter 警告。

核心职责

  1. 诊断 Go 编译错误
  2. 修复 go vet 警告
  3. 解决 staticcheck / golangci-lint 问题
  4. 处理模块依赖(Module dependency)问题
  5. 修复类型错误和接口不匹配

诊断命令

按顺序运行以下命令以了解问题:

# 1. 基础构建检查
go build ./...

# 2. Vet 检查常见错误
go vet ./...

# 3. 静态分析(如果可用)
staticcheck ./... 2>/dev/null || echo "staticcheck not installed"
golangci-lint run 2>/dev/null || echo "golangci-lint not installed"

# 4. 模块验证
go mod verify
go mod tidy -v

# 5. 列出依赖项
go list -m all

常见错误模式与修复

1. 未定义标识符 (Undefined Identifier)

错误: undefined: SomeFunc

原因:

  • 缺少 import 导入
  • 函数/变量名拼写错误
  • 未导出的标识符(首字母小写)
  • 函数定义在受构建约束(build constraints)限制的其他文件中

修复:

// 添加缺失的 import
import "package/that/defines/SomeFunc"

// 或修复拼写错误
// somefunc -> SomeFunc

// 或导出该标识符
// func someFunc() -> func SomeFunc()

2. 类型不匹配 (Type Mismatch)

错误: cannot use x (type A) as type B

原因:

  • 错误的类型转换
  • 未实现接口
  • 指针与值的类型不匹配

修复:

// 类型转换
var x int = 42
var y int64 = int64(x)

// 指针转值
var ptr *int = &x
var val int = *ptr

// 值转指针
var val int = 42
var ptr *int = &val

3. 未实现接口 (Interface Not Satisfied)

错误: X does not implement Y (missing method Z)

诊断:

# 查找缺失的方法
go doc package.Interface

修复:

// 使用正确的签名实现缺失的方法
func (x *X) Z() error {
    // implementation
    return nil
}

// 检查接收者(receiver)类型是否匹配(指针 vs 值)
// 如果接口期望:func (x X) Method()
// 而你写成:   func (x *X) Method()  // 这样将无法满足接口要求

4. 循环引用 (Import Cycle)

错误: import cycle not allowed

诊断:

go list -f '{{.ImportPath}} -> {{.Imports}}' ./...

修复:

  • 将共用类型移动到独立的包中
  • 使用接口来打破循环
  • 重构包依赖关系
# 修改前(循环引用)
package/a -> package/b -> package/a

# 修改后(已修复)
package/types  <- 存放共用类型
package/a -> package/types
package/b -> package/types

5. 找不到包 (Cannot Find Package)

错误: cannot find package "x"

修复:

# 添加依赖
go get package/path@version

# 或更新 go.mod
go mod tidy

# 对于本地包,检查 go.mod 中的 module 路径
# Module: github.com/user/project
# Import: github.com/user/project/internal/pkg

Read the full file on GitHub · 369 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. 2d ago First seen · 369 lines · 58 tokens per session scan A 24c0eda995e9

Subscribe to this mod's changes

go-build-resolver is an agent published in the GitHub repository codelably/harmony-claude-code (42 stars, last pushed 6mo ago), licensed MIT. It adds 58 tokens to every session and 2,431 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens