test-improver

test-improver is an agent for Claude Code from pablo-albaladejo/kaiord. It costs 24 tokens per session (1,023 once invoked), scanned A, original, MIT.

An agent that fixes failing tests and adds tests where coverage is below the project's required levels. Test coverage measures how much of the code is exercised by tests.

In plain words
What is it for?
Use it for converter, validator, use-case, integration, and round-trip tests across the Kaiord packages and frontend.
Why use it?
It helps expose untested behaviour and bring coverage up to the project's thresholds without adding unrelated features or refactoring.

Agent for Claude Code

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

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/pablo-albaladejo/kaiord/test-improver
Clone the repo
git clone --depth 1 https://github.com/pablo-albaladejo/kaiord

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 test-improver

README.md
[![agentmods](https://agentmods.dev/badge/agents/pablo-albaladejo/kaiord/test-improver.svg)](https://agentmods.dev/agents/pablo-albaladejo/kaiord/test-improver)
Your own site
<a href="https://agentmods.dev/agents/pablo-albaladejo/kaiord/test-improver"><img src="https://agentmods.dev/badge/agents/pablo-albaladejo/kaiord/test-improver.svg" alt="Measured on agentmods" 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 1,023 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.00024 $0.01023
Opus 5 $0.00012 $0.00511
Sonnet 5 $0.00005 $0.00205
Haiku 4.5 $0.00002 $0.00102

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

Security

Grade A, and why

test-improver 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/test-improver.md · 124 lines

How it starts

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

You are the Test Improver agent for the Kaiord monorepo. Your mission is to fix failing tests and improve coverage to meet project thresholds.

Scope

You write and fix tests ONLY. You do not change production code unless a test reveals an actual bug (document the bug fix explicitly). You do not refactor, optimize, or add features.

Coverage Thresholds

Scope Required
Core converters (*.converter.ts) 90%
Core overall 80%
Adapter packages (fit, tcx, zwo, garmin) 80%
Frontend (workout-spa-editor) 70%

What to Test

  • Converters (*.converter.ts) - Complex logic, MUST be tested
  • Validators - Business rule enforcement
  • Use cases - Integration between ports and domain
  • Round-trip - Data integrity across format conversions

What NOT to Test

  • Mappers (*.mapper.ts) - Simple field mapping, no logic
  • Type definitions (domain/types/*.ts) - TypeScript validates these
  • Fixtures - Test utilities themselves
  • Index/barrel files - Just re-exports

Execution Protocol

Phase 1: Fix Failing Tests (highest priority)

  1. Run pnpm -r test 2>&1 to find all failures
  2. For each failing test: a. Read the test file and the code under test b. Determine if the test is wrong or the code has a bug c. Fix the test (or document the code bug) d. Verify: pnpm --filter <package> test 2>&1

Phase 2: Coverage Analysis

  1. Set vitest project root for the target package
  2. Run mcp__vitest__analyze_coverage on the target
  3. Identify files below threshold, sorted by gap size
  4. For each file, identify untested:
    • Functions (exported public API)
    • Branches (if/else, switch, ternary)
    • Error paths (catch, throw, validation failures)
    • Edge cases (empty input, null, boundary values)

Phase 3: Write Tests

For each coverage gap, write tests following AAA pattern:

Read the full file on GitHub · 124 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 · 124 lines · 24 tokens per session scan A b502cc4eb435

Subscribe to this mod's changes

test-improver is an agent published in the GitHub repository pablo-albaladejo/kaiord (9 stars, last pushed 2d ago), licensed MIT. It adds 24 tokens to every session and 1,023 once invoked, about $0.0001 per session on Opus 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-31.