test-auto-fix

test-auto-fix is a skill for Claude Code from mthines/agent-skills. It costs 166 tokens per session (3,027 once invoked), scanned A, original, MIT.

An automated test-fixing workflow that investigates failed tests, decides whether the test or product code is at fault, and applies fixes with confidence checks.

In plain words
What is it for?
Use it to diagnose failing tests, make carefully gated fixes, rerun the relevant tests, and check for regressions across a project.
Why use it?
It reduces the manual work of tracing failures and helps avoid changing code just to make tests pass.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: positional $N argument.

Part of the mthines-agent-skills plugin — 55 skills, 4 agents shipped together

Good fit Use it to diagnose failing tests, make carefully gated fixes, rerun the relevant tests, and check for regressions across a project.

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

Made for: Claude Code.

Or install mthines-agent-skills, the plugin that ships this one along with the rest of its 55 skills, 4 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/mthines/agent-skills/test-auto-fix.svg)](https://agentmods.dev/skills/mthines/agent-skills/test-auto-fix)
Your own site
<a href="https://agentmods.dev/skills/mthines/agent-skills/test-auto-fix"><img src="https://agentmods.dev/badge/skills/mthines/agent-skills/test-auto-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 166 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,027 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: 1 finding, up to medium

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 →

  • medium Rogue Agent · line 63
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
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.00166 $0.03027
Opus 5 $0.00083 $0.01514
Sonnet 5 $0.00033 $0.00605
Haiku 4.5 $0.00017 $0.00303

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

Security

Grade A, and why

test-auto-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 2d 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.

skills/testing/test-auto-fix/SKILL.md · 280 lines

How it starts

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

test-auto-fix

Autonomously diagnose and fix failing tests in any project, with hard guardrails so the loop never devolves into "make the red go away".

This SKILL.md is the orchestration index. Load the matching rule file when you need detail — do not preload them.

Phase Goal Required rule
0 Resolve the surface (bootstrap or validate) rules/bootstrap.md + rules/surface-validation.md
1 Detect which test surface(s) are failing; build fix plan this file + templates/plan-artifact.md
2 Per failure: classify as test-bug / prod-bug / unsure rules/verdicts.md + rules/self-improvement-loop.md (read lessons)
3 Per failure: draft the smallest possible fix this file
3.5 Confidence gate — before any edit rules/confidence-gate.md
4 Apply + verify single failing test this file + rules/anti-patterns.md
5 test-provenance-guard (optional companion) invoke Skill("test-provenance-guard")
6 Outer loop: re-run full surface; regression-detect rules/regression-detection.md + rules/self-improvement-loop.md (write lessons)
7 Report (structured exit summary) templates/exit-summary.md + rules/self-improvement-loop.md (write on outcome)

Always read rules/anti-patterns.md first. The hard refusals apply to every phase.

Input

The user provides one of:

  • Nothing — auto-run every surface defined in the project surface file.
  • A surface name (vitest, unit, integration, etc.) — run only that surface.
  • A file path — narrow detection and re-run to that file.
  • --surface <path> — override the surface file lookup entirely.
  • --plan-only — diagnose and produce the plan artifact; do not write code.
  • --max-iterations N — outer-loop cap (default 5).

Read the full file on GitHub · 280 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. 2d ago Changed · +6 lines 10cc1f171532
  2. 7d ago First seen · 274 lines · 166 tokens per session scan A 2f9000807ea2

Subscribe to this mod's changes

test-auto-fix is a skill published in the GitHub repository mthines/agent-skills (12 stars, last pushed 2d ago), licensed MIT. It adds 166 tokens to every session and 3,027 once invoked, about $0.0008 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

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

raw-sql-querybuilder-testing-patterns

Guides Go services that use database/sql directly with a lightweight in-house query builder (not an ORM like GORM or a codegen tool like sqlc), including how to make repositories unit-testable via mock-generated interfaces. Use when writing or reviewing a repository method built on database/sql, adding a new…

shennawardana23/skillme · 87 tokens

tdd-workflow

Runs the full TDD workflow for a TypeScript/JavaScript feature — user journeys to test cases, unit tests (Jest/Vitest + Testing Library), API/integration tests, Playwright E2E, and a coverage gate wired into CI. Use when building a Next.js/React/Node feature end to end, not just a single unit test, or when asked to…

shennawardana23/skillme · 92 tokens

test-generation

Generates comprehensive unit, table-driven, and concurrency tests for a given function or module — happy paths, error paths, boundary values, and mocked dependencies — following Go and TypeScript idioms. Use when a function or file needs test coverage, a bug fix needs a regression test, or existing tests only cover…

shennawardana23/skillme · 69 tokens

execution-debugging

Scoped debugging methodology for when a test or build fails during execution/stabilization. Use to diagnose the failing check without scope-creeping — read the full error, reproduce in isolation, hypothesize before changing, localize, fix the root cause not the symptom, and guard with a regression test.

shipshitdev/skills · 63 tokens