Skip to content
Back to skills

Interpret Test Failure

ASecurity

Read a Vitest error, query test_history for prior occurrences, extract assertion shape, and compute a failure signature. Use when a test fails and you need to decide whether it's a new failure, a recurring known one, or flaky.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
researchnode

Works with

  • mcp

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add spencerbeggs/vitest-agent --skill interpret-test-failure --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Interpret Test Failure?

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

Security grade badge for Interpret Test Failure
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/spencerbeggs-interpret-test-failure/badge)](https://www.skillsdirectory.com/skills/spencerbeggs-interpret-test-failure)

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: interpret-test-failure
description: Read a Vitest error, query test_history for prior occurrences, extract assertion shape, and compute a failure signature. Use when a test fails and you need to decide whether it's a new failure, a recurring known one, or flaky.
---

# Interpret a test failure

When a test fails, do the following:

1. **Read the assertion message and stack trace.** The MCP `test_errors` tool returns these. Identify:
   - The assertion matcher (`toBe`, `toEqual`, `toThrow`, etc.)
   - The expected vs actual values (or value shapes)
   - The top non-framework stack frame (skip `node:internal`, `node_modules/vitest/`)
2. **Query history.** Call `test_history({ project: ..., subProject: ... })` to see if this test has failed before. Look for the test's `fullName` in the records.
3. **Get the failure signature.** Call `failure_signature_get({ hash })` if the error has a recorded signature. Recurring signatures collapse to one row; the `occurrence_count` tells you how often this failure has been seen.
4. **Classify.** Combine the history and signature data:
   - `new-failure` — first time seeing this test fail
   - `persistent` — failed in two or more consecutive runs
   - `flaky` — mixed pass/fail across recent runs
   - `recovered` — was failing, now passing
   - `stable` — consistently passing

Use the classification to decide your next action. New failures need a hypothesis. Persistent failures may indicate a real bug or a structural test issue. Flaky tests should not be silenced — investigate the source of nondeterminism.

## Reusable outside TDD

This skill is not TDD-specific. The fix-failing-test and flaky-triage workflows both use it.

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.