agent-harness-testing

agent-harness-testing is a skill for Claude Code, Codex from huiliyi37/Tianshu-harness. It costs 61 tokens per session (2,073 once invoked), scanned A, original, Apache-2.0.

A testing method for coding tasks in unfamiliar projects. It first discovers how the project is tested, then uses a failing check followed by a passing check to verify a change.

In plain words
What is it for?
It helps investigate test commands, reproduce bugs, simulate environments, choose tests, and verify bug fixes, new features, and refactors.
Why use it?
It prevents changes from being made without real evidence and avoids assuming the project's tools, test framework, or build system.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps investigate test commands, reproduce bugs, simulate environments, choose tests, and verify bug fixes, new features, and refactors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/huiliyi37/tianshu-harness/agent-harness-testing
About the project

Tianshu Harness is a TypeScript runtime for coding agents, with terminal and desktop interfaces that share an agent core for managing goals, state, evidence, permissions, and completion checks. Developers use it to have language models carry out software tasks while the runtime verifies progress through tests, diffs, or other commands. The catalogue entries are skills and instructions for the agent's coding workflow.

huiliyi37/Tianshu-harness · 1,122 stars · on GitHub · tianshuharness.com

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 huiliyi37/Tianshu-harness --skill agent-harness-testing
Clone the repo
git clone --depth 1 https://github.com/huiliyi37/Tianshu-harness

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-harness-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/huiliyi37/tianshu-harness/agent-harness-testing/github.svg)](https://agentmods.dev/skills/huiliyi37/tianshu-harness/agent-harness-testing)
Your own site
<a href="https://agentmods.dev/skills/huiliyi37/tianshu-harness/agent-harness-testing"><img src="https://agentmods.dev/badge/skills/huiliyi37/tianshu-harness/agent-harness-testing/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-harness-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/huiliyi37/tianshu-harness/agent-harness-testing"><img src="https://agentmods.dev/badge/skills/huiliyi37/tianshu-harness/agent-harness-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,073 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.00061 $0.02073
Opus 5.5 $0.00024 $0.00829
Sonnet 5.5 $0.00012 $0.00415
Haiku 4.5 $0.00006 $0.00207

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

Security

Grade A, and why

agent-harness-testing 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 28d 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.

docs/skills/optional/agent-harness-testing/SKILL.md · 247 lines

How it starts

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

Agent Harness Testing — 通用项目测试方法论

你在别人的项目中工作。你不知道他们的测试框架、不知道他们的构建系统、不知道他们的 CI。但你必须验证你的改动是正确且安全的——不能跳过测试、不能编造结果、不能假设一切正常。

总则(先复现再修复、先红灯再绿灯、结果必须来自真实执行、探针必须清理)已由运行时强制: 证据义务状态机跟踪 RED→GREEN、编辑门拦截无复现的源码修改、探针追踪扫描残留、 交付门禁核验验证证据。本 Skill 是操作手册——怎么探测测试能力、怎么构造红灯、 怎么模拟环境,不再复述总则。


Stage 1: 探测测试能力

进入陌生项目的第一件事——不是改代码,是了解怎么验证。

1.1 运行 inspect_project

这会返回项目摘要:语言、包管理器、scripts、入口文件、测试框架提示。先用它建立全局认知。

1.2 读项目配置文件

根据语言读对应配置:

语言 读什么 找什么
Node/TS package.json scripts.test, scripts.typecheck, scripts.lint, devDependencies 中的 vitest/jest/mocha
Python pyproject.toml / setup.cfg [tool.pytest], [tool.mypy], [tool.ruff]
Go go.mod + 项目根 *_test.go 测试文件存在即表示 go test ./... 可用
Rust Cargo.toml [dev-dependencies] 中的 test 相关 crate

1.3 列出测试文件

# Node
ls **/*.test.ts **/*.spec.ts **/__tests__/*.ts 2>/dev/null
# Python
ls **/test_*.py **/*_test.py 2>/dev/null
# Go
ls **/*_test.go 2>/dev/null
# Rust
ls tests/ 2>/dev/null

1.4 试跑一条测试命令

# Node 常见
npx vitest --run 2>&1 | head -5
npx jest --passWithNoTests 2>&1 | head -5

# Python
python -m pytest --co 2>&1 | head -5

# Go
go test ./... 2>&1 | head -5

# Rust
cargo test 2>&1 | head -5

如果试跑失败,看错误信息——可能缺依赖(npm install)、环境变量(.env)、或服务(Docker)。 不要跳过——记录障碍并告知用户,问是否需要帮助配置。

1.5 生成能力地图

探测完成后,心里形成一张表:

typecheck: 可用 (npx tsc --noEmit) / 不可用
lint:      可用 (npx eslint) / 不可用
unit test: 可用 (npx vitest --run) / 不可用
e2e:       可用 (npx playwright test) / 不可用
build:     可用 (npm run build) / 不可用
env sim:   可用 (docker compose up) / 不可用

Stage 2: 按任务类型选择测试策略

Bugfix

必须: RED 红灯测试 → 修复 → GREEN 绿灯测试 → 回归测试
如果无法写红灯测试: 说明原因 + 给替代验证方式

红灯测试构造方法:

  1. 从用户描述和错误日志提取失败场景
  2. 找现有测试文件,复制结构
  3. 写最简失败用例(最小数据、最少依赖)
  4. 运行 → 必须失败
  5. 确认失败断言与 Bug 描述一致
  6. 开始修复

如果无法构造(问题仅在生产环境/第三方回调/并发竞态复现):

  • 明确说明:为什么本地无法复现
  • 给出替代验证方式:staging 环境回放、日志对比、代码审查要点
  • 不跳过验证——只是换一种验证方式

Feature

必须: 新功能测试(覆盖 happy path + 边界)→ typecheck → lint
推荐: 集成测试(如果涉及多模块)

Read the full file on GitHub · 247 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. 28d ago First seen · 247 lines · 61 tokens per session scan A d7648148c288

Subscribe to this mod's changes

agent-harness-testing is a skill published in the GitHub repository huiliyi37/Tianshu-harness (1,122 stars, last pushed today), licensed Apache-2.0. It adds 61 tokens to every session and 2,073 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-09-18.