agentleFS
StripeKnown publisherstripe/stripe-react-native/.claude/skills/deflake-test/SKILL.md

deflake-test

Skill1.4k starsChanged 3 months agoMITView on GitHub

Reproduce, diagnose, fix, and stress-verify a suspected flaky unit, integration, or Maestro E2E test. Use when asked to repeat one focused test until it fails or establish a consecutive-pass threshold, not for ordinary one-off failures or broad suite validation.

Trending

Quiet this year.thin dataabout the whole repository

Jan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the stripe/stripe-react-native repository that our weekly crawl found: only 10 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about stripe/stripe-react-native

The biggest 5 of 10 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 10

Talked about on GitHub and Hacker News (10 times).

On GitHub · 9

4 more on GitHub

On Hacker News · 1

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the iteration count requested by the user.

    line 8
  2. Very specific:

    Run the test sequentially up to the configured count, stopping at the first genuine test failure.

    line 13
  3. Distinctive:

    If the first clean run reaches the configured count without failure, stop immediately.

    line 15
  4. Distinctive:

    When a failure occurs, inspect the most specific evidence available: failed-step timing, screenshots, view hierarchy, application and …

    line 16
  5. Distinctive:

    Run focused unit, compilation, and static checks required by the affected code and repository instructions.

    line 18
  6. Distinctive:

    Before counting Android iterations, verify emulator storage, network access to the configured demo backend, and that the expected APK …

    line 25
  7. Distinctive:

    Use platform-conditional flows for platform-specific selectors rather than mutually exclusive optional actions.

    line 27
  8. Distinctive:

    Wait for a stable screen identity or readiness signal, not content that can vary with saved payment methods, account state, or layout.

    line 28
  9. Distinctive:

    Do not hide startup crashes with an in-flow relaunch unless evidence shows the launch failure is unrelated infrastructure and existing …

    line 29
  10. Distinctive:

    If a native flow returns control to JavaScript, check whether work that immediately presents UI ran before the React host activity …

    line 30
  11. Distinctive:

    Keep test hardening separate from product fixes when they address independent failure modes.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deflake a test

Use the iteration count requested by the user. Otherwise default to 20. When using the bundled runner, override the count with --iterations/-n or DEFLAKE_ITERATIONS.

Workflow

  1. Find the narrowest command that runs exactly the requested test. Read repository instructions and test documentation first. Prepare required devices, apps, services, fixtures, and dependencies without broadening into a repository-wide suite.
  2. Run the test sequentially up to the configured count, stopping at the first genuine test failure. Preserve separate output and debug artifacts for every iteration. Use scripts/repeat-until-failure.sh for ordinary commands.
  3. Count only valid executions of the intended test. Parser or runner incompatibilities, missing builds or services, disconnected devices, exhausted emulator storage, stale system overlays, and another process replacing the app are harness failures. Repair or isolate the environment, then restart the initial count. Do not change product code or weaken the test to accommodate a broken harness.
  4. If the first clean run reaches the configured count without failure, stop immediately. Make no code changes and report that the issue could not be reproduced.
  5. When a failure occurs, inspect the most specific evidence available: failed-step timing, screenshots, view hierarchy, application and native logs, process lifecycle, network/backend state, and differences between iterations. Identify the first causal event rather than only the final missing element.
  6. Apply the smallest root-cause fix. Prefer lifecycle or state synchronization and stable readiness conditions over sleeps, retries, or relaxed assertions. A fixed delay is a last resort and must be justified by a bounded external transition.
  7. Run focused unit, compilation, and static checks required by the affected code and repository instructions. Then start a fresh run and require the configured number of consecutive passes. Any genuine failure resets the consecutive-pass count and requires further investigation.
  8. Report the failing iteration, root cause, fix, focused validation, and final consecutive-pass result. Follow the repository's existing commit and pull-request workflow; this skill grants no additional permission to mutate external systems.

Maestro E2E guidance for this repository

  • Build and install the example app first, then run one flow with maestro test -e APP_ID=com.stripe.react.native <flow> and an explicit device ID when multiple devices are connected.
  • Confirm the installed Maestro version supports the flow syntax. Treat a parse error as a runner mismatch, not a test reproduction.
  • Before counting Android iterations, verify emulator storage, network access to the configured demo backend, and that the expected APK remains installed. Concurrent worktrees use the same application ID and can replace each other's builds.
  • Give each iteration its own --debug-output directory. On failure, inspect its screenshot, hierarchy, Maestro log, device logcat, and application process exit reason.
  • Use platform-conditional flows for platform-specific selectors rather than mutually exclusive optional actions.
  • Wait for a stable screen identity or readiness signal, not content that can vary with saved payment methods, account state, or layout.
  • Do not hide startup crashes with an in-flow relaunch unless evidence shows the launch failure is unrelated infrastructure and existing suite-level retries are insufficient.
  • If a native flow returns control to JavaScript, check whether work that immediately presents UI ran before the React host activity reattached. Waiting for a later assertion cannot recover an alert or event that was already dropped.
  • Keep test hardening separate from product fixes when they address independent failure modes; remove redundant workarounds after the underlying race is fixed.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.