PluginBench
Skill
Pass
Audit score 90

init

alirezarezvani/claude-skills

Set up production-ready Playwright testing with framework detection, config generation, and CI workflow.

What is init?

Initializes a Playwright testing environment by detecting your project framework, generating configuration, creating folder structure, and setting up CI/CD. Use when you need to add end-to-end testing infrastructure to your project.

  • Detects project framework (React, Next.js, Vue, Angular, Svelte) and existing test setup
  • Generates framework-specific playwright.config.ts with baseURL and webServer configuration
  • Creates organized e2e folder structure with fixtures, page objects, and test data directories
  • Generates example tests demonstrating basic page navigation and element visibility checks
  • Creates GitHub Actions or GitLab CI workflow for automated test execution
  • Adds npm scripts (test:e2e, test:e2e:ui, test:e2e:debug) and updates .gitignore

How to install init

npx skills add https://github.com/alirezarezvani/claude-skills --skill init
Prerequisites
  • Node.js and npm installed
  • Existing project with package.json
  • Optional: TypeScript support (detected automatically)
Claude Code
Cursor
Windsurf
Cline

How to use init

  1. 1.Run the skill and confirm your project framework detection
  2. 2.Review the generated playwright.config.ts for correct baseURL and webServer settings
  3. 3.Check the created e2e/ folder structure and example test file
  4. 4.Run `npx playwright test` to verify the setup works
  5. 5.Add more tests to e2e/ directory following the example pattern
  6. 6.Commit the generated files and CI workflow to version control

Use cases

Good for
  • Adding end-to-end testing to a new React or Next.js project
  • Setting up CI/CD pipeline for automated browser testing on pull requests
  • Converting a project without tests to one with Playwright infrastructure
  • Configuring multi-browser testing (Chromium, Firefox, WebKit) for cross-browser compatibility
  • Establishing test data organization and page object model structure for scalable test suites
Who it's for
  • Frontend developers setting up testing infrastructure
  • QA engineers automating browser testing workflows
  • Teams adopting end-to-end testing for the first time
  • Projects needing CI/CD integration for Playwright tests

init FAQ

What if my framework isn't detected?

The skill will omit the webServer block and ask you to provide the baseURL. You can manually update playwright.config.ts afterward.

Can I use this with JavaScript instead of TypeScript?

Yes. The skill detects tsconfig.json and generates JavaScript config if TypeScript is not present.

Does this overwrite existing Playwright setup?

The skill checks if @playwright/test is already installed and existing test directories. It will not overwrite existing config unless you confirm.

How do I run tests in UI mode?

Use `npm run test:e2e:ui` or `npx playwright test --ui` to open the interactive test runner.

What CI systems are supported?

GitHub Actions (.github/workflows/) and GitLab CI (.gitlab-ci.yml) are auto-detected and configured.

Full instructions (SKILL.md)

Source of truth, from alirezarezvani/claude-skills.


name: "init" description: >- 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".

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:

npm init playwright@latest -- --quiet

Or if the user prefers manual setup:

npm install -D @playwright/test
npx playwright install --with-deps chromium

3. Generate playwright.config.ts

Adapt to the detected framework:

Next.js:

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  testDir: './e2e',
  fullyParallel: true,
  forbidOnly: !!process.env.CI,
  retries: process.env.CI ? 2 : 0,
  workers: process.env.CI ? 1 : undefined,
  reporter: [
    ['html', { open: 'never' }],
    ['list'],
  ],
  use: {
    baseURL: 'http://localhost:3000',
    trace: 'on-first-retry',
    screenshot: 'only-on-failure',
  },
  projects: [
    { name: "chromium", use: { ...devices['Desktop Chrome'] } },
    { name: "firefox", use: { ...devices['Desktop Firefox'] } },
    { name: "webkit", use: { ...devices['Desktop Safari'] } },
  ],
  webServer: {
    command: 'npm run dev',
    url: 'http://localhost:3000',
    reuseExistingServer: !process.env.CI,
  },
});

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

e2e/
├── fixtures/
│   └── index.ts          # Custom fixtures
├── pages/
│   └── .gitkeep          # Page object models
├── test-data/
│   └── .gitkeep          # Test data files
└── example.spec.ts       # First example test

5. Generate Example Test

import { test, expect } from '@playwright/test';

test.describe('Homepage', () => {
  test('should load successfully', async ({ page }) => {
    await page.goto('/');
    await expect(page).toHaveTitle(/.+/);
  });

  test('should have visible navigation', async ({ page }) => {
    await page.goto('/');
    await expect(page.getByRole('navigation')).toBeVisible();
  });
});

6. Generate CI Workflow

If .github/workflows/ exists, create playwright.yml:

name: "playwright-tests"

on:
  push:
    branches: [main, dev]
  pull_request:
    branches: [main, dev]

jobs:
  test:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: lts/*
      - name: "install-dependencies"
        run: npm ci
      - name: "install-playwright-browsers"
        run: npx playwright install --with-deps
      - name: "run-playwright-tests"
        run: npx playwright test
      - uses: actions/upload-artifact@v4
        if: ${{ !cancelled() }}
        with:
          name: "playwright-report"
          path: playwright-report/
          retention-days: 30

If .gitlab-ci.yml exists, add a Playwright stage instead.

7. Update .gitignore

Append if not already present:

/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

8. Add npm Scripts

Add to package.json scripts:

{
  "test:e2e": "playwright test",
  "test:e2e:ui": "playwright test --ui",
  "test:e2e:debug": "playwright test --debug"
}

9. Verify Setup

Run the example test:

npx playwright 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

Related skills

More from alirezarezvani/claude-skills and the wider catalog.

INinterview-system-designer logo

interview-system-designer

alirezarezvani/claude-skills

This skill should be used when the user asks to "design interview processes", "create hiring pipelines", "calibrate interview loops", "generate interview questions", "design competency matrices", "analyze interviewer bias", "create scoring rubrics", "build question banks", or "optimize hiring systems". Use for designing role-specific interview loops, competency assessments, and hiring calibration systems.

617 installs
ISisms-audit-expert logo

isms-audit-expert

alirezarezvani/claude-skills

Information Security Management System (ISMS) audit expert for ISO 27001 compliance verification, security control assessment, and certification support. Use when the user mentions ISO 27001, ISMS audit, Annex A controls, Statement of Applicability (SOA), gap analysis, nonconformity management, internal audit, surveillance audit, or security certification preparation. Helps review control implementation evidence, document audit findings, classify nonconformities, generate risk-based audit plans, map controls to Annex A requirements, prepare Stage 1 and Stage 2 audit documentation, and support corrective action workflows.

737 installs
JIjira-expert logo

jira-expert

alirezarezvani/claude-skills

Atlassian Jira expert for creating and managing projects, planning, product discovery, JQL queries, workflows, custom fields, automation, reporting, and all Jira features. Use when setting up or configuring Jira projects, writing JQL and advanced searches, creating dashboards, designing workflows, or performing technical Jira operations.

694 installs
KAkarpathy-coder logo

karpathy-coder

alirezarezvani/claude-skills

Use when writing, reviewing, or committing code to enforce Karpathy's 4 coding principles — surface assumptions before coding, keep it simple, make surgical changes, define verifiable goals. Triggers on "review my diff", "check complexity", "am I overcomplicating this", "karpathy check", "before I commit", or any code quality concern where the LLM might be overcoding.

896 installs
LAlanding-page-generator logo

landing-page-generator

alirezarezvani/claude-skills

Generates high-converting landing pages as complete Next.js/React (TSX) components with Tailwind CSS. Creates hero sections, feature grids, pricing tables, FAQ accordions, testimonial blocks, and CTA sections using proven copy frameworks (PAS, AIDA, BAB). Outputs SEO meta tags, structured data, and performance-optimised code targeting Core Web Vitals (LCP < 1s, CLS < 0.1). Use when the user asks to create a landing page, marketing page, homepage, single-page site, lead capture page, campaign page, promo page, or conversion-optimised web page — or when they want to A/B test landing page variants or replace a static page with one designed to convert.

611 installsAudited
LOloop logo

loop

alirezarezvani/claude-skills

Schedule autonomous experiment loops at custom intervals (10min to monthly) using cron scheduling.

1.5k installsAudited