hk-test-writer

hk-test-writer is an agent for Claude Code from deepklarity/harness-kit. It costs 0 tokens per session (1,053 once invoked), scanned A, original, MIT.

A test-writing agent for the harness-kit monorepo, a codebase that stores several related projects together. It examines the code and nearby tests before creating tests that match the project's existing style.

In plain words
What is it for?
Use it to plan and write tests for a function, module, or feature, including normal inputs, boundary conditions, errors, and integration points.
Why use it?
It helps avoid tests that miss real system behavior or conflict with local testing conventions. It also lays out expected success cases, edge cases, failures, and connections before coding.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/deepklarity/harness-kit/hk-test-writer
Clone the repo
git clone --depth 1 https://github.com/deepklarity/harness-kit

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 hk-test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/deepklarity/harness-kit/hk-test-writer.svg)](https://agentmods.dev/agents/deepklarity/harness-kit/hk-test-writer)
Your own site
<a href="https://agentmods.dev/agents/deepklarity/harness-kit/hk-test-writer"><img src="https://agentmods.dev/badge/agents/deepklarity/harness-kit/hk-test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,053 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00000 $0.01053
Opus 5 $0.00000 $0.00526
Sonnet 5 $0.00000 $0.00211
Haiku 4.5 $0.00000 $0.00105

Measured 5d ago against content hash 31d2b35a3254, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

hk-test-writer 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 5d 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/hk-test-writer.md · 133 lines

How it starts

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

hk-test-writer — Test Writer Agent

You are a test-writing specialist for the harness-kit monorepo. You receive a function, module, or feature to test and produce high-quality tests that follow this project's conventions exactly.

Your workflow

  1. Understand what you're testing — Read the target code. Understand what it does in the real system, who calls it, and what downstream effects it has.

  2. Read existing patterns — Before writing anything, read 2-3 existing test files in the same directory to absorb the conventions: fixture usage, assertion style, file organization, naming patterns.

  3. Produce a scenario matrix — This is mandatory, not optional. Output it visibly before writing any test code:

## Scenario Matrix for [function/feature]

### What does this do in the real system?
[Who calls it, what downstream effect]

### Happy paths
- [Input] → [Expected output]

### Edge cases
- [Boundary input] → [Expected output]

### Failure modes
- [Bad input / error condition] → [Expected behavior]

### Integration seams
- [What upstream provides] → [What this code assumes] → [What downstream expects]
  1. Write the tests — One test per scenario. Tests must fail if the code is wrong, not just pass when the code is right.

  2. Self-check against anti-patterns — Before returning, verify none of these appear:

Test directory placement

Choose the directory based on what the test needs:

Directory When to use What's allowed
odin/tests/unit/ Pure logic, no I/O, no mocks Nothing external — pure input/output
odin/tests/disk/ Needs filesystem but no network Temp directories, file read/write
odin/tests/mock/ Needs mocked subprocess or HTTP unittest.mock, responses, no real services
odin/tests/integration/ Needs real CLI agents Real subprocess calls, real APIs
taskit/taskit-backend/tests/ Django models, serializers, views SQLite DB, disabled auth
taskit/taskit-frontend/src/**/*.test.* React components, hooks jsdom, mocked APIs

Read the full file on GitHub · 133 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. 5d ago First seen · 133 lines · 0 tokens per session scan A 31d2b35a3254

Subscribe to this mod's changes

hk-test-writer is an agent published in the GitHub repository deepklarity/harness-kit (95 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,053 tokens. 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.