audit-dependencies
Use when fixing dependency vulnerabilities, running pnpm audit, or when the audit-dependencies CI check fails
Use when CI tests fail on main branch after PR merge, when investigating flaky test failures, or when user provides a PR URL/number to aggregate all failing tests
$ npx -y skills add payloadcms/payload --skill triage-ci-flake --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/triage-ci-flakeContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when CI tests fail on main branch after PR merge, when investigating flaky test failures, or when user provides a PR URL/number to aggregate all failing tests
name: triage-ci-flake description: Use when CI tests fail on main branch after PR merge, when investigating flaky test failures, or when user provides a PR URL/number to aggregate all failing tests allowed-tools: Write, Bash(date:*), Bash(mkdir -p *)
Systematic workflow designed specifically for triaging and fixing end-to-end (e2e) test failures in CI, especially flaky Playwright tests that pass locally but fail in CI. E2E 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 the user provides a PR URL (e.g., `https://github.com/payloadcms/payload/pull/16701`) or PR number:
First, use `tool_search` with query "github pull request status checks" to load the GitHub tools.
Then use the `github-pull-request_pullRequestStatusChecks` tool to get all failing checks:
Tool: github-pull-request_pullRequestStatusChecks
Parameters:
pullRequestNumber: <extracted from URL or provided>
repo: { owner: "payloadcms", name: "payload" }Parse the status checks response and create a summary table:
| Suite | Check Status | Target URL | | --------------------- | ------------ | ---------- | | admin**e2e**list-view | failed | [link] | | plugin-import-export | failed | [link] |
For each failing check, the `context` field contains the test suite name (e.g., `admin__e2e__list-view`).
For each failing check:
1. Visit the `targetUrl` to get detailed failure logs 2. Extract the specific test name and error message 3. Add to the aggregated failure list
Present a consolidated summary:
## Failing Tests Summary ### 1. admin**e2e**list-view (3/4) - **Test**: "should use custom pagination limit" - **Error**: Locator `.per-page__button` not found - **File**: test/admin/e2e/list-view/e2e.spec.ts:1495 ### 2. plugin-import-export - **Test**: "should inherit limit from list view URL" - **Error**: Locator `.per-page__button` not found - **File**: test/plugin-import-export/e2e.spec.ts:150
Look for patterns across failures:
For each unique failure, follow the standard reproduction workflow below.
**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.**
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" [shape=box];
"Unable to reproduce - check logs" [shape=box];
"Fix and verify" [shape=box];
"CI failure reported" -> "Extract details from CI logs";
"Extract details from CI logs" -> "Identify suite and test name";
"Identify suite and test name" -> "Run dev server: pnpm dev $SUITE";
"Run dev server: pnpm dev $SUITE" -> "Run specific test by name";
"Run specific test by name" -> "Did test fail?";
"Did test fail?" -> "Debug with dev code" [label="yes"];
"Did test fail?" -> "Run prepare-run-test-against-prod" [label="no"];
"Run prepare-run-test-against-prod" -> "Run: pnpm dev:prod $SUITE";
"Run: pnpm dev:prod $SUITE" -> "Run specific test again";
"Run specific test again" -> "Did test fail now?";
"Did test fail now?" -> "Debug bundling issue" [label="yes"];
"Did test fail now?" -> "Unable to reproduce - check logs" [label="no"];
"Debug with dev code" -> "Fix and verify";
"Debug bundling issue" -> "Fix and verify";
}From CI logs or GitHub Actions URL, identify:
**CRITICAL: Always run the specific test by name, not the full suite.**
**SERVER MANAGEMENT RULES:**
1. **ALWAYS kill all servers before starting a new one** 2. **NEVER assume ports are free** 3. **ALWAYS wait for server ready confirmation before running tests**
#
Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
Repo: payloadcms/payload
Use when fixing dependency vulnerabilities, running pnpm audit, or when the audit-dependencies CI check fails
Use when writing a Playwright visual regression (screenshot comparison) test, tagging a test `@visual`, generating or updating baseline screenshots, running…
Use when new translation keys are added to packages to generate new translations strings
Use when UI changes are complete and e2e tests need updating. Analyzes what changed in UI components and systematically finds/fixes affected tests.
Review UI4 CSS migrations for proper token usage. Checks that CSS variables are used instead of hardcoded values.
Manually invoked skill for reskinning Payload UI components. Requires Figma URL. Usage: /ui4