audit-dependencies
Use when fixing dependency vulnerabilities, running pnpm audit, or when the audit-dependencies CI check fails
Use when UI changes are complete and e2e tests need updating. Analyzes what changed in UI components and systematically finds/fixes affected tests.
$ npx -y skills add payloadcms/payload --skill ui4-convert-tests --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ui4-convert-testsContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when UI changes are complete and e2e tests need updating. Analyzes what changed in UI components and systematically finds/fixes affected tests.
name: ui4-convert-tests description: Use when UI changes are complete and e2e tests need updating. Analyzes what changed in UI components and systematically finds/fixes affected tests.
After completing UI changes, this skill systematically identifies and fixes affected e2e tests. It analyzes the diff to understand _what kind_ of changes were made (not just which files), then finds tests that need updates.
**Goal:** Understand the _nature_ of your changes to predict test impact.
# Get changed UI files git diff main --name-only -- 'packages/ui/src/**/*.tsx' 'packages/ui/src/**/*.css'
**For each changed file, categorize the changes:**
git diff main -- <file> | grep -E '^\-.*className|^\-.*id=|^\+.*className|^\+.*id='
Look for components being:
git diff main -- <file> | grep -E 'Popup|PopupList|Drawer|Dropdown'
# Translation keys
git diff main -- <file> | grep -E "t\('|i18n\.t\("
# Hardcoded text
git diff main -- <file> | grep -E 'placeholder=|aria-label='**Build a change summary:**
| Change Type | What Changed | Test Impact | | ----------- | --------------------------------------------- | ------------------- | | Selector | `.btn:has-text("Create")` → `#create-new-doc` | Update locators | | Structure | Button moved into popup | Add popup open step | | Text | "Search by ID" → "Search" | Update assertions |
**Search strategy:** Cast a wide net, then narrow down.
# Search for component name references (not just selectors) grep -rn "QueryPreset\|query-preset\|preset" test/**/*.ts --include="*.spec.ts" --include="*.ts" # Search for specific selectors from Step 1 grep -rn "\.list-header\|Create New\|#create-new" test/**/*.ts
**Key test locations:**
| Pattern | Where to Look | | -------------------------------------- | ----------------------------- | | Component-specific | `test/<feature>/e2e.spec.ts` | | Shared helpers | `test/<feature>/helpers/*.ts` | | Cross-cutting | `test/__helpers/e2e/*.ts` | | Multiple features using same component | Search ALL test dirs |
**Don't just search for exact selectors!** Also search for:
**Before fixing, understand the test:**
1. **Read the full test** - Understand what it's actually testing 2. **Check for helpers** - Is there a shared helper that handles this selector? 3. **Look for patterns** - Are multiple tests doing the same thing?
**If multiple tests use the same selector, create/update a helper:**
// test/<feature>/helpers/togglePreset.ts
export async function openCreatePreset(page: Page) {
await page.click('#select-preset') // Open popup first
await page.click('#create-new-preset')
}This centralizes the fix and prevents future duplication.
| Change Type | Fix Strategy | | --------------------------- | ----------------------------------------------- | | **Selector renamed** | Direct string replacement | | **Element moved to popup** | Add click to open popup before clicking element | | **Element moved to drawer** | Add drawer open/close handling | | **Text simplified** | Update assertion to match new text | | **Element removed** | Rework test logic or delete test | | **Props changed** | Update attribute assertions | | **Conditional rendering** | May need to set up state before element appears |
**Run tests BEFORE making fixes to confirm they actually fail:**
# Use isolated port to avoid conflicts PORT=3150 pnpm test:e2e <suite> --max-failures=1 # Run specific test by name PORT=3150 pnpm test:e2e <suite> -g "test name" --max-failures=1
**Document failure patterns:**
**Priority: Fix helpers first, then individual tests.**
// Before
await page.click('.list-header .btn:has-text("Create")')
// After - prefer IDs when available
await page.click('#create-new-doc')// Before - direct click
await page.click('#edit-preset')
// After - open popup first
await page.click('#select-preset') // Opens the popup
await page.click('#edit-preset') // Now visible in popup// Before - specific placeholder text
await expect(input).toHaveAttribute('placeholder', /(Search by ID)/)
// After - simplified text
await expect(input).toHaveAttribute('placeholder', 'Search')When the same interaction is needed in multiple tests:
// test/<feature>/helpers/interactions.ts
export async function openEditPreset(page: Page) {
await page.click('#select-preset')
await pagePayload 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 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…
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