Migrate skill for Claude

Use when moving tests from Cypress or Selenium to Playwright ('migrate tests', 'convert tests', 'replace selenium').

Migrate SKILL.md

The full skill file from alirezarezvani/claude-skills (MIT).

Migrate to Playwright

Interactive migration from Cypress or Selenium to Playwright with file-by-file conversion.

Input

$ARGUMENTS can be:

  • "from cypress" — migrate Cypress test suite
  • "from selenium" — migrate Selenium/WebDriver tests
  • A file path: convert a specific test file
  • Empty: auto-detect source framework

Steps

1. Detect Source Framework

Use Explore subagent to scan:

  • cypress/ directory or cypress.config.ts → Cypress
  • selenium, webdriver in package.json deps → Selenium
  • .py test files with selenium imports → Selenium (Python)

2. Assess Migration Scope

Count files and categorize:

Migration Assessment:
- Total test files: X
- Cypress custom commands: Y
- Cypress fixtures: Z
- Estimated effort: [small|medium|large]
SizeFilesApproach
Small (1-10)Convert sequentiallyDirect conversion
Medium (11-30)Batch in groups of 5Use sub-agents
Large (31+)Use /batchParallel conversion with /batch

3. Set Up Playwright (If Not Present)

Run /pw:pw-init first if Playwright isn't configured.

4. Convert Files

For each file, apply the appropriate mapping:

Cypress → Playwright

Load cypress-mapping.md for complete reference.

Key translations:

cy.visit(url)           → page.goto(url)
cy.get(selector)        → page.locator(selector) or page.getByRole(...)
cy.contains(text)       → page.getByText(text)
cy.find(selector)       → locator.locator(selector)
cy.click()              → locator.click()
cy.type(text)           → locator.fill(text)
cy.should('be.visible') → expect(locator).toBeVisible()
cy.should('have.text')  → expect(locator).toHaveText(text)
cy.intercept()          → page.route()
cy.wait('@alias')       → page.waitForResponse()
cy.fixture()            → JSON import or test data file

Cypress custom commands → Playwright fixtures or helper functions Cypress plugins → Playwright config or fixtures before/beforeEach → test.beforeAll() / test.beforeEach()

Selenium → Playwright

Load selenium-mapping.md for complete reference.

Key translations:

driver.get(url)                    → page.goto(url)
driver.findElement(By.id('x'))     → page.locator('#x') or page.getByTestId('x')
driver.findElement(By.css('.x'))   → page.locator('.x') or page.getByRole(...)
element.click()                    → locator.click()
element.sendKeys(text)             → locator.fill(text)
element.getText()                  → locator.textContent()
WebDriverWait + ExpectedConditions → expect(locator).toBeVisible()
driver.switchTo().frame()          → page.frameLocator()
Actions                            → locator.hover(), locator.dragTo()

5. Upgrade Locators

During conversion, upgrade selectors to Playwright best practices:

  • #id → getByTestId() or getByRole()
  • .class → getByRole() or getByText()
  • [data-testid] → getByTestId()
  • XPath → role-based locators

6. Convert Custom Commands / Utilities

  • Cypress custom commands → Playwright custom fixtures via test.extend()
  • Selenium page objects → Playwright page objects (keep structure, update API)
  • Shared helpers → TypeScript utility functions

7. Verify Each Converted File

After converting each file:

npx playwright test <converted-file> --reporter=list

Fix any compilation or runtime errors before moving to the next file.

8. Clean Up

After all files are converted:

  • Remove Cypress/Selenium dependencies from package.json
  • Remove old config files (cypress.config.ts, etc.)
  • Update CI workflow to use Playwright
  • Update README with new test commands

Ask user before deleting anything.

Output

  • Conversion summary: files converted, total tests migrated
  • Any tests that couldn't be auto-converted (manual intervention needed)
  • Updated CI config
  • Before/after comparison of test run results

How to install Migrate

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit alirezarezvani/claude-skills/engineering-team/playwright-pro/skills/migrate#main ~/.claude/skills/migrate

Codex

npx degit alirezarezvani/claude-skills/engineering-team/playwright-pro/skills/migrate#main ~/.codex/skills/migrate

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Migrate skill do?

Use when moving tests from Cypress or Selenium to Playwright ('migrate tests', 'convert tests', 'replace selenium').

+How do I install Migrate in Claude Code?

Copy the skill folder into ~/.claude/skills/migrate, for example with "npx degit alirezarezvani/claude-skills/engineering-team/playwright-pro/skills/migrate#main ~/.claude/skills/migrate". Claude Code loads it automatically and uses it when a task matches.

+Does Migrate work with ChatGPT or Codex?

Yes. Migrate uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/migrate. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Migrate free?

Migrate is published on GitHub by alirezarezvani under the MIT license, which allows free use.

Related testing & code review skills

  1. Agent Browser

    Official

    Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms,…

    vercel-labs/agent-browser★ 53k
  2. Playwright

    Official

    Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction,…

    openai/skills★ 29k
  3. Playwright Skill

    Complete browser automation with Playwright. Auto-detects dev servers, writes reusable test scripts, and supports screenshots, responsive…

    lackeyjb/playwright-skill★ 3.3k
  4. Month End Close

    Use when running, planning or speeding up a month-end (or quarter-end) close — building or reviewing the close checklist and calendar,…

    alirezarezvani/claude-skills★ 30k
  5. Named Persona Adversarial Review

    Use when a PR has architectural or UX impact, or automated review feels generic, and you want it reviewed through named engineers'…

    alirezarezvani/claude-skills★ 30k
  6. Pr Review Expert

    File-by-file pull request review for bugs, security and quality, with a merge verdict.

    alirezarezvani/claude-skills★ 30k
  7. Pw

    Use for any Playwright or end-to-end browser testing work: writing tests, fixing flaky ones, migrating from Cypress or Selenium, CI setup,…

    alirezarezvani/claude-skills★ 30k
  8. Pw Init

    Use when setting up Playwright in a project ('set up playwright', 'add e2e tests', 'configure playwright', 'init playwright').

    alirezarezvani/claude-skills★ 30k
  9. Pw Review

    Use when reviewing Playwright tests for quality ('review tests', 'audit tests', 'playwright best practices check').

    alirezarezvani/claude-skills★ 30k

See all testing & code review skills →

More skills from alirezarezvani

  1. Migration Architect

    Plan a migration with zero or minimal downtime: phased plan, compatibility check, rollback scripts, for schemas, databases and services.

    alirezarezvani/claude-skills★ 30k
  2. Mobile Release

    Use when shipping an iOS or Android app update to the App Store or Google Play - Apple or Google rejected or warned about a build…

    alirezarezvani/claude-skills★ 30k
  3. Monorepo Navigator

    Use for Turborepo, Nx, pnpm-workspace or Lerna setup, affected-only builds, remote caching or a multi-repo to monorepo move.

    alirezarezvani/claude-skills★ 30k

All skills by alirezarezvani →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.