test-and-fix

test-and-fix is a skill for Claude Code from yu-iskw/skill-inspector. It costs 41 tokens per session (489 once invoked), scanned A, original, Apache-2.0.

An automated loop for finding and fixing failing unit tests with Vitest, a JavaScript and TypeScript test runner. It examines failures, changes the source or outdated test when appropriate, and runs the tests again.

In plain words
What is it for?
Use it after adding features, when regression tests fail, or when existing tests no longer match the code.
Why use it?
It turns a failing test run into a repeatable process for identifying the failure, applying a focused fix, and checking whether the fix worked.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it after adding features, when regression tests fail, or when existing tests no longer match the code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yu-iskw/skill-inspector/test-and-fix
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 yu-iskw/skill-inspector --skill test-and-fix
Clone the repo
git clone --depth 1 https://github.com/yu-iskw/skill-inspector

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-and-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/yu-iskw/skill-inspector/test-and-fix/github.svg)](https://agentmods.dev/skills/yu-iskw/skill-inspector/test-and-fix)
Your own site
<a href="https://agentmods.dev/skills/yu-iskw/skill-inspector/test-and-fix"><img src="https://agentmods.dev/badge/skills/yu-iskw/skill-inspector/test-and-fix/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 test-and-fix

Your own site · 80×15
<a href="https://agentmods.dev/skills/yu-iskw/skill-inspector/test-and-fix"><img src="https://agentmods.dev/badge/skills/yu-iskw/skill-inspector/test-and-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 489 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.00041 $0.00489
Opus 5 $0.00020 $0.00244
Sonnet 5 $0.00008 $0.00098
Haiku 4.5 $0.00004 $0.00049

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

Security

Grade A, and why

test-and-fix 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 9d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/skills/test-and-fix/SKILL.md · 49 lines

What it actually says

Test and Fix Loop

Purpose

An autonomous loop for the agent to identify, analyze, and fix failing unit tests using Vitest.

Loop Logic

  1. Identify: Run pnpm test to identify failing tests.
  2. Analyze: Examine the test output to determine:
  3. Fix: Apply the minimum necessary change to either the source code (if it's a bug) or the test code (if the test is outdated).
  4. Verify: Re-run pnpm test.
    • If passed: Move to the next failing test or finish if all are resolved.
    • If failed: Analyze the new failure (or the same one if the fix was insufficient) and repeat the loop.

Termination Criteria

  • All tests pass (as reported by pnpm test).
  • Reached max iteration limit (default: 5).
  • The error persists after multiple distinct fix attempts, indicating a need for human intervention or a broader architectural change.

Examples

Scenario: Fixing a logic error

  1. pnpm test fails in packages/common/src/math.test.ts because add(2, 2) returned 5.
  2. Agent analyzes packages/common/src/math.ts and finds a typo a + b + 1.
  3. Agent fixes the typo to a + b.
  4. pnpm test passes.

Scenario: Updating a test after a deliberate change

  1. pnpm test fails because a UI component's text changed from "Submit" to "Confirm".
  2. Agent confirms the change was intentional.
  3. pnpm test passes.

Resources

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. 9d ago First seen · 49 lines · 41 tokens per session scan A fad7ac48f637

Subscribe to this mod's changes

test-and-fix is a skill published in the GitHub repository yu-iskw/skill-inspector (2 stars, last pushed 8d ago), licensed Apache-2.0. It adds 41 tokens to every session and 489 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

testing

Skill validation framework PLUS daily test-suite health and regression intelligence. Validates skill conformance (frontmatter, manifest coverage, resolver coverage). Runs the project test suite in tiered phases (unit / evals / integration / system health), classifies failures, and produces a regression-aware report.

garrytan/gbrain · 63 tokens

verify

Verify that a change really works before you claim completion.

Yeachan-Heo/oh-my-claudecode · 12 tokens

detect-static-dependencies

ACTIVATION PREREQUISITE: the request or discovered target must explicitly identify C#, .NET, .cs, or .csproj; otherwise stay dormant without invoking this skill. USE FOR: locating System.DateTime.Now/UtcNow, System.IO.File/Directory, System.Environment, HttpClient, Console, or Process usage in C#; auditing C# code for…

dotnet/skills · 135 tokens

implementing-devsecops-security-scanning

Integrates Static Application Security Testing (SAST), Dynamic Application Security Testing (DAST), and Software Composition Analysis (SCA) into CI/CD pipelines using open-source tools. Covers Semgrep for SAST, Trivy for SCA and container scanning, OWASP ZAP for DAST, and Gitleaks for secrets detection. Activates for…

xalgorix/xalgorix · 109 tokens

experiment-iterative-coder

Iterative code refinement through plan → code → evaluate → refine cycles. Runs lint checks (ruff), tests (pytest), and structured self-evaluation each cycle, then diagnoses failures and refines. Decomposes complex tasks into sequential phases, iterates up to 3 times per phase (10 total). Use when: the main agent…

EvoScientist/EvoSkills · 145 tokens

testing-blocks

Use this when you have made AEM Edge Delivery Services code changes to blocks, scripts, or styles and need to validate them before opening a pull request. Covers unit testing for utilities and logic, browser testing with Playwright, linting, and guidance on what to test and how.

adobe/skills · 61 tokens