test-failure-mindset

test-failure-mindset is a skill for Claude Code from Jamie-BitFlight/claude_skills. It costs 74 tokens per session (538 once invoked), scanned A, original, MIT.

A method for investigating failing tests by comparing the test's expected behavior with the program's actual behavior. It treats a failure as evidence that may point to a bug, an outdated test, or an incorrect expectation.

In plain words
What is it for?
Use it to read assertions, trace the affected code path, review recent changes, and decide whether to fix the implementation or the test.
Why use it?
It reduces guesswork when tests fail and helps avoid changing code or tests before understanding the cause. It also encourages checking the relevant history and requirements.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the dh plugin — 53 skills, 28 agents shipped together

Good fit Use it to read assertions, trace the affected code path, review recent changes, and decide whether to fix the implementation or the test.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jamie-bitflight/claude_skills/test-failure-mindset
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 Jamie-BitFlight/claude_skills --skill test-failure-mindset
Clone the repo
git clone --depth 1 https://github.com/Jamie-BitFlight/claude_skills

Made for: Claude Code.

Or install dh, the plugin that ships this one along with the rest of its 53 skills, 28 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-failure-mindset

README.md
[![agentmods](https://agentmods.dev/badge/skills/jamie-bitflight/claude_skills/test-failure-mindset/github.svg)](https://agentmods.dev/skills/jamie-bitflight/claude_skills/test-failure-mindset)
Your own site
<a href="https://agentmods.dev/skills/jamie-bitflight/claude_skills/test-failure-mindset"><img src="https://agentmods.dev/badge/skills/jamie-bitflight/claude_skills/test-failure-mindset/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-failure-mindset

Your own site · 80×15
<a href="https://agentmods.dev/skills/jamie-bitflight/claude_skills/test-failure-mindset"><img src="https://agentmods.dev/badge/skills/jamie-bitflight/claude_skills/test-failure-mindset.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 538 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 pass 7 Sept 2026
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.00074 $0.00538
Opus 5 $0.00037 $0.00269
Sonnet 5 $0.00015 $0.00108
Haiku 4.5 $0.00007 $0.00054

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

Security

Grade A, and why

test-failure-mindset 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 3d 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.

plugins/development-harness/skills/test-failure-mindset/SKILL.md · 80 lines

How it starts

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

Test Failure Analysis Mindset

Establish a balanced investigative approach for all test failures encountered in this session.

Core Principle

Tests are specifications - they define expected behavior.

Dual Hypothesis Approach

Always consider both possibilities when a test fails:

Hypothesis A Hypothesis B
Test expectations are incorrect Implementation has a bug
Test is outdated Test caught a regression
Test has wrong assumptions Test found an edge case

Investigation Protocol

For EVERY test failure:

1. Pause and Read

  • Understand what the test is trying to verify
  • Read its name, comments, and assertions
  • Check the test's history (git blame) for context

2. Trace the Implementation

  • Follow the code path that leads to the failure
  • Understand actual behavior vs. expected behavior
  • Check if recent changes affected this code path

3. Consider the Context

  • Is this testing a documented requirement?
  • Would current behavior surprise a user?
  • What would be the impact of each possible fix?

4. Make a Reasoned Decision

Situation Action
Implementation is wrong Fix the bug
Test is wrong Fix test AND document why
Unclear Seek clarification before changing

5. Learn from the Failure

  • What can this teach about the system?
  • Should additional tests cover related cases?
  • Is there a pattern being missed?

Red Flags (Dangerous Patterns)

  • Immediately changing tests to match implementation
  • Assuming implementation is always correct
  • Bulk-updating tests without individual analysis
  • Removing "inconvenient" test cases
  • Adding mock/stub workarounds instead of fixing root causes

Good Practices

  • Treat each test failure as a potential bug discovery
  • Document analysis in comments when fixing tests
  • Write clear test names that explain intent
  • Consider adding more tests when finding ambiguity

Read the full file on GitHub · 80 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. 3d ago First seen · 80 lines · 74 tokens per session scan A 9b207dd122ce

Subscribe to this mod's changes

test-failure-mindset is a skill published in the GitHub repository Jamie-BitFlight/claude_skills (66 stars, last pushed today), licensed MIT. It adds 74 tokens to every session and 538 once invoked, about $0.0004 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-09-06.

Related

Other skills, from other repositories

systematic-debugging

4-phase root cause debugging: understand bugs before fixing.

NousResearch/hermes-agent · 16 tokens

langsmith-observability

LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.

davila7/claude-code-templates · 45 tokens

experimental-code-coverage-local-debugger

Runs code coverage locally via Universal Test Runner (UTR) or helper scripts, mimicking LUCI trybots. Activate when CQ tryjobs fail or underreport coverage, to test local GN/recipe repairs before uploading, or to debug hermetic crashes.

chromium/chromium · 59 tokens

adversarial-reviewer

Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.

emdash-cms/emdash · 71 tokens

cli-e2e

Write, modify, or debug Docker-based Composio CLI end-to-end tests under ts/e2e-tests/cli, including binary invocation, fixture isolation, output assertions, and package manifests. Use for CLI E2E test suites only; use cli-command for CLI source implementation.

ComposioHQ/composio · 62 tokens

ios-simulator

Verify and debug native, React Native, Expo, or Flutter apps on an iOS Simulator with agent-device. Use when an agent needs to launch an app, inspect its live UI, tap, type, scroll, validate a code change, collect failure evidence, or reproduce a workflow on an iPhone or iPad Simulator.

callstack/agent-device · 69 tokens