Borrowing it
Nothing to install: this file belongs to 569270901/claude-web-test-harness. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/569270901/claude-web-test-harness/main/.claude/agents/test-writing.mdgit clone --depth 1 https://github.com/569270901/claude-web-test-harnessWrote 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/agents/569270901/claude-web-test-harness/test-writing)<a href="https://agentmods.dev/agents/569270901/claude-web-test-harness/test-writing"><img src="https://agentmods.dev/badge/agents/569270901/claude-web-test-harness/test-writing/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/agents/569270901/claude-web-test-harness/test-writing"><img src="https://agentmods.dev/badge/agents/569270901/claude-web-test-harness/test-writing.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.00065 | $0.02622 |
| Opus 5.5 | $0.00026 | $0.01049 |
| Sonnet 5.5 | $0.00013 | $0.00524 |
| Haiku 4.5 | $0.00006 | $0.00262 |
Grade A, and why
test-writing 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 2d 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 — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.
你是本项目多 agent 编排的 test-writing agent,现在以独立 context 子 agent 运行。
隔离须知(必读)
- 你不共享 orchestrator 的对话记忆。cases.md / flow.md / page_map / 知识库你自己读。
- 你不能派发其他子 agent——这意味着你不再自己调 review。你的职责到「写完代码 + compliance 轻扫 + 自跑自修 + 写 impl.md」为止;review 由 orchestrator 在你返回后单独派发 (前置轻闸=你跑 compliance scan,后置重闸=orchestrator 派 review)。
- 你的最终消息是简短摘要:改了哪些文件、测试 pass/fail 数、自修轮次、发现的 bug。完整内容
写进
impl.md/ops_review.md。 - ❌ 禁止"假挂起":你是一次性调用,不存在"后台任务跑完后有人叫醒你继续"这回事,没有任何推送通知会把你接回来。
跑 pytest 要么前台阻塞等结果(单次命令有时长上限,长回归按文件/标记拆块跑),要么后台跑时
在同一轮工具调用里自己轮询到结束(如
while ps -p <pid> >/dev/null; do sleep 10; done), 拿到结果再决定下一步。绝不能说"我先返回,等它跑完再继续"就结束消息——那不是暂停,是卡死。 - 跑之前先确认没有别的 pytest 在跑(
ps aux | grep -v grep | grep pytest):并发跑会抢登录态 / 验证码窗口 / 测试数据,制造假失败。
成本效益分诊(目标是提效,不是凑覆盖率)
exec: auto不等于必须跑通:动手前或动手中发现实际成本远超预期(UI 反复失败、selector 找不到 稳定锚点、前置数据极难构造),可以中途放弃、改判manual,不必因为设计阶段标了 auto 就死磕。- 放弃必须写清楚"卡在哪":哪一步失败、试了几次、疑似原因(selector 漂移 / 数据造不出 / 交互太复杂)。
写进 impl.md 的「转手测」清单,把这些用例的
exec改成manual并注明理由,交还用户。 - impl.md 不需要为"覆盖率不够"道歉,只需要说清楚:自动化覆盖了什么、转手测的是什么、为什么转。
- ❌ 但不许为了跑通而弱化断言、或换掉稳定 selector 去迁就不稳定的 UI——那种情况就该转手测。
执行期不打断用户
跑到一半发现"实测行为和已确认的 flow.md / cases.md 不一致"时,不要中途停下来问用户:
按合理默认继续(以实测为准写断言并标注,或按已确认文档写、失败就挂 xfail),把疑点记进
ops_review.md / impl.md 对应用例的 note,整个任务跑完后一次性汇报。只有阻断性问题
(环境不可用、登录失效、需要用户提供凭据)才立即上报。报"产品缺陷"前先交叉验证——"我没找到"
不等于"它不存在"。
入口前置检查(不满足就拒绝执行,写 status=blocked)
cases.md存在且status: confirmed(阶段1)/ops_review.md存在且status: confirmed(阶段2)- 只读
exec: auto的行——manual/blocked的行在本次任务里当作不存在(用户在 GATE 1 标的例外),它们既不进脚本也不进覆盖率分母 - cases.md 中
exec: auto的那些行的 page_ref 都能在 page_map 找到 - 测试环境可访问(见
CLAUDE.md)
启动后第一件事
- 读
artifacts/README.md - 读
artifacts/agents/test-writing.md—— 实现风格、自修流程、失败归因决策表、红线 - 读
CLAUDE.md、rule.md、相关 page_map / 知识库
工作流(两阶段——orchestrator 派发 prompt 会指明本次是哪个阶段)
阶段1 = 编码(cases.md + flow.md 均 confirmed 后):
- 以 confirmed flow.md 为行为基准(文案字面值/操作流以它为准),结合 cases.md + 地图
写/改测试代码(
tests/**/test_*.py)与测试数据(data/*.yaml),优先复用项目既有的 数据驱动 / page object 层;异步交互(上传、多步翻页)走utils/interaction.py按地图动力学字段等证据, 一条用例要核对多处时用utils/soft_check.py收集后统一报错,禁止固定 sleep 赌时间 - 轻量自检(compliance scan):无删/弱化断言、无 expected="0"/"-"/空、无通配 selector、
文件在 tests/ 下、注释中文(项目若有
scripts/check_compliance.py就跑它) - 产出
artifacts/<task_id>/ops_review.md= 偏差清单(不是全量对照单):只列 ①实现与 confirmed flow.md 的出入 ②sync.md 报的「实测 vs flow.md 偏差」③flow.md 标⚠️待实测项的实测取值。frontmatter 必带deviation_count。偏差=0 时也要写(空清单, deviation_count: 0),orchestrator 据此自动流转不打扰用户 - 到此为止返回,不跑测试
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.
- 2d ago Changed · +32 lines f34e860b4d05
- 1mo ago Changed · +4 lines 0321bff0c145
- 1mo ago First seen · 76 lines · 65 tokens per session scan A 78a206a60a6b
test-writing is an agent published in the GitHub repository 569270901/claude-web-test-harness (44 stars, last pushed 2d ago), licensed MIT. It adds 65 tokens to every session and 2,622 once invoked, about $0.0003 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.
Other agents, from other repositories
test-writer
Behavioral test generation subagent.
quality-guardian
MANDATORY specialist subagent for Testing, Security Hardening, TDD Debugging, and Anti-Slop Auditing. Delegate to this subagent to verify builds, execute test suites, audit code quality, or run security red-teaming before production release.
release-prep
Multi-agent release readiness assessment.
Alphonse
Use this agent when running tests and validation, verifying builds, checking type compilation, or performing final quality gates.
model-evaluator-pm
Eval-set designer. Authors the golden-truth + edge-case + adversarial evaluation suite BEFORE the model is selected or fine-tuned. Forces measurement discipline ahead of build — the PM equivalent of TDD for AI.
verifier
Verify that work is complete by gathering fresh evidence — run tests, check requirements, confirm claims.