flaky-test-detection
Detect, prevent, and fix flaky Jest unit tests in MetaMask Mobile before they reach CI. Use this skill when: reviewing a PR diff or changed test files for flakiness risk, fixing an intermittently failing Jest test, reproducing a flaky test locally, or auditing GitHub Actions history to rank historically flaky unit tests by failure rate.
- License 许可
- MIT
- 所属仓库
- MetaMask/skills
- 最近更新
- 2026-11-14
- Stars
- ★ 25
- Forks
- 11
01 前言 Front Matter
- name
- flaky-test-detection
- description
- Detect, prevent, and fix flaky Jest unit tests in MetaMask Mobile before they reach CI. Use this skill when: reviewing a PR diff or changed test files for flakiness risk, fixing an intermittently failing Jest test, reproducing a flaky test locally, or auditing GitHub Actions history to rank historically flaky unit tests by failure rate.
02 资源文件 2
- 参考文档references/gh-analysis.md3.9 KB
- 参考文档repos/metamask-mobile.md9.3 KB
03 SKILL.md 正文
Flaky Test Detection
Task → Which mode?
├─ Reviewing changed test files / PR diff for risk patterns → Review mode
├─ Fixing a known flaky Jest unit test → Review mode + local reproduce loop
└─ Auditing CI history to rank flaky tests by failure rate → open references/gh-analysis.md
Constraints
If the file is *.view.test.ts(x), follow mms-mobile-testing component-view
rules instead of this skill's fake-timer patterns (J2 / J8). CV forbids fake
timers. Use the CV diagnosing table for sibling-skeleton waits, empty-state
load, list hydration, stale press, nested findBy*, and Engine mockReset.
All proposed unit fixes must comply with mms-mobile-testing (unit path) and mms-coding-guidelines. Key rules:
- Use
jest.mocked(fn)— neverfn as jest.Mock - Use
toBeOnTheScreen()— nevertoBeTruthy()/toBeDefined()for element presence - Use
yarncommands — never npm or npx - No
toMatchSnapshot()— use explicit assertions ortoMatchInlineSnapshot()
Review mode
- Scan changed
.test.ts(x)files against the pattern table (J1–J10). - Classify each hit (async / timing / isolation / mock / state).
- Propose the fix for each hit using the ✅ pattern from the matching section — apply only on explicit confirmation.
- Run the local reproduction loop to confirm the fix holds.
Audit mode
Query GitHub Actions run history to produce a ranked list of historically flaky unit test files with failure rates and suggested fix categories.
Open references/gh-analysis.md for the full procedure.
04 同仓库更多 Skills
recipe-plan-and-dispatch
Plan a ticket with the engineer before a recipe fix-bug or dev run. Agree the acceptance criteria and an implementation plan, write it as an approved plan file, and print the prompt that starts the run with any agent and model. Never edits product code or starts the run.
recipe-library-audit
Run every recipe of a team recipe library on one client with mm-harness, classify each result with the failing node and exact error, and review naming and composability. Produces a per-client table; changes nothing.
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
x402-payments
Build x402 payment flows using MetaMask Smart Accounts Kit, machine to machine payments over HTTP with ERC-7710 delegations and ERC-7715 Advanced Permissions
smart-accounts-kit
Build dApps with MetaMask Smart Accounts Kit — ERC-4337 smart accounts, delegations, and Advanced Permissions (ERC-7715)
oh-my-opencode
Multi-agent orchestration plugin for OpenCode. Use when the user wants to install, configure, or operate oh-my-opencode — including agent delegation, ultrawork mode, Prometheus planning, background tasks, category-based task routing, model resolution, tmux integration, or any oh-my-opencode feature. Covers installation, configuration, all agents (Sisyphus, Oracle, Librarian, Explore, Atlas, Prometheus, Metis, Momus), all categories, slash commands, hooks, skills, MCPs, and troubleshooting.