browser-test

browser-test is a skill for Claude Code, Codex from alexjbarnes/cockpit. It costs 0 tokens per session (1,781 once invoked), scanned C, original, Apache-2.0.

A workflow for checking cockpit frontend changes in a real browser with Playwright, including screenshots and mobile viewport checks.

In plain words
What is it for?
Visually verifying interface changes, reproducing layout bugs, testing mobile rendering, and capturing pages or dialogs.
Why use it?
It uses an isolated development server and handles cockpit’s caching and configuration details, making visual checks reflect the current code.

Skill for Claude CodeCodex

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 skills/alexjbarnes/cockpit/browser-test
Any agent
npx skills add alexjbarnes/cockpit --skill browser-test
Clone the repo
git clone --depth 1 https://github.com/alexjbarnes/cockpit

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 browser-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexjbarnes/cockpit/browser-test.svg)](https://agentmods.dev/skills/alexjbarnes/cockpit/browser-test)
Your own site
<a href="https://agentmods.dev/skills/alexjbarnes/cockpit/browser-test"><img src="https://agentmods.dev/badge/skills/alexjbarnes/cockpit/browser-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,781 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. 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.1 $0.00000 $0.01781
Opus 5 $0.00000 $0.00890
Sonnet 5 $0.00000 $0.00356
Haiku 4.5 $0.00000 $0.00178

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

Security

Grade C, and why

browser-test scanned grade C with 2 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 5d 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.

rm -rf /tmp/cockpit-verify && mkdir -p /tmp/cockpit-verify

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Foreground `sleep` is blocked in this environment; poll readiness with `curl --retry`.
.claude/skills/browser-test/SKILL.md · 107 lines

How it starts

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

Browser-test a cockpit UI change with Playwright

Run an isolated cockpit dev server and drive it with the Playwright MCP. Use this over the generic run/verify skills: cockpit has three caches that will serve you stale code and burn a lot of time if you don't handle them up front.

When to use

  • Visually confirm a UI / layout / CSS change renders correctly.
  • Reproduce a rendering bug, especially on mobile.
  • Screenshot a page or dialog at a given viewport.

1. Start an isolated dev server

Never test against the live instance (port 3001, runs from a packaged tarball). Spin up your own on a spare port with a throwaway config dir.

Three things bite you, all handled below:

  • The shell exports NODE_ENV=production, so plain tsx server.ts runs Next in production mode (serves the prebuilt .next, ignores your source). Force NODE_ENV=development.
  • A separate COCKPIT_CONFIG_DIR keeps the test server off ~/.cockpit — no job-scheduler or lock collisions, and a fresh auth state.
  • Foreground sleep is blocked in this environment; poll readiness with curl --retry.
rm -rf /tmp/cockpit-verify && mkdir -p /tmp/cockpit-verify
cd /home/dev/repos/cockpit
NODE_ENV=development COCKPIT_CONFIG_DIR=/tmp/cockpit-verify PORT=3010 \
  nohup npx tsx server.ts > /tmp/cockpit-verify.log 2>&1 &
curl -s -o /dev/null -w "%{http_code}" --retry 120 --retry-delay 1 \
  --retry-all-errors --retry-connrefused --max-time 12 http://localhost:3010/login

First load compiles on demand (~10-30s); the retry covers it. If it never returns 200, read /tmp/cockpit-verify.log.

2. Authenticate

A fresh config has no password, so /login renders the setup screen. Set one and you get a valid signed session cookie.

The COCKPIT_TOKEN bypass alone does NOT work: validateSession returns false when no password is stored, before it checks the token. Set a password.

Load the Playwright tools first: ToolSearchselect:mcp__playwright__browser_navigate,mcp__playwright__browser_resize,mcp__playwright__browser_evaluate,mcp__playwright__browser_take_screenshot

Read the full file on GitHub · 107 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. 5d ago First seen · 107 lines · 0 tokens per session scan C 139cdb8ffb27

Subscribe to this mod's changes

browser-test is a skill published in the GitHub repository alexjbarnes/cockpit (14 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,781 tokens. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.