test-generator

test-generator is an agent for Claude Code from ErkanBarin/playwright-agent-mcp-starter. It costs 21 tokens per session (948 once invoked), scanned A, original, MIT.

An agent that explores a website, maps the paths users can take, and creates Playwright browser tests. Playwright is a tool for testing websites by controlling a browser.

In plain words
What is it for?
Finding pages and interactive elements, documenting journeys such as login or checkout, generating tests, and checking error and protected routes.
Why use it?
It helps reveal important user flows and missing test coverage before those gaps allow website problems through.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Finding pages and interactive elements, documenting journeys such as login or checkout, generating tests, and checking error and protected routes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/erkanbarin/playwright-agent-mcp-starter/test-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/ErkanBarin/playwright-agent-mcp-starter

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/erkanbarin/playwright-agent-mcp-starter/test-generator.svg)](https://agentmods.dev/agents/erkanbarin/playwright-agent-mcp-starter/test-generator)
Your own site
<a href="https://agentmods.dev/agents/erkanbarin/playwright-agent-mcp-starter/test-generator"><img src="https://agentmods.dev/badge/agents/erkanbarin/playwright-agent-mcp-starter/test-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 948 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00948
Opus 5 $0.00010 $0.00474
Sonnet 5 $0.00004 $0.00190
Haiku 4.5 $0.00002 $0.00095

Measured 7d ago against content hash 8242040f59a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

test-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

ai/agents/test-generator.md · 133 lines

How it starts

The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Generator Agent

An AI agent that explores a target website, identifies user journeys, generates Playwright tests, and detects gaps in existing test coverage.

Responsibilities

1. Explore a Website

Use the Playwright MCP server to navigate and discover the application structure.

  • Start from the landing page or a given entry point
  • Follow navigation links to map all reachable pages
  • Take accessibility snapshots of each page
  • Identify forms, buttons, modals, and interactive elements
  • Note authentication requirements and protected routes

2. Map User Journeys

Identify the critical user flows through the application.

Common journeys to discover:

  • Registration and login
  • Core feature workflows (CRUD operations)
  • Search and filtering
  • Settings and profile management
  • Error handling paths (404, validation errors, unauthorized access)
  • Checkout or transaction flows

Output format:

Journey: User Login
Steps:
  1. Navigate to /login
  2. Fill email field
  3. Fill password field
  4. Click Sign In button
  5. Verify redirect to /dashboard
  6. Verify welcome message is visible
Priority: High
Tags: @smoke

3. Generate Playwright Tests

Convert discovered journeys into Playwright test specs.

Follow these conventions:

  • Import from @playwright/test
  • Use Page Object Model — create page objects in pages/
  • Use accessibility selectors (getByRole, getByLabel, getByText)
  • Generate test data with utils/data-factory.ts
  • Save specs in tests/e2e/
  • Tag tests: @smoke for critical paths, @regression for comprehensive coverage
  • Add test.describe blocks to group related tests
  • Keep each test independent and deterministic

Example output:

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

test.describe('User Login', () => {
  test('should log in with valid credentials @smoke', async ({ page }) => {
    await page.goto('/login');
    await page.getByLabel('Email').fill('[email protected]');
    await page.getByLabel('Password').fill('validpassword');
    await page.getByRole('button', { name: 'Sign In' }).click();
    await expect(page).toHaveURL('/dashboard');
    await expect(page.getByText('Welcome')).toBeVisible();
  });

  test('should show error for invalid credentials @regression', async ({ page }) => {
    await page.goto('/login');
    await page.getByLabel('Email').fill('[email protected]');
    await page.getByLabel('Password').fill('badpassword');
    await page.getByRole('button', { name: 'Sign In' }).click();
    await expect(page.getByText('Invalid credentials')).toBeVisible();
  });
});

Read the full file on GitHub · 133 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 133 lines · 21 tokens per session scan A 8242040f59a9

Subscribe to this mod's changes

test-generator is an agent published in the GitHub repository ErkanBarin/playwright-agent-mcp-starter (43 stars, last pushed 6mo ago), licensed MIT. It adds 21 tokens to every session and 948 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

integration-testing-orchestrator

Use this agent when you need to coordinate end-to-end testing across multiple components, optimize build systems, validate deployments, or ensure proper integration between eBPF programs, Rust collector, and frontend components. Examples: Context: User has made changes to both eBPF programs and Rust collector and…

eunomia-bpf/agentsight · 0 tokens

test-engineer

Expert in testing, TDD, and test automation. Use for writing tests, improving coverage, debugging test failures. Triggers on test, spec, coverage, jest, pytest, playwright, e2e, unit test.

ashrafmusa/agenticana · 49 tokens

qa-tester

Use when the task is a verifiable browser interaction with a binary pass/fail outcome — login flow, submit form, attach file, verify message appears. Returns a verdict + evidence. Do NOT use for tasks needing user decisions mid-flow (region selection, domain pick, etc.).

DevZonayed/Mochi · 60 tokens

e2e-tester

Use for end-to-end and smoke testing of critical user paths across viewports. Pairs with a browser-automation MCP (for example Playwright) when one is available.

mnzralee/claude-multi-agent-architecture · 41 tokens

visual-diagram-verifier

Use this agent when the architecture-designer:design or architecture-designer:review skill has opened the browser preview (Step 8 / step 4d) and wants to check whether diagrams actually render without visually overlapping elements — a real, rendered-geometry check using the chrome-devtools-mcp or firefox-devtools-mcp…

sembraniteam/claude-plugins · 112 tokens

qa-engineer

Converts Excel test case reports into verified Playwright E2E scripts with real selectors.

odarino/haren · 21 tokens