Skip to content
Back to skills

Test Fix

ASecurity

Diagnose and minimally fix a failing test, then re-run.

  • 3 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 2, 2026
ai-agentsgobashnode

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add terva-sh/terva --skill test-fix --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Fix?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test Fix
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/terva-sh-test-fix/badge)](https://www.skillsdirectory.com/skills/terva-sh-test-fix)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: test-fix
description: Diagnose and minimally fix a failing test, then re-run.
allowed-tools: [read, edit, bash]
---

# Test fix

When the user reports a failing test (or a test suite failure), work
in this order. Resist the temptation to rewrite large chunks of code.

## 1. Reproduce

Run the failing test in isolation first. For Go: `go test -run
TestThing ./pkg/...`. For Node: `npm test -- --run TestThing`. The
goal is a fast feedback loop, not the whole suite.

## 2. Read the failure carefully

- What was expected vs got?
- Which line of test code triggered the failure?
- Is it a logic error in the implementation, an outdated test
  expectation, or environmental drift (e.g. timezone, locale, file
  system case-sensitivity)?

## 3. Choose the smallest possible fix

- If the test is wrong → update the assertion only. Don't restructure.
- If the implementation is wrong → patch the smallest function that
  fixes the failing case. Avoid drive-by refactors.
- If the test depends on behaviour you need to change deliberately →
  ask the user before changing the assertion.

## 4. Re-run

The same isolated test, then the immediate suite, then the full
test command if applicable. Stop the moment you see green; don't
keep poking.

## 5. Report

Write 2–3 sentences: what was wrong, what changed, and which command
verifies the fix. Include the diff inline.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.