Use when CI tests fail on main branch after PR merge, or when investigating flaky test failures in CI environments
View on GitHubFebruary 2, 2026
Select agents to install to:
npx add-skill https://github.com/majiayu000/claude-skill-registry/blob/3d28154b57193341e6821f787824a944815da51f/skills/triage-ci-flake/SKILL.md -a claude-code --skill triage-ci-flakeInstallation paths:
.claude/skills/triage-ci-flake/# Triage CI Failure
## Overview
Systematic workflow for triaging and fixing test failures in CI, especially flaky tests that pass locally but fail in CI. Tests that made it to `main` are usually flaky due to timing, bundling, or environment differences.
**CRITICAL RULE: You MUST run the reproduction workflow before proposing any fixes. No exceptions.**
## When to Use
- CI test fails on `main` branch after PR was merged
- Test passes locally but fails in CI
- Test failure labeled as "flaky" or intermittent
- E2E or integration test timing out in CI only
## MANDATORY First Steps
**YOU MUST EXECUTE THESE COMMANDS. Reading code or analyzing logs does NOT count as reproduction.**
1. **Extract** suite name, test name, and error from CI logs
2. **EXECUTE**: Kill port 3000 to avoid conflicts
3. **EXECUTE**: `pnpm dev $SUITE_NAME` (use run_in_background=true)
4. **EXECUTE**: Wait for server to be ready (check with curl or sleep)
5. **EXECUTE**: Run the specific failing test with Playwright directly (npx playwright test test/TEST_SUITE_NAME/e2e.spec.ts:31:3 --headed -g "TEST_DESCRIPTION_TARGET_GOES_HERE")
6. **If test passes**, **EXECUTE**: `pnpm prepare-run-test-against-prod`
7. **EXECUTE**: `pnpm dev:prod $SUITE_NAME` and run test again
**Only after EXECUTING these commands and seeing their output** can you proceed to analysis and fixes.
**"Analysis from logs" is NOT reproduction. You must RUN the commands.**
## Core Workflow
```dot
digraph triage_ci {
"CI failure reported" [shape=box];
"Extract details from CI logs" [shape=box];
"Identify suite and test name" [shape=box];
"Run dev server: pnpm dev $SUITE" [shape=box];
"Run specific test by name" [shape=box];
"Did test fail?" [shape=diamond];
"Debug with dev code" [shape=box];
"Run prepare-run-test-against-prod" [shape=box];
"Run: pnpm dev:prod $SUITE" [shape=box];
"Run specific test again" [shape=box];
"Did test fail now?" [shape=diamond];
"Debug bundling issue" [