Agent skill · alirezarezvani

pw-init

Set up Playwright in a project. Use when user says "set up playwright", "add e2e tests", "configure playwright", "testing setup", "init playwright", or "add test infrastructure".

What it needs

About 2k tokens when loaded.

What this skill does

Initialize Playwright Project Set up a production-ready Playwright testing environment. Detect the framework, generate config, folder structure, example test, and CI workflow. Steps 1. Analyze the Project Use the Explore subagent to scan the project: Check package.json for framework (React, Next.js, Vue, Angular, Svelte) Check for tsconfig.json → use TypeScript; otherwise JavaScript Check if Playwright is already installed (@playwright/test in dependencies) Check for existing test directories (tests/, e2e/, tests/) Check for existing CI config (.github/workflows/, .gitlab-ci.yml) 2. Install Playwright If not already installed: Or if the user prefers manual setup: 3. Generate playwright.config.ts Adapt to the detected framework: Next.js: React (Vite): Change baseURL to http://localhost:5173 Change webServer.command to npm run dev Vue/Nuxt: Change baseURL to http://localhost:3000 Change webServer.command to npm run dev Angular: Change baseURL to http://localhost:4200 Change webServer.command to npm run start No framework detected: Omit webServer block Set baseURL from user input or leave as placeholder 4. Create Folder Structure 5. Generate Example Test 6. Generate CI Workflow If .github/workflows/ exists, create playwright.yml: If .gitlab-ci.yml exists, add a Playwright stage instead. 7. Update .gitignore Append if not already present: 8. Add npm Scripts Add to package.json scripts: 9. Verify Setup Run the example test: Report the result. If it fails, diagnose and fix before completing. Output Confirm what was created: Config file path and key settings Test directory and example test CI workflow (if applicable) npm scripts added How to run: npx playwright test or npm run test:e2e

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills alirezarezvani/pw-init--8acf80

View the source on GitHub

Browse the @skills marketplace