fix-tests

fix-tests is a skill for Cursor from girijashankarj/cursor-handbook. It costs 27 tokens per session (670 once invoked), scanned A, original, MIT.

A workflow for diagnosing and fixing failing automated tests by examining errors, code changes, mocks, assertions, and type problems.

In plain words
What is it for?
Use it when tests fail because of incorrect expectations, asynchronous code, mocks, changed interfaces, or missing test data.
Why use it?
It helps distinguish broken tests from broken code and provides common ways to correct each failure type.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when tests fail because of incorrect expectations, asynchronous code, mocks, changed interfaces, or missing test data.

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

Made for: Cursor.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/girijashankarj/cursor-handbook/fix-tests/github.svg)](https://agentmods.dev/skills/girijashankarj/cursor-handbook/fix-tests)
Your own site
<a href="https://agentmods.dev/skills/girijashankarj/cursor-handbook/fix-tests"><img src="https://agentmods.dev/badge/skills/girijashankarj/cursor-handbook/fix-tests/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 fix-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/girijashankarj/cursor-handbook/fix-tests"><img src="https://agentmods.dev/badge/skills/girijashankarj/cursor-handbook/fix-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 670 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.00027 $0.00670
Opus 5 $0.00014 $0.00335
Sonnet 5 $0.00005 $0.00134
Haiku 4.5 $0.00003 $0.00067

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

Security

Grade A, and why

fix-tests 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 5d 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.

.cursor/skills/testing/fix-tests/SKILL.md · 71 lines

How it starts

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

Skill: Fix Failing Tests

Trigger

When the user reports failing tests or asks to fix test failures.

Prerequisites

  • Test command works: {{CONFIG.testing.testCommand}}
  • Failing test file path or error output available
  • Type check passes or run first: {{CONFIG.testing.typeCheckCommand}}

Steps

Step 1: Identify Failing Tests

  • Run the test suite: {{CONFIG.testing.testCommand}}
  • List all failing tests with error messages
  • Categorize by failure type (assertion, timeout, mock, type)

Step 2: Analyze Each Failure

For each failing test:

  • Read the error message carefully
  • Check if it's a test issue or a code issue
  • Look at recent changes to the tested code
  • Check if mocks are correctly set up

Step 3: Common Fix Patterns

Mock Issues
  • Mock not returning expected value → Update mock return
  • Mock not being called → Check import path
  • Mock state leaking → Add beforeEach reset
Assertion Issues
  • Expected value changed → Update test or fix code
  • Async not awaited → Add await or use waitFor
  • Wrong matcher → Use correct Jest matcher
Type Issues
  • Interface changed → Update test data
  • New required field → Add to test factories
  • Return type changed → Update assertions

Step 4: Fix Tests

  • Fix one test at a time
  • Run just that test to verify: {{CONFIG.testing.testCommand}} -- --testPathPattern={test-file}
  • Ensure fix doesn't break other tests

Step 5: Verify

  • Run full affected test suite
  • Check coverage hasn't dropped below {{CONFIG.testing.coverageMinimum}}%
  • Run type check: {{CONFIG.testing.typeCheckCommand}}

Completion Checklist

  • All previously failing tests pass
  • No new test failures introduced
  • Coverage at or above {{CONFIG.testing.coverageMinimum}}%
  • Type check passes

If Step Fails

  • Step 1 (identify): Run {{CONFIG.testing.testCommand}} — if it hangs, run single file with --testPathPattern=path/to/file
  • Step 2 (analyze): Mock issues often from wrong import path; use jest.mock('./path') matching actual import
  • Step 4 (fix): Fix one test, run --testPathPattern to verify, then next. Don't fix all at once
  • Step 5 (verify): If coverage dropped, add test for uncovered branch. Use @coverage-improvement skill

Read the full file on GitHub · 71 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. 5d ago First seen · 71 lines · 27 tokens per session scan A 9faed18bc366

Subscribe to this mod's changes

fix-tests is a skill published in the GitHub repository girijashankarj/cursor-handbook (30 stars, last pushed 9d ago), licensed MIT. It adds 27 tokens to every session and 670 once invoked, about $0.0001 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-03.

Related

Other skills, from other repositories

mushi-integration

Full end-to-end Mushi Mushi integration smoke test: bug capture → AI triage → story mapping → TDD test generation → approval → execution → PDCA cycle. Use when "test mushi integration", "verify full pipeline", "mushi e2e check", "does mushi work end-to-end", "smoke test mushi", or after deploying changes.

kensaurus/cursor-kenji · 82 tokens

test-reporting-triage-skill

Automatically categorizes test failures, suggests responsible owners, and provides common fix checklists. Generates actionable test reports with failure analysis. Use for "test reporting", "failure triage", "test analysis", or "test automation".

patricio0312rev/skills · 54 tokens

flaky-test-detective

Diagnoses and fixes flaky tests by identifying root causes (timing issues, shared state, randomness, network dependencies) and provides stabilization strategies. Use for "flaky tests", "test stability", "intermittent failures", or "test debugging".

patricio0312rev/skills · 57 tokens

octocode-benchmark

Use when planning, running, grading, or reporting the by-hand Octocode research benchmark — pairwise matchups (Octocode anchor vs one baseline: gh+RTK, gh+Headroom, or plain gh) over markdown questions, with a fresh isolated runner agent per (question, arm, pass), one blind judge per question grading two answers X/Y…

bgauryy/octocode · 117 tokens

patrol-e2e-testing

Use when writing E2E/integration tests, testing native interactions like permissions or system dialogs, capturing UI regressions, or validating cross-platform behavior (Patrol 4.x).

evanca/flutter-ai-rules · 43 tokens

firebase-crashlytics

Use when implementing crash reporting, capturing fatal/non-fatal errors, recording isolate/async exceptions, customizing reports, or uploading obfuscated symbols.

evanca/flutter-ai-rules · 34 tokens