audit

A command that runs Playwright browser tests, a tool for checking websites through real browser actions, and investigates each failure using its recorded trace.

In plain words
What is it for?
Use it to run an end-to-end test suite, report passing results, inspect failed test traces, classify root causes, and optionally prepare fixes.
Why use it?
It brings the error message, source location, browser recording, and screenshot together so you can identify the underlying cause instead of only seeing that a test failed.

Command

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 commands/alphabravo-oss/guild/audit
Clone the repo
git clone --depth 1 https://github.com/alphabravo-oss/guild
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,038 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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 $0.00017 $0.01038
Opus 5 $0.00009 $0.00519
Sonnet 5 $0.00003 $0.00208
Haiku 4.5 $0.00002 $0.00104

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

Security

Grade A, and why

audit 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 2d 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.

plugins/e2e/commands/audit.md · 93 lines

How it starts

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

The user wants you to run the test suite and triage failures. Optional --fix flag in $ARGUMENTS means propose patches (do not auto-apply).

Preflight

  1. playwright.config.ts exists.
  2. Read ${CLAUDE_PLUGIN_ROOT}/skills/diagnose/SKILL.md (or invoke the diagnose skill) — it has the trace-reading methodology and failure taxonomy.

Run the suite

npx playwright test --reporter=json

Capture stdout to a temp file (the JSON is large). Parse it. Don't pipe directly into Read — it'll be unwieldy. Write to /tmp/e2e-audit-$$.json then read.

If all tests pass: report counts and exit. No triage needed.

Triage each failure

For each failed test, gather:

  1. Failure message — from the JSON errors[] array
  2. Stack — first frame in user code (skip Playwright internals)
  3. Trace — at test-results/<test-folder>/trace.zip. Get its summary via:
    unzip -p test-results/<folder>/trace.zip trace.trace | head -200
    
    Or, if the trace structure makes that unwieldy, invoke MCP and open the HTML report:
    npx playwright show-report
    
    and use browser_navigate to the failed test's page in the report.
  4. Screenshottest-results/<folder>/test-failed-1.png if present

Classify by root cause

Use this taxonomy (mirrored from the diagnose skill — keep them in sync):

Class Signature Fix direction
SELECTOR_DRIFT "locator resolved to N elements" or "not found" + DOM snapshot in trace shows the element with different text/role Re-snapshot, update locator. Prefer getByRole/getByLabel over text matches when DOM is volatile.
TIMING "Timeout exceeded" but element does eventually appear in later snapshot Replace brittle wait with expect(locator).toBeVisible({ timeout }). Increase timeout only after confirming the load is legitimately slow.
ASSERTION_MISMATCH Assertion failed but page rendered normally Either the test's expectation is wrong (product changed intentionally) or the product regressed. Surface both possibilities — don't auto-decide.
CONSOLE_ERROR Test caught a console.error that wasn't there before Real product bug. Capture the error text and stack frame from the page. Don't suppress in the test.
NETWORK_FAIL Failed request in trace network panel Check if the failing endpoint is the test's target or incidental. Mock incidental ones, fix or flag the target.
STATE_POLLUTION Passes alone, fails in suite. Trace shows unexpected initial state. A prior test left state. Add fixture cleanup or isolate via test.use({ storageState }).
FLAKY Passes on retry. Trace shows non-deterministic ordering. Identify the race (animation, debounce, async render). Wait for the stable state explicitly, don't sleep.

Read the full file on GitHub · 93 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. 2d ago First seen · 93 lines · 17 tokens per session scan A 93150e006d25

Subscribe to this mod's changes

audit is a command published in the GitHub repository alphabravo-oss/guild (2 stars, last pushed 2d ago), licensed MIT. It adds 17 tokens to every session and 1,038 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.