toolhive: Agent for Claude Code

.claude/agents/unit-test-writer.md

unit-test-writer is an agent for Claude Code from stacklok/toolhive. It costs 24 tokens per session (325 once invoked), scanned A, original, Apache-2.0.

An agent that writes unit tests for Go code. Unit tests check individual functions, methods, or components in isolation, including normal results, errors, boundary cases, and invalid inputs.

In plain words
What is it for?
Use it to add tests, fixtures, helpers, and mocks; improve coverage; and verify both successful behavior and failure conditions in Go code.
Why use it?
It reduces the work of designing thorough tests and helps catch regressions when code changes. It also follows the project’s testing conventions and uses mocks where needed.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is stacklok/toolhive's own configuration. It tells Claude Code how to work on toolhive 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 toolhive configures →

About the project

ToolHive is a platform for running and managing Model Context Protocol servers, which give AI clients access to tools and data. Developers, platform teams, and enterprises use it to isolate MCP servers, control access, and monitor their operation. The catalogue entries provide agent workflows and configuration for operating ToolHive and its MCP servers.

stacklok/toolhive · 2,307 stars · on GitHub · stacklok.com

Reuse

Borrowing it

Nothing to install: this file belongs to stacklok/toolhive. 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/stacklok/toolhive/main/.claude/agents/unit-test-writer.md
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/stacklok/toolhive/unit-test-writer/github.svg)](https://agentmods.dev/agents/stacklok/toolhive/unit-test-writer)
Your own site
<a href="https://agentmods.dev/agents/stacklok/toolhive/unit-test-writer"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/unit-test-writer/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 unit-test-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/stacklok/toolhive/unit-test-writer"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/unit-test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 325 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.00024 $0.00325
Opus 5.5 $0.00010 $0.00130
Sonnet 5.5 $0.00005 $0.00065
Haiku 4.5 $0.00002 $0.00032

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

Security

Grade A, and why

unit-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 1mo 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/unit-test-writer.md · 43 lines

What it actually says

Unit Test Writer Agent

You are a Go testing expert specializing in comprehensive, maintainable unit tests for the ToolHive project.

When to Invoke

Invoke when: Writing unit tests, adding coverage, creating fixtures/helpers/mocks, improving test quality.

Do NOT invoke for: Production code (golang-code-writer), E2E tests (test/e2e/), code review (code-reviewer), CLI command testing (use E2E tests).

ToolHive Testing Conventions

Follow testing conventions defined in .claude/rules/testing.md and Go style in .claude/rules/go-style.md. These rules are auto-loaded when touching test files.

Test Design

  • Analyze code for functionality, dependencies, edge cases
  • Cover happy path, error conditions, boundary values, input validation
  • Create mock expectations verifying correct interactions
  • Focus on meaningful tests over raw coverage numbers

Running Tests

task test           # Unit tests
task test-coverage  # With coverage
task gen            # Generate mocks

Coordinating with Other Agents

  • golang-code-writer: When code needs modifications for testability
  • code-reviewer: For reviewing test quality
  • toolhive-expert: For understanding existing test patterns
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. 1mo ago First seen · 43 lines · 24 tokens per session scan A 7d40b26232ab

Subscribe to this mod's changes

unit-test-writer is an agent published in the GitHub repository stacklok/toolhive (2,307 stars, last pushed today), licensed Apache-2.0. It adds 24 tokens to every session and 325 once invoked, about $0.0001 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.

Related

Other agents, from other repositories

fintech-engineer

Use when building payment systems, financial integrations, or compliance-heavy financial applications that require secure transaction processing, regulatory adherence, and high transaction accuracy.

alexmmatos/arthur-mcp · 33 tokens

quant-analyst

Use this agent when you need to develop quantitative trading strategies, build financial models with rigorous mathematical foundations, or conduct advanced risk analytics for derivatives and portfolios. Invoke this agent for statistical arbitrage strategy development, backtesting with historical validation…

alexmmatos/arthur-mcp · 60 tokens

risk-manager

Use this agent when you need to identify, quantify, and mitigate enterprise-level risks across financial, operational, regulatory, and strategic domains. Invoke this agent when you need to assess risk exposure, design control frameworks, validate risk models, or ensure regulatory compliance.

alexmmatos/arthur-mcp · 54 tokens

payment-integration

Use this agent when implementing payment systems, integrating payment gateways, or handling financial transactions that require PCI compliance, fraud prevention, and secure transaction processing.

alexmmatos/arthur-mcp · 33 tokens

ic-challenger

The toughest person on the investment committee with 30 years of CRE experience spanning three full cycles. Challenges every assumption with data and forces analysts to defend their work to the highest standard. Produces structured challenge memos that systematically stress-test investment theses. Deploy this agent…

mariourquia/cre-skills-plugin · 85 tokens

token-economics-designer

Token economics and tier design specialist. Use when designing pricing models, access tiers, or token distribution strategies.

Matt-Dionis/claude-code-configs · 28 tokens