toolhive-studio: Skill for Claude Code

.claude/skills/bug-fix-tdd/SKILL.md

bug-fix-tdd is a skill for Claude Code from stacklok/toolhive-studio. It costs 52 tokens per session (1,679 once invoked), scanned A, original, Apache-2.0.

A bug-fixing workflow based on TDD, or test-driven development: first write a test that exposes the bug, then make the smallest code change that fixes it.

In plain words
What is it for?
Use it to analyse bug reports, locate the affected code, create a failing test, apply a minimal fix, and run the relevant and full test suites.
Why use it?
It proves that the reported problem is reproducible and leaves a regression test so the same bug can be detected later.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Claude Code.

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

Reuse

Borrowing it

Nothing to install: this file belongs to stacklok/toolhive-studio. 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-studio/main/.claude/skills/bug-fix-tdd/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive-studio

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 bug-fix-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/stacklok/toolhive-studio/bug-fix-tdd/github.svg)](https://agentmods.dev/skills/stacklok/toolhive-studio/bug-fix-tdd)
Your own site
<a href="https://agentmods.dev/skills/stacklok/toolhive-studio/bug-fix-tdd"><img src="https://agentmods.dev/badge/skills/stacklok/toolhive-studio/bug-fix-tdd/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 bug-fix-tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/stacklok/toolhive-studio/bug-fix-tdd"><img src="https://agentmods.dev/badge/skills/stacklok/toolhive-studio/bug-fix-tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,679 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 34
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 48
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
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.00052 $0.01679
Opus 5.5 $0.00021 $0.00672
Sonnet 5.5 $0.00010 $0.00336
Haiku 4.5 $0.00005 $0.00168

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

Security

Grade A, and why

bug-fix-tdd 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 2mo 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/skills/bug-fix-tdd/SKILL.md · 211 lines

How it starts

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

Bug Fix TDD

Reproduce bugs with a failing test, then apply the minimum fix. This skill is used by the automated bug-fix agent in CI but can also be invoked manually.

TDD Workflow

Phase 1 — Analysis & Failing Test (Red)

  1. Parse the bug report: extract description, steps to reproduce, expected vs actual behavior
  2. Find relevant code: use Grep/Glob to locate the component, hook, or route mentioned in the bug
  3. Write a unit test that reproduces the bug — the test MUST FAIL
  4. Run the test: pnpm run test:nonInteractive -- <test-file-path>
  5. Verify failure reason: the test must fail because of the bug, not because of import errors or unrelated issues
  6. Retry if needed: if the test passes (bug not reproduced), try a different approach (max 3 attempts)
  7. Write bug-analysis.md with findings (see format below)

Constraints: Do NOT modify source files in Phase 1. Only create/edit test files and bug-analysis.md.

Phase 2 — Fix (Green)

  1. Read the failing test and bug-analysis.md
  2. Apply the MINIMUM fix to make the test pass — do not over-engineer
  3. Run the single test: pnpm run test:nonInteractive -- <test-file-path>
  4. Run the full suite: pnpm run test:nonInteractive
  5. Run static checks: pnpm run lint and pnpm run type-check
  6. Retry if needed: if any check fails, adjust the fix (max 5 attempts)
  7. Write pr-body.md and fix-title.txt

Constraints: Do NOT run git, gh, or modify .env files.

Phase 2b — Direct Fix (Fallback)

If Phase 1 cannot reproduce the bug in a test (test passes after 3 attempts), Phase 2b runs instead of Phase 2.

  1. Read bug-analysis.md and issue-body.md for context
  2. Apply the MINIMUM fix based on code analysis alone
  3. If you CAN write a regression test, do so — but it is not required
  4. Run the full suite: pnpm run test:nonInteractive
  5. Run static checks: pnpm run lint and pnpm run type-check
  6. Retry if needed: if any check fails, adjust the fix (max 5 attempts)
  7. Write pr-body.md and fix-title.txt — note in the PR body that no regression test was possible

Read the full file on GitHub · 211 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. 2mo ago First seen · 211 lines · 52 tokens per session scan A 080ff2527ac1

Subscribe to this mod's changes

bug-fix-tdd is a skill published in the GitHub repository stacklok/toolhive-studio (173 stars, last pushed today), licensed Apache-2.0. It adds 52 tokens to every session and 1,679 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-08-30.