playwright-auth-state

playwright-auth-state is a skill for Claude Code, Codex from hzijad/playwright-agent-skills. It costs 20 tokens per session (1,165 once invoked), scanned A, original, MIT.

A Playwright testing workflow for reusing saved browser login sessions. Playwright is a tool for automating browser tests, and the saved state lets tests begin already signed in.

In plain words
What is it for?
Use it when tests need an existing authenticated session, shared login state, or separate saved permissions for different roles.
Why use it?
It avoids repeating the login screen in every test and makes tests for different user roles more consistent.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when tests need an existing authenticated session, shared login state, or separate saved permissions for different roles.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hzijad/playwright-agent-skills/playwright-auth-state
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.

Any agent
npx skills add hzijad/playwright-agent-skills --skill playwright-auth-state
Clone the repo
git clone --depth 1 https://github.com/hzijad/playwright-agent-skills

Made for: Claude Code, Codex.

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 playwright-auth-state

README.md
[![agentmods](https://agentmods.dev/badge/skills/hzijad/playwright-agent-skills/playwright-auth-state/github.svg)](https://agentmods.dev/skills/hzijad/playwright-agent-skills/playwright-auth-state)
Your own site
<a href="https://agentmods.dev/skills/hzijad/playwright-agent-skills/playwright-auth-state"><img src="https://agentmods.dev/badge/skills/hzijad/playwright-agent-skills/playwright-auth-state/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright-auth-state

Your own site · 80×15
<a href="https://agentmods.dev/skills/hzijad/playwright-agent-skills/playwright-auth-state"><img src="https://agentmods.dev/badge/skills/hzijad/playwright-agent-skills/playwright-auth-state.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,165 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.00020 $0.01165
Opus 5 $0.00010 $0.00583
Sonnet 5 $0.00004 $0.00233
Haiku 4.5 $0.00002 $0.00117

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

Security

Grade A, and why

playwright-auth-state 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 12d 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.

skills/playwright-auth-state/SKILL.md · 152 lines

How it starts

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

Playwright Auth State

Overview

Use this skill when tests need to start in a known logged-in session or with a role-specific browser state instead of repeating the login UI in every spec. It keeps the browser state deterministic without making authentication the focus of the test.

Do not use this skill when the login form itself is the feature under test, or when the app is fully local and does not need shared browser state.

When to Use

  • When a test requires an already authenticated user.
  • When a suite benefits from reusing browser state across many tests.
  • When you need separate roles or permissions without redoing the UI login.

When Not to Use

  • When the login flow is the feature under test.
  • When the app behavior is fully local and does not depend on stored session state.
  • When you are diagnosing a flake that should be fixed first in playwright-debugging.

Authenticated State

Create the authenticated state once in a setup project, then load it in the tests that need it.

// tests/auth.setup.ts
import { test as setup, expect } from '@playwright/test';

setup('authenticate', async ({ page }) => {
  await page.goto('/login');
  await page.getByLabel('Email').fill('[email protected]');
  await page.getByLabel('Password').fill('password123');
  await page.getByRole('button', { name: 'Sign in' }).click();

  await expect(page.getByRole('button', { name: 'Sign out' })).toBeVisible();
  await page.context().storageState({ path: 'playwright/.auth/user.json' });
});

Apply the saved state in configuration:

// playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'setup',
      testMatch: /.*\.setup\.ts/,
    },
    {
      name: 'chromium',
      dependencies: ['setup'],
      use: {
        storageState: 'playwright/.auth/user.json',
      },
    },
  ],
});

If only some tests need the logged-in session, scope the state to a specific project rather than making it global. For multiple roles, keep one state file per role and give each project a clear name.

Read the full file on GitHub · 152 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. 12d ago First seen · 152 lines · 20 tokens per session scan A e71f8025df99

Subscribe to this mod's changes

playwright-auth-state is a skill published in the GitHub repository hzijad/playwright-agent-skills (9 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 1,165 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-31.

Related

Other skills, from other repositories

vibe-e2e

Generates and runs full end-to-end UI tests using Playwright against a live URL. Auto-installs Playwright and Chromium if not present — isolated in e2e/ folder, never pollutes app dependencies. Reads SPEC.md and FEATURES.md to automatically generate test flows covering every critical user journey. Runs tests with…

aakashdhar/vibe-skill · 163 tokens

playwright

Provides comprehensive guidance for Playwright testing including browser automation, test writing, page objects, and cross-browser testing. Use when the user asks about Playwright, needs to write E2E tests, automate browsers, or test web applications across browsers.

Zephyrex21/claude-skills-vetted · 52 tokens

smoke

Run the clawback end-to-end smoke test. Starts a mock upstream, spawns the proxy against it, exercises path-mode and hash-mode requests, walks the admin API, and prints the persisted state. Use when verifying the proxy still works after changes.

zapgun-ai/clawback · 54 tokens

playwright-cli

Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, extract information from web pages, mock network requests, manage browser…

zebbern/claude-code-guide · 67 tokens

test-site

Tests a deployed, activated Power Pages site at runtime using browser-based navigation, page crawling, and API request verification via Playwright. Use when the user wants to test, verify, or smoke-test their deployed site.

microsoft/power-platform-skills · 46 tokens

playwright-skill

Battle-tested Playwright patterns for E2E, API, component, visual, accessibility, and security testing. Covers locators, fixtures, POM, network mocking, auth flows, debugging, CI/CD (GitHub Actions, GitLab, CircleCI, Azure, Jenkins), framework recipes (React, Next.js, Vue, Angular), and migration guides from…

zebbern/claude-code-guide · 87 tokens