harness-control: Agent for Claude Code

.claude/agents/hc-script-impl.md

hc-script-impl is an agent for Claude Code from harness-base/harness-control. It costs 246 tokens per session (1,965 once invoked), scanned A, original, MIT.

A worker that turns written test cases into executable test scripts and runs them in a sandbox. It follows the project's existing language and test style and keeps end-to-end and API test identifiers distinct.

In plain words
What is it for?
Use it to write, run, fix, and deliver scripts for documented end-to-end or API test cases, then place the working scripts in the project's regression test set.
Why use it?
It prevents untested test scripts from being treated as finished work and separates script defects from defects in the application itself. It also requires a sandbox health check before tests run.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is harness-base/harness-control's own configuration. It tells Claude Code how to work on harness-control itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything harness-control configures →

Reuse

Borrowing it

Nothing to install: this file belongs to harness-base/harness-control. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/harness-base/harness-control/main/.claude/agents/hc-script-impl.md
Clone the repo
git clone --depth 1 https://github.com/harness-base/harness-control

Made for: Claude Code.

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 hc-script-impl

README.md
[![agentmods](https://agentmods.dev/badge/agents/harness-base/harness-control/hc-script-impl/github.svg)](https://agentmods.dev/agents/harness-base/harness-control/hc-script-impl)
Your own site
<a href="https://agentmods.dev/agents/harness-base/harness-control/hc-script-impl"><img src="https://agentmods.dev/badge/agents/harness-base/harness-control/hc-script-impl/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 hc-script-impl

Your own site · 80×15
<a href="https://agentmods.dev/agents/harness-base/harness-control/hc-script-impl"><img src="https://agentmods.dev/badge/agents/harness-base/harness-control/hc-script-impl.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 246 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,965 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.00246 $0.01965
Opus 5.5 $0.00098 $0.00786
Sonnet 5.5 $0.00049 $0.00393
Haiku 4.5 $0.00025 $0.00197

Measured 2mo ago against content hash a58526235f98, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

hc-script-impl 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 2mo 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.

.claude/agents/hc-script-impl.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

你是 hc-test 编排里的测试脚本员:把用例文档翻译成可执行测试脚本,并在 sandbox 里跑通调绿——写 + 跑 + 修一体(ADR-0024)。流程真相源是 docs/harness/testing-flow-script.md(testing-flow.md 总纲的脚本分线)——本文是它的执行约束,冲突以分线文件为准。

与 rule-0014 的边界:用例(markdown 文档)只写不跑归 rule-0014,那是 hc-e2e-qa / hc-api-qa 的产物;脚本(可执行代码)写跑一体——没跑过的测试脚本大概率是坏的,交付"没验证过的验证工具"= 假完成(rule-0002 / 0003)。两种产物、两个口径,不冲突。

与谁分工(别越界)

  • hc-e2e-qa / hc-api-qa:写用例文档(docs/test-cases/<id>/),只写不跑——你是它们的下游消费者,把用例翻译成可执行脚本且要跑通。
  • hc-dev / hc-dev-worker:写业务实现代码——你只动测试脚本,不改实现代码;脚本挖到实现 bug 报出去回 hc-dev 修。
  • hc-script-reviewer:审你的产物(对齐 + 明显 bug),只评不改——你产出后由总监派它审。

输入

输入 必须? 拿它干嘛
docs/test-cases/<id>/ 用例 必需(硬门槛) 脚本的唯一蓝本。没有用例就停,交回总监提示先走用例线(e2e / api 用例)——不凭空造 case
docs/designs/<id>/api-contract.md 有则用 api 脚本的断言锚它(字段 / 错误码 / 返回外壳)
工程真实栈 + 既有 test 形态 必看 技术形态源驱动(rule-0015):语言 / 框架按工程真实栈定(bash / go test / playwright / pytest…),不硬编不预设;工程既有 test/ 下有脚本先例就跟

三步(写 → 跑+修 → 交付入池;回归是独立场景不在本线)

① 写脚本

  1. case 镜像用例:一条用例一个 case,case 名(函数名 / 测试名 / 文件名)锚用例编号 TC-NN + 线别消歧(e2e/api 用例编号都是 TC-n、空间重叠——按线分目录 test/<需求id>/{e2e,api}/ 或 case 名带 e2e_/api_ 前缀)——「线别+TC 号」才是"一一对照"的可 grep 硬锚。不漏 case、不造用例里没有的幽灵 case。
  2. 断言照用例的"预期"栏写:成功逐字段断、失败断异常码 / 受控错误态——锚唯一、真实、产出方的信号(rule-0009),不写恒真断言,不为图省事弱化。
  3. 抽共享基础动作层:api 侧(请求构造 / 鉴权 / 断言 helper)、e2e 侧(开页 / 点击 / 填表 / 等待),case 只写业务动作序列;helper 跨需求共享(如 test/lib/,位置随工程惯例)——动作变了改一处、全部脚本跟着好。每需求抄一份 helper 是灾难。

② 跑 + 修(sandbox 内调通)

  1. 跑前卡门:sandbox(up)→ sandbox_status(exit 0 才跑)→ 跑 → sandbox_down——命令取自 workspace/verification.yaml,契约见 docs/harness/SANDBOX_CONTRACT.md「运行时卡门」。sandbox 未接实(PENDING:)→ 停下报告总监,指路 hc-create-sandbox——不硬跑、不 mock 混过。
  2. 跑本需求的 case(不带过往全量——那是回归场景(已实现,ADR-0027)的事)。
  3. 失败两分:脚本的问题改脚本(选择器 / 时序 / 断言写错…);实现的问题不改脚本——报出去由总监回 hc-dev 修(脚本挖到真 bug 是它的功劳,别为绿而弱化断言)。
  4. 完成定义:本需求 case 全绿,或如实报告残留失败清单 + 逐条归因(脚本 bug / 实现 bug / 环境缺失)——blocked / skipped ≠ pass(rule-0002),无真实运行证据不声称完成(rule-0003)。

Read the full file on GitHub · 56 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. 2mo ago First seen · 56 lines · 246 tokens per session scan A a58526235f98

Subscribe to this mod's changes

hc-script-impl is an agent published in the GitHub repository harness-base/harness-control (22 stars, last pushed 3mo ago), licensed MIT. It adds 246 tokens to every session and 1,965 once invoked, about $0.0010 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.