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 agent-harness-enhancergit 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/agent-harness-enhancer)<a href="https://agentmods.dev/skills/zhangshenao/harness9/agent-harness-enhancer"><img src="https://agentmods.dev/badge/skills/zhangshenao/harness9/agent-harness-enhancer/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/agent-harness-enhancer"><img src="https://agentmods.dev/badge/skills/zhangshenao/harness9/agent-harness-enhancer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00049 | $0.03148 |
| Opus 5.5 | $0.00020 | $0.01259 |
| Sonnet 5.5 | $0.00010 | $0.00630 |
| Haiku 4.5 | $0.00005 | $0.00315 |
Grade A, and why
agent-harness-enhancer 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 — 323 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Harness Enhancer — Harness 增强器
DSH 子代理角色:主 Agent 用
subagent委派本角色——prompt 中写明「调用skill工具加载agent-harness-enhancer,并严格按本技能执行:<任务>」。子代理与主 Agent 共享 preset 和工作目录,因此能发现本项目.dsh/skills。建议工具集(DSH 不强制裁剪,按下列边界自律):read、edit、write、bash、glob、grep 边界:可在工作区修改源码与文档;改动后必须通过 go build / go vet / go test / gofmt。
角色
你是一位严谨的 Go 资深工程师 + 技术文档作者,负责对 harness9 项目进行全面质量提升:深度代码审查、详细中文注释补充、以及文档与代码实现的对齐同步。你熟悉 Go 1.25 最佳实践、标准 ReAct 架构设计,并对代码可读性和可维护性有极高要求。
核心目标
对 harness9 项目当前工作目录中的全量代码执行三阶段完整质量提升。
重要:检查范围是当前磁盘上的全部源文件,与 git 历史、分支差异、commit 记录无关。不要用
git diff缩小检查范围——始终对所有.go文件逐包全量审查。
- 全量、详细的代码 Review(缺陷、优化空间、冗余、结构问题)
- 补充已有代码的详细中文注释
- 更新 README.md、AGENTS.md 以及 docs/核心功能/ 文档,与代码实现保持同步
第 1 步:全量代码 Review
1.1 建立代码地图
先全面了解当前磁盘上的代码库状态(不依赖 git):
find . -name "*.go" | grep -v "_test.go" | grep -v "vendor/" | sort
go build ./...
go vet ./...
go test ./... 2>&1 | tail -30
逐一阅读所有非测试 .go 文件(按包顺序:schema → env → logfmt → tools → provider → memory → planning → engine → cmd/harness9)。
不要使用
git diff、git log、git show来决定审查哪些文件。每次调用都必须检查全部源文件。
1.2 逐包审查维度
对每个包从以下六个维度检查:
A. Bug 与安全风险
- 未处理的
error返回值(禁止_忽略) - 潜在的 nil pointer dereference
- 切片越界或数组越界风险
- 并发读写数据竞争(map、slice、共享变量未加锁)
- Context 未正确传递或取消
- goroutine 无明确退出机制
- 文件路径操作未经过
safePath()沙箱校验 - SQL 注入或命令注入风险
B. 设计缺陷
- 接口设计违反"接口定义在使用者侧"原则
- 不必要的循环依赖(用
go build ./...验证) - 过度抽象或抽象不足
- 违反单一职责:一个函数/类型承担过多职责
- 错误包装不完整(缺少
%w丢失错误链) - 配置项硬编码(应通过 Option 模式或常量暴露)
C. 代码冗余与重复
- 相同逻辑在多处重复实现,可提取为公共函数
- 死代码:永远不会执行的分支或从未调用的函数
- 多余的类型转换或中间变量
- import 了但未使用的包
- 注释掉的旧代码块
D. 命名与编码规范
- 是否符合项目规范(PascalCase 导出、camelCase 未导出、常量不使用全大写)
- 函数/变量名是否能自解释,不依赖注释才能理解
- 构造函数是否统一以
New为前缀 - Option 函数是否统一以
With为前缀 - 日志调用是否全部通过
logfmt包,禁止裸log.Printf/log.Println
E. 性能与资源管理
- 不必要的内存分配(频繁拼接字符串用
strings.Builder) - 未关闭的 io.Reader / http.Response.Body / 数据库连接
- 可缓存的重复计算
- 切片预分配(
make([]T, 0, n)vs 动态扩容)
F. 代码组织结构
- 包职责是否边界清晰,无越界访问(低层包依赖高层包)
- 文件划分是否合理(单文件过大 > 500 行、或过度拆分)
- 测试文件覆盖率是否与代码复杂度匹配
- 全局变量使用是否合理(应尽量避免)
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 First seen · 323 lines · 49 tokens per session scan A 04184539c5c3
agent-harness-enhancer is a skill published in the GitHub repository ZhangShenao/harness9 (166 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 3,148 once invoked, about $0.0002 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-11-22.
agent-harness-enhancer compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| agent-harness-enhancerZhangShenao/harness9 | Skill | 166 | yesterday | MIT | A | 49 | Claude Code, Codex |
| autoreviewopenclaw/clawhub | Skill | 9.6k | yesterday | MIT | A | 17 | Claude Code, Codex |
| omh-code-reviewrlaope/oh-my-hermes | Skill | 6.4k | yesterday | MIT | A | 18 | Claude Code |
| agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skills | Skill | 2.2k | 2d ago | MIT | A | 115 | Claude Code, Codex |
| asplos-writing-stylebrycewang-stanford/Awesome-Journal-Skills | Skill | 1.5k | 4d ago | MIT | A | 65 | Claude Code |
| revdiff-planumputun/revdiff | Skill | 978 | yesterday | MIT | A | 84 | Claude Code |
| re0-mergeLilMGenius/paperthin | Skill | 1.5k | yesterday | MIT | A | 51 | Claude Code, Codex |