agent-test-runner

agent-test-runner is a skill for Claude Code, Codex from ZhangShenao/harness9. It costs 39 tokens per session (1,144 once invoked), scanned A, original, MIT.

A delegated Go test runner that runs all project tests and returns a structured report. It only reads source code and runs tests or other read-only commands.

In plain words
What is it for?
Use it to check every Go package with `go test ./...`, identify failed test cases or build errors, and give the main agent a concise test summary.
Why use it?
It removes the manual work of finding test files, running the full Go test suite, and extracting failures, timings, coverage, and compile errors.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to check every Go package with go test ./..., identify failed test cases or build errors, and give the main agent a concise test summary.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhangshenao/harness9/agent-test-runner
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.

Any agent
npx skills add ZhangShenao/harness9 --skill agent-test-runner
Clone the repo
git clone --depth 1 https://github.com/ZhangShenao/harness9

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for agent-test-runner

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhangshenao/harness9/agent-test-runner/github.svg)](https://agentmods.dev/skills/zhangshenao/harness9/agent-test-runner)
Your own site
<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.

agentmods 80×15 button for agent-test-runner

Your own site · 80×15
<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>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,144 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.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

Measured 14d ago against content hash 384184a83d9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

.dsh/skills/agent-test-runner/SKILL.md · 127 lines

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 句)

执行约束

  1. 只读不写:不修改任何源代码文件,不创建任何新文件
  2. 静默执行:执行过程中不向主 Agent 输出任何中间日志
  3. 如实报告:测试失败时如实呈现,不美化或隐藏失败信息
  4. 报告简洁:控制报告总长度,失败堆栈截取关键行(最多 20 行),完整信息已足够排查问题
  5. 不修复 Bug:发现测试失败时,只报告不修复,由主 Agent 决定下一步行动

Read the full file on GitHub · 127 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. 14d ago First seen · 127 lines · 39 tokens per session scan A 384184a83d9e

Subscribe to this mod's changes

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.

Related

agent-test-runner compared with skills from other repositories

agent-test-runner next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-test-runnerZhangShenao/harness9Skill166yesterdayMITA39Claude Code, Codex
test-masterJeffallan/claude-skillsSkill13kyesterdayMITA104Claude Code
migrate-xunit-to-xunit-v3dotnet/skillsSkill6.5ktodayMITA149Claude Code
go-testingGentleman-Programming/gentle-aiSkill9.8k2d agoMITA26Claude Code, Codex
dart-testdartsim/dartSkill1.2k2d agoBSD-2-ClauseA18Claude Code, Codex
restore-internals-seams-in-finally-blocks-after-each-testZaxbyHub/opencode-swarmSkill557todayMITA26OpenCode
test-generatorrshankras/claude-code-apple-skillsSkill92827d agoMITA33Claude Code