/fsh:flake-huntfrom fsh
Reproduce, diagnose, and fix a flaky Playwright e2e test via a detect → diagnose → fix → verify loop. Forbids cheap papering-over (timeouts, retries, skip). Files a tracker task on give-up.
Ships in fsh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
You are running the flake-hunt skill against a Playwright spec. Your job is to find the root cause of a flake and fix it — not to make the test pass.
A green run achieved by adding a timeout, raising retries, or skipping the test is a failure of this skill, not a success.
This skill is repo-agnostic. Gather from the repository you're running in:
playwright.config.{ts,js} and the single-spec run command. Derive from the repo's AGENTS.md / CLAUDE.md / package.json scripts.workers=1 (e.g. a dev server that can't handle concurrent SSR) while CI runs higher parallelism. Honor whatever the project's playwright.config / docs document; don't assume.## Skill profile in the repo's root AGENTS.md: tracker id + default status/priority/tags). If none configured, ask the user.The user invokes this skill with one of:
If args are empty, ask the user which spec to target. Do not guess.
waitForTimeout(N) or any literal-ms sleeptimeout value (per-test, per-action, expect)expect.poll / expect.toPass introduced without a corresponding upstream changeretries (config or per-test)test.skip / test.fixme / .only — except via the Quarantine flow belowtry/catch to swallow assertion failuresRun the spec multiple times to see if and how it flakes. Pick runs/workers per the project's constraints — typically 5 runs locally (with the project's required worker count, often 1) and 10 runs / higher parallelism matching CI.
Use the bundled helper (or the project's own flake-runner if it ships one). Output goes to a fresh dir; keep traces under a gitignored path:
# from the Playwright project root
"${CLAUDE_SKILL_DIR}/scripts/flake-run.sh" \
"tests/path/to/foo.spec.ts" \
5 1 \
.flake-hunt/foo/detect
Parse the resulting results.json:
suites[].specs[].tests[].results[]; bucket by status (passed, failed, timedOut).Outcomes:
Before touching code, write a hypothesis. It must:
Categories and the diagnostic each one points to:
waitFors, check the data-layer cache keys, look for a missing waitFor after a navigation.You get 3 diagnose passes. If after 3 hypothesis-and-test cycles you cannot pin the cause, stop and Quarantine (below). Don't guess.
Implement the fix that follows from the validated hypothesis. The fix MUST address the root cause:
waitFor for the specific state being waited on (a network response, an element appearing, a loading boundary settling). Not a blanket timeout..skip and not a runner retry.Read every diff against the Hard rules → Forbidden fixes list before saving. If your fix touches any of those patterns, stop and reconsider.
Re-run the spec, more aggressively than detect — e.g. 5/5 locally (with the project's worker count) and recommend a heavier CI pass (e.g. 20/20 at CI parallelism):
"${CLAUDE_SKILL_DIR}/scripts/flake-run.sh" \
"tests/path/to/foo.spec.ts" \
5 1 \
.flake-hunt/foo/verify
Output a markdown summary at .flake-hunt/<spec-slug>/report.md:
# Flake hunt: <spec relative path>
## Detect
- Runs: N / Workers: W / Env: local|CI
- Passed: X / Failed: Y
- Fingerprints:
- `<error first line>` × N (trace: <path>)
## Hypothesis (validated)
- Category: race | shared-state | timing | environment | real-bug
- Evidence: <trace/log/network citation>
- Diagnostic run: <what you tried and what it showed>
## Fix
- Files changed: <list>
- Summary: <one sentence>
- Why this is not a forbidden fix: <one sentence>
## Verify
- Runs: N / Workers: W / Env: local|CI
- Passed: X / Failed: Y
- Status: GREEN | NOT YET FIXED
If the work is on a PR, also post the report as a PR comment via gh pr comment <N> --body-file <report-path>.
Only when you've exhausted 3 diagnose passes without a falsifiable hypothesis. Steps:
## Skill profile; if none, ask the user). Include:
Flake: <spec relative path>test.fixme — not .skip. Include a reason string referencing the tracker task URL:
test.fixme(true, 'Flaky — see <tracker task URL>');
.skip, no commented-out test, no --grep-invert)..flake-hunt/) for the duration of the hunt.results.json into context — parse it via node -e one-liners and pull only what you need.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fullstackhouse/skills --plugin fsh35 skills in this plugin
/blacksmithMigrate a repository's GitHub Actions workflows to Blacksmith runners — inventory every job, move the ones that build, run or test the app (image builds get the sticky-disk Docker actions, a size-capped cache and a Dockerfile audit for cache killers), leave glue, deploy and credential-bound jobs on GitHub, capture a per-step timing baseline, hand off to `deliver --no-merge` with the decision table in the PR, and measure real rebuilds on that PR when the existing runs can't settle it. Use when asked to "move CI to Blacksmith", "cut GitHub Actions spend", "make the image build faster", or right after the Blacksmith app was installed on an org. Args: a repo path (default: the current repo), plus `--audit-only` to print the decision table and write nothing./brainstormDivergent conversation before any artifact exists — question the idea, weigh alternatives including building nothing, then converge on one routed next step (drop it, park it as a ticket, kick off implementation, or bug-hunt) with a handoff brief. Use when the user says "should we build this", "I have an idea", "let's think this through", or "is this worth doing". Read-only until the routing is confirmed./broRestate the last message in plain human language, with no jargon.