openspec-playwright CLAUDE.md

A setup tool that connects OpenSpec, a specification workflow, with Playwright, a browser-testing tool, for end-to-end tests.

In plain words
What is it for?
It is for initializing and checking OpenSpec and Playwright test setups, then building, linting, type-checking, and running those tests.
Why use it?
It checks prerequisites and provides the files needed to create authenticated browser tests in a project.

Instructions file

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.

agentmods
npx agentmods add instructions/wxhou/openspec-playwright/claude-md
Clone the repo
git clone --depth 1 https://github.com/wxhou/openspec-playwright
Per session 1,500 This file is loaded in full into every session.
When invoked 1,500 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
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 $0.01500 $0.01500
Opus 5 $0.00750 $0.00750
Sonnet 5 $0.00300 $0.00300
Haiku 4.5 $0.00150 $0.00150

Measured 3d ago against content hash 45ddd5684285, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

openspec-playwright CLAUDE.md scanned grade C with 1 finding 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- Periodically regenerate lockfile: `rm -rf node_modules package-lock.json && npm install`
CLAUDE.md · 122 lines

How it starts

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

openspec-playwright

Setup tool for OpenSpec + Playwright E2E integration.

Project Structure

  • src/commands/init.tsopenspec-pw init setup logic
  • src/commands/doctor.tsopenspec-pw doctor prerequisites checker
  • .claude/skills/openspec-e2e/SKILL.md — Claude Code skill for /opsx:e2e
  • .claude/commands/opsx/e2e.md — Claude Code command
  • templates/seed.spec.ts — Playwright seed test template
  • templates/auth.setup.ts — Authentication setup (API + UI login)
  • templates/credentials.yaml — Test credentials configuration

Key Files

  • package.json — ESM module, Node >= 20
  • src/index.ts — CLI entry with commander

Build & Test

npm run build
npm run test:run          # all tests (requires build first)
npm run test:smoke        # build + smoke tests only
npm run lint              # ESLint
npm run typecheck         # TypeScript type-check

CI / Release

  • CI runs on every push to main and every PR — lint, typecheck, build, tests
  • Release runs on tag push (v*) — verify job must pass before publish job runs
  • Always merge to main via PR so CI gates the code before it reaches main
  • Version lock: Only publish the exact version explicitly requested by the user. Never bump package.json, create a new tag, or run npm version patch/minor/major unless the user has named that target version.
  • If the requested version already exists in npm or the release job fails on publish, do not invent a new version number on your own. Stop and report the blocker unless the user explicitly approves a new version.

Code × Docs Sync Rule

改这些文件时,必须同步更新文档:

修改了 必须更新
src/commands/*.tssrc/index.ts README.md(CLI树)、CHANGELOG.md
.claude/skills/openspec-e2e/SKILL.md README.md(架构图)、CHANGELOG.md
templates/* README.md(如涉及路径)、CHANGELOG.md
任何 CLI 逻辑变更 README.md(CLI说明)、CHANGELOG.md

规则:文档更新和代码变更在同一个 commit 里,不要单独拆出来。

Release Checklist

Before each release action, confirm the target version has already been explicitly chosen by the user and the local package.json/tag match it:

Read the full file on GitHub · 122 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. 3d ago First seen · 122 lines · 1,500 tokens per session scan C 45ddd5684285

Subscribe to this mod's changes

openspec-playwright CLAUDE.md is an instructions file published in the GitHub repository wxhou/openspec-playwright (10 stars, last pushed 6d ago), licensed MIT. It adds 1,500 tokens to every session, about $0.0075 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.