mcpbeat Sign in

Absolute Deflake Agent Skill

> Triggers on "absolute deflake", "fix flaky tests", "CI is flaky", "this test fails randomly/intermittently".

3k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
205
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/maddhruv/absolute --skill absolute-deflake

The instruction itself

8 sections, as written by the author

> Start your first response with the 🧪 emoji.

Absolute Deflake

Find tests that pass and fail nondeterministically, diagnose the root cause of each,

and fix it — not by retrying or skipping, but by removing the source of nondeterminism.

Output is evidence (failure rate per test) → cause → fix, verified by repeated runs.

Runs the shared engine in references/health-engine.md — read it for the

DETECT → SCAN → TRIAGE → FIX → VERIFY → REPORT loop and the safety contract. This file

covers only what's specific to flaky tests.


When to use

  • "Our CI is flaky", "this test fails randomly", "fix the intermittent failures".
  • A test passes locally but fails in CI (or vice versa), or fails ~1 in N runs.
  • Burning down a backlog of retry/skip-marked tests that mask real flakiness.

Not for tests that fail *deterministically* — that's a real bug or a real regression

(/absolute work for a fix, or just fix it). deflake targets *nondeterministic* failures.


What it scans

Establish flakiness empirically — a test isn't flaky because someone said so. Use

preferences.health.deflakeRuns from config as the default N for repeat-runs (else 20):

| Ecosystem | Repeat-run / detect |

|---|---|

| Jest/Vitest | run suite N× (--run loop), randomize order (--shuffle / testSequencer) |

| pytest | pytest-randomly + pytest --count=N (pytest-repeat); -p no:randomly to A/B |

| Go | go test -count=N -shuffle=on ./..., -race |

Also mine signals: existing retry/flaky/skip annotations, CI history if reachable, and

run the suite both in isolation and in full/parallel — order- and concurrency-

dependent failures only show one way. Record a failure rate per suspect test.


Common root causes (diagnose, don't guess)

| Cause | Tell | Fix |

|---|---|---|

| Test-order / shared state | passes alone, fails in suite (or vice versa) | isolate state; reset/teardown between tests |

| Time / clock | fails near midnight, DST, or under load | fake timers / inject clock; no real sleep |

| Async race / missing await | fails under parallelism or slow CI | await the actual condition; no fixed timeouts |

| Randomness | fails ~X% with no pattern | seed the RNG; fix the seed in tests |

| Network / external I/O | fails offline or on slow links | mock/stub the boundary |

| Unordered collections | fails on map/set iteration order | sort before asserting |

| Resource leak / port reuse | fails on repeat or parallel runs | unique resources; clean up |


Risk ranking (TRIAGE)

| Wave | Class | Default |

|---|---|---|

| 1 | clear, isolated cause (seed, await, fake clock, sort) | fix now |

| 2 | shared-state / ordering — needs fixture refactor | fix this pass, per test |

| 3 | flakiness pointing at a real product race, not just the test | gated — surface; may be a genuine bug to fix in code |

A flaky test sometimes means the *code* has a race, not the test. Don't "stabilize" the test

into hiding a real concurrency bug — flag wave-3 cases for a real fix.


Fix & verify

  • Fix the cause. Then prove it: re-run the test many times (and shuffled / parallel /

with -race) — green once is not deflaked; green across N randomized runs is.

  • Remove the retry/skip/flaky annotation that was masking it once the cause is fixed.
  • Never "fix" by adding retries, raising timeouts blindly, sleep, or skipping the test —

that hides flakiness, doesn't remove it.

  • Re-run the full suite to confirm the fix didn't destabilize neighbors.

Gotchas

  • Retry/skip as a fix. Masks the flake, ships the nondeterminism. Forbidden here.
  • sleep to dodge a race. Slows the suite and still flakes under load. Await the condition.
  • One green run = done. Flakes are probabilistic — verify with many randomized runs.
  • Stabilizing a real product race. If the *code* races, fix the code, not just the assertion.
  • Ignoring order/parallel dimension. Run isolated *and* in-suite; the bug hides in whichever you skip.

Companion commands

  • /absolute upgrade — a flaky suite makes upgrade verification unreliable; deflake first.
  • /absolute debt — flaky-test annotations are test debt; this clears them at the root.
  • /absolute work — when the flake is a genuine product-code race needing real design.

Other skills for the same job

different authors, same section of the catalogue
Webapp Testing
by anthropics
vendor ×12

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

6k tokens scripts
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
Test Driven Development
by w95
×7

Use when implementing any feature or bugfix, before writing implementation code

2k tokens
Systematic Debugging
by ratacat
×7

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

10k tokens scripts
Verification Before Completion
by ZhanlinCui
×6

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

1k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Adaptyv
by christophacham
×3

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.

16k tokens
Aeon
by christophacham
×3

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

19k tokens

How to use it

Copy the folder

Take maddhruv/absolute-deflake from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.