zhangshenao/harness9/go-coding-standards
Claude Code and agent skill by zhangshenao/harness9
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Use when writing or reviewing Go code — explains harness9 project coding conventions and patterns
Install
npx vskill@latest install zhangshenao/harness9/go-coding-standardsSKILL.md
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)包装错误,保留错误链
构造函数
命名规范:New + 类型名
接口定义原则
接口定义在使用者侧,而非实现者侧。
并发模式
并发工具执行使用预分配切片 + 索引写入,确保结果顺序:
添加新工具的步骤
- 在
internal/tools/下创建xxx.go,实现BaseTool接口 - 使用
safePath()校验所有文件路径参数 - 在
internal/tools/xxx_test.go中添加表驱动测试 - 在
cmd/harness9/main.go中注册工具
测试规范
- 使用标准库
testing包,不引入第三方断言库 - 表驱动测试优先
- 运行:
go test ./...
代码检查
提交前必须通过:
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/go-coding-standards/SKILL.md
Popularity
- Repository stars
- 143
- Repository forks
- 11
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zhangshenao/harness9/go-coding-standards)