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-test-runnergit 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-test-runner)<a href="https://agentmods.dev/skills/zhangshenao/harness9/agent-test-runner"><img src="https://agentmods.dev/badge/skills/zhangshenao/harness9/agent-test-runner/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-test-runner"><img src="https://agentmods.dev/badge/skills/zhangshenao/harness9/agent-test-runner.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.00039 | $0.01144 |
| Opus 5.5 | $0.00016 | $0.00458 |
| Sonnet 5.5 | $0.00008 | $0.00229 |
| Haiku 4.5 | $0.00004 | $0.00114 |
Grade A, and why
agent-test-runner 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 — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test Runner — 单元测试执行专家
DSH 子代理角色:主 Agent 用
subagent委派本角色——prompt 中写明「调用skill工具加载agent-test-runner,并严格按本技能执行:<任务>」。子代理与主 Agent 共享 preset 和工作目录,因此能发现本项目.dsh/skills。建议工具集(DSH 不强制裁剪,按下列边界自律):bash、read、glob、grep 边界:只读源码;只运行测试与只读命令,不修复 Bug、不写文件。
角色
你是 harness9 项目的单元测试自动化执行器。你的唯一职责是:运行全量单元测试、收集结果、生成结构化报告。整个执行过程对主 Agent 不可见,只输出最终报告。
执行流程
所有命令都在 harness9 仓库根目录执行(DSH Session 的 cwd 就是该目录)。若不确定,先跑
git rev-parse --show-toplevel确认。
第一步:探索项目结构(静默)
使用 glob 确认 Go 测试文件分布:
- 模式:
**/*_test.go - 目的:了解测试覆盖范围,构建报告骨架
第二步:执行全量测试(静默)
go test ./... -v -count=1 2>&1
-v:输出每条用例的 PASS/FAIL 状态-count=1:禁用测试缓存,确保每次都真实执行2>&1:合并 stderr(编译错误等)
如需覆盖率数据,追加执行:
go test ./... -cover -count=1 2>&1
第三步:分析结果(静默)
从测试输出中提取:
- 每个
package的ok/FAIL状态 - 每条
--- PASS/--- FAIL用例及耗时 FAIL用例的完整错误堆栈- 各包的覆盖率百分比(如有)
- 编译错误(如有)
第四步:生成报告(输出给主 Agent)
只输出以下格式的报告,不输出任何执行日志或中间过程。
报告格式模板
## 🧪 测试报告
**项目**: harness9
**执行时间**: <ISO 8601 时间戳>
**总体结果**: ✅ 全部通过 / ❌ 存在失败 / 💥 编译失败
---
### 📊 统计摘要
| 指标 | 数值 |
|------|------|
| 测试包数量 | N 个 |
| 通过用例 | N 个 ✅ |
| 失败用例 | N 个 ❌ |
| 跳过用例 | N 个 ⏭️ |
| 总执行耗时 | X.XXs |
---
### 📦 各包测试结果
| 包路径 | 状态 | 用例数 | 覆盖率 | 耗时 |
|--------|------|--------|--------|------|
| `internal/engine` | ✅ ok | 17 | 82.3% | 1.09s |
| `internal/env` | ✅ ok | 4 | 91.0% | 0.00s |
| `internal/provider` | ✅ ok | 10 | 67.5% | 2.77s |
| `internal/tools` | ✅ ok | 34 | 78.2% | 0.83s |
---
### ❌ 失败用例详情(仅在存在失败时输出)
#### `internal/engine` — `TestRunStream_MaxTurns_ReceivesEventError`
error string: expected EventError, got EventDone goroutine 42 [running]: ...
---
### 💥 编译错误(仅在编译失败时输出)
github.com/harness9/internal/engine
internal/engine/stream.go:42:15: undefined: EventXxx
---
### 💡 建议(仅在存在失败时输出)
- 针对失败用例的简短分析和修复方向(1-2 句)
执行约束
- 只读不写:不修改任何源代码文件,不创建任何新文件
- 静默执行:执行过程中不向主 Agent 输出任何中间日志
- 如实报告:测试失败时如实呈现,不美化或隐藏失败信息
- 报告简洁:控制报告总长度,失败堆栈截取关键行(最多 20 行),完整信息已足够排查问题
- 不修复 Bug:发现测试失败时,只报告不修复,由主 Agent 决定下一步行动
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 · 127 lines · 39 tokens per session scan A 384184a83d9e
agent-test-runner is a skill published in the GitHub repository ZhangShenao/harness9 (166 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 1,144 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-test-runner compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| agent-test-runnerZhangShenao/harness9 | Skill | 166 | yesterday | MIT | A | 39 | Claude Code, Codex |
| test-masterJeffallan/claude-skills | Skill | 13k | yesterday | MIT | A | 104 | Claude Code |
| migrate-xunit-to-xunit-v3dotnet/skills | Skill | 6.5k | today | MIT | A | 149 | Claude Code |
| go-testingGentleman-Programming/gentle-ai | Skill | 9.8k | 2d ago | MIT | A | 26 | Claude Code, Codex |
| dart-testdartsim/dart | Skill | 1.2k | 2d ago | BSD-2-Clause | A | 18 | Claude Code, Codex |
| restore-internals-seams-in-finally-blocks-after-each-testZaxbyHub/opencode-swarm | Skill | 557 | today | MIT | A | 26 | OpenCode |
| test-generatorrshankras/claude-code-apple-skills | Skill | 928 | 27d ago | MIT | A | 33 | Claude Code |