Skip to content
Agentmart
Submit a tool

flaky-test-investigation

Investigate a flaky or failing test using evidence before proposing a fix.

Skill by jshepelsky

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jshepelsky-flaky-test-investigation

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Investigate a flaky or failing test using evidence before proposing a fix. Detects the test layer (unit/integration vs end-to-end), classifies the failure mode, and gathers proof. Use when a test fails intermittently or a fix isn't obvious.

Use cases: testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/flaky-test-investigation

What's inside

Skill name
flaky-test-investigation
Description
Investigate a flaky or failing test using evidence before proposing a fix. Detects the test layer (unit/integration vs end-to-end), classifies the failure mode, and gathers proof. Use when a test fails intermittently or a fix isn't obvious.
License
MIT
Instructions
49 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Flaky test investigation

## Purpose
Investigate a flaky or failing test using evidence before proposing a fix. Works across stacks and across both **fast suites** (unit/integration) and **end-to-end** suites — detect the layer first, then follow the matching workflow.

## Required inputs
- the failing command (e.g. `make test`, `npm test`, `pytest -k ...`, `go test ./...`, the E2E runner)
- the test name or file
- the relevant failure output

> **Project profile:** if a `.claude/essentials-profile.md` file exists in the repo, read it first and trust it for this codebase's stack, commands, layout, and conventions.

## Step 0 — Detect the test layer & toolchain

```bash
cat package.json 2>/dev/null | grep -A20 '"scripts"'
ls Makefile pytest.ini pyproject.toml go.mod Cargo.toml Rakefile playwright.config.* cypress.config.* 2>/dev/null
```

Classify the failure:
- **Fast suite** (unit/integration) — runs in-process or against a test harness; failure output names a test framework (PHPUnit/pytest/Jest/Vitest/go test/RSpec) and source-relative test paths.
- **End-to-end** — drives the running app (browser or HTTP); spec files under an `e2e/`/`tests/e2e/`/`cypress/` dir, a Playwright/Cypress/Selenium runner, screenshots/traces on failure.

The investigation differs by layer.

## Fast-suite failure workflow

1. Capture the exact assertion failure and stack trace.
2. Classify the failure mode:
   - **Broken logic** — production code returns the wrong value; a real bug.
   - **Contract mismatch** — the test asserts on the wrong thing (e.g. HTTP status when the handler returns 200 with an error flag in the body; assert on the body's success field instead).
   - **Auth/setup** — the request needs a valid CSRF token, session, or fixture the test didn't establish.
   - **Fixture/state** — depends on data the test didn't provision, or state not reset between tests (shared DB rows, rate-limit/lockout counters, global singletons).
   - **Guard-clause gap** — a new production branch no test exercises.
3. Use the Explore agent (breadth: medium) to find the test file, the production code under test, and shared test support (base test case, HTTP/client helpers, fixture/factory setup, bootstrap).
4. Propose the next narrow action. Don't propose a full fix until the failure mode is confirmed.

## End-to-end failure workflow

1. Capture the exact command and failure excerpt (and any trace/screenshot path).
2. Classify the failure mode: timing/await, shared state, environment difference, non-determinism, order-dependence, or a real server-side logic regression.
3. Identify what dynamic evidence would confirm the classification (a re-run, a trace, a log line, a network capture).
4. Use the Explore agent (breadth: medium) to find the spec file, the fixtures it relies on and how they're provisioned, the wait/await patterns it uses, and any environment differences (target URL, seed data).
5. Propose the next narrow action based on the findings.

## Outputs
Explore-agent findings with evidence, the inferred failure mode, and a single next step. Do not propose a full fix until the failure mode is confirmed.

From jshepelsky/claude-essential-plugin, MIT.

More from jshepelsky/claude-essential-plugin

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jun 27, 2026 (4 months ago)
Last release
Oct 22, 2026 (6 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jshepelsky

Cite this page

flaky-test-investigation skill. Agent Mart. https://agentmart.dev/skills/jshepelsky-flaky-test-investigation (last updated 2026-10-24)