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.
npx skills add ZhangShenao/harness9 --skill go-coding-standardsgit clone --depth 1 https://github.com/ZhangShenao/harness9Wrote 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.
[](https://agentmods.dev/skills/zhangshenao/harness9/go-coding-standards)<a href="https://agentmods.dev/skills/zhangshenao/harness9/go-coding-standards"><img src="https://agentmods.dev/badge/skills/zhangshenao/harness9/go-coding-standards/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.
<a href="https://agentmods.dev/skills/zhangshenao/harness9/go-coding-standards"><img src="https://agentmods.dev/badge/skills/zhangshenao/harness9/go-coding-standards.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.01029 |
| Opus 5.5 | $0.00014 | $0.00412 |
| Sonnet 5.5 | $0.00007 | $0.00206 |
| Haiku 4.5 | $0.00004 | $0.00103 |
Grade A, and why
go-coding-standards 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 14d 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.
How it starts
The opening of the file, as written. The whole thing — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.
harness9 Go 编码规范
命名规范
| 类别 | 规范 | 示例 |
|---|---|---|
| 包名 | 小写、单单词、无下划线 | engine、provider、schema |
| 导出类型/函数 | PascalCase | AgentEngine、NewRegistry |
| 未导出类型/函数 | camelCase | mainLoop、runLoop |
| 接口名 | 以 -er 后缀为惯例 |
Provider、Registry、BaseTool |
| 常量 | PascalCase(导出)或 camelCase(未导出),不使用全大写 | RoleSystem、maxLogOutputLen |
| 配置选项函数 | With 前缀 |
WithMaxTurns、WithToolTimeout |
错误处理
- 显式检查所有
error返回值,禁止_忽略 - 错误消息不以大写字母开头、不以句号结尾
- 使用
fmt.Errorf("context: %w", err)包装错误,保留错误链
// ✅ 正确
result, err := doSomething()
if err != nil {
return fmt.Errorf("do something: %w", err)
}
// ❌ 错误
result, _ := doSomething()
构造函数
命名规范:New + 类型名
func NewReadFileTool(workDir string) *ReadFileTool {
return &ReadFileTool{workDir: filepath.Clean(workDir)}
}
接口定义原则
接口定义在使用者侧,而非实现者侧。
// ✅ 正确:Registry 接口定义在 tools 包(使用者侧)
// internal/tools/registry.go
type Registry interface {
Register(tool BaseTool) error
GetAvailableTools() []schema.ToolDefinition
Execute(ctx context.Context, call schema.ToolCall) schema.ToolResult
}
// ❌ 错误:不要在实现所在的包中定义接口
并发模式
并发工具执行使用预分配切片 + 索引写入,确保结果顺序:
// Go 1.22+ 中 for range 每次迭代已自动创建新绑定,无需手动传参捕获。
// 本项目使用 Go 1.25,以下写法是正确的:
results := make([]schema.ToolResult, len(toolCalls))
var wg sync.WaitGroup
for i, tc := range toolCalls {
wg.Add(1)
go func() {
defer wg.Done()
toolCtx, cancel := context.WithTimeout(ctx, e.toolTimeout)
defer cancel()
results[i] = e.registry.Execute(toolCtx, tc)
}()
}
wg.Wait()
添加新工具的步骤
- 在
internal/tools/下创建xxx.go,实现BaseTool接口 - 使用
safePath()校验所有文件路径参数 - 在
internal/tools/xxx_test.go中添加表驱动测试 - 在
cmd/harness9/main.go中注册工具
type MyTool struct {
workDir string
}
func (t *MyTool) Name() string { return "my_tool" }
func (t *MyTool) Definition() schema.ToolDefinition { /* JSON Schema */ }
func (t *MyTool) Execute(ctx context.Context, args json.RawMessage) (string, error) { /* ... */ }
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.
- 14d ago Changed · -1 lines · +13 tokens per session b664b619872a
- 3mo ago First seen · 137 lines · 23 tokens per session scan A f45b3f9b5902
go-coding-standards is a skill published in the GitHub repository ZhangShenao/harness9 (166 stars, last pushed yesterday), licensed MIT. It adds 36 tokens to every session and 1,029 once invoked, about $0.0001 per session on Opus 5.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.
go-coding-standards compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| go-coding-standardsZhangShenao/harness9 | Skill | 166 | yesterday | MIT | A | 36 | Claude Code, Codex |
| pr-to-go-lintergithub/gh-aw | Skill | 5.8k | today | MIT | A | 22 | Claude Code, Codex |
| golang-refactoringsamber/cc-skills-golang | Skill | 4.1k | 5d ago | MIT | A | 220 | Claude Code |
| design-reviewdimetron/pi-go | Skill | 235 | today | MIT | A | 30 | Claude Code, Codex |
| agents-mddimetron/pi-go | Skill | 235 | today | MIT | A | 138 | Claude Code, Codex |
| laravel-php-to-goAsyrafHussin/agent-skills | Skill | 118 | 2d ago | MIT | A | 206 | Claude Code, Codex |
| go-for-laravel-developersAsyrafHussin/agent-skills | Skill | 118 | 2d ago | MIT | A | 232 | Claude Code, Codex |