agentleFS
vlad-ryzhkovvlad-ryzhkov/ai-context-engineering-for-frontend/.claude/skills/browser-check/SKILL.md

browser-check

Skill2 starsChanged 8 months agoUnlicenseView on GitHub

AI self-verification of running UI via agent-browser CLI — live snapshot and optional interaction flow. Use for ad-hoc visual checks of a running dev server without writing test files. Do not use when persistent Playwright spec files are needed — use /e2e-tests instead.

  • Installs packages

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 6 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If url not provided → use http://localhost:5173

    line 50
  2. Very specific:

    If url provided without protocol (http:// or https://) → prepend http://

    line 51
  3. Very specific:

    If url provided with protocol → use as-is

    line 52
  4. Distinctive:

    If command fails (exit code ≠ 0) → STOP.

    line 60
  5. Distinctive:

    If fails (connection refused, page load error) → STOP.

    line 69
  6. Very specific:

    CRITICAL BASH RULE: Always wrap fill text inputs in single quotes ('...') to prevent bash variable expansion and injection of special …

    line 88
  7. Distinctive:

    After each step: take a new snapshot to confirm the result.

    line 99
  8. Very specific:

    Race Condition Guard: If the snapshot shows loading indicators (text containing "loading", "spinner", skeleton placeholders, or disabled …

    line 101
  9. Very specific:

    If expected element absent after snapshot: re-run snapshot -i up to 2 times (run sleep 2 between retries).

    line 106
  10. Very specific:

    If same step fails 3 times → abort.

    line 108
  11. Very specific:

    Loop Guard: If the same step fails 3 times → abort the entire flow.

    line 110
  12. Very specific:

    Use ONLY when text/visibility assertions are impossible.

    line 123
  13. Very specific:

    Run Gardener Analysis per .claude/protocols/gardener.md via silent tool calls.

    line 132
  14. Distinctive:

    Do NOT output Gardener text to chat.

    line 133
  15. Very specific:

    If same step fails 3 times → abort flow.

    line 139
  16. Very specific:

    Do not use snapshot (full DOM) instead of snapshot -i — wastes tokens

    line 143
  17. Distinctive:

    Do not interact with elements behind a loading overlay — wait and re-snapshot first

    line 144
  18. Distinctive:

    No file artifacts written — output is chat-only

    line 184
  19. Very specific:

    Default URL matches Vite dev server (same as /e2e-tests)

    line 185

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: /browser-check

Purpose

AI self-verification of running UI via agent-browser CLI. Fast, ad-hoc snapshot + optional interaction flow — no file artifacts written.

Different from /e2e-tests: e2e-tests generates persistent .spec.ts test files. /browser-check is ephemeral: live snapshot → chat-only pass/fail report.


Verbosity Protocol

SILENT MODE: No intermediate chat output. Tool calls first, analysis after. Output to chat: SKILL COMPLETE block only.


Input

/browser-check [url?] [flow-description?]
ParamRequiredDefaultExample
urlNohttp://localhost:5173http://localhost:3000
flow-descriptionNo(snapshot only)"fill login form and submit"

Allowed Tools

Bash(npx *agent-browser*) only. No file writes during this skill.


Workflow

Step 1 — Validate

  • If url not provided → use http://localhost:5173
  • If url provided without protocol (http:// or https://) → prepend http://
  • If url provided with protocol → use as-is

Step 2 — Check agent-browser is available

npx --yes agent-browser --version

If command fails (exit code ≠ 0) → STOP. Output ⚠️ SKILL PARTIAL: Blockers: "agent-browser not found. Install: npm install -g @vercel-labs/agent-browser"

Step 3 — Open URL

npx --yes agent-browser open <url>

If fails (connection refused, page load error) → STOP. Output ⚠️ SKILL PARTIAL: Blockers: "Could not open <url> — dev server may not be running"

Step 4 — Snapshot

npx --yes agent-browser snapshot -i

Parse output:

  • Count interactive elements (@eN refs)
  • Note page title / h1

Step 5 — Execute flow (if flow-description provided)

Translate the natural-language flow into sequential agent-browser commands using refs from Step 4. See references/commands.md for command syntax.

CRITICAL BASH RULE: Always wrap fill text inputs in single quotes ('...') to prevent bash variable expansion and injection of special characters ($, !, `, ").

Examples:

npx --yes agent-browser fill @e1 'user@example.com'
npx --yes agent-browser fill @e2 'P@ssw$rd!'
npx --yes agent-browser click @e3

After each step: take a new snapshot to confirm the result.

Race Condition Guard: If the snapshot shows loading indicators (text containing "loading", "spinner", skeleton placeholders, or disabled submit buttons), wait (sleep 2) and re-snapshot before attempting the next interaction. Do not interact with elements that are behind a loading overlay.

If expected element absent after snapshot: re-run snapshot -i up to 2 times (run sleep 2 between retries). If still absent after 2 retries → mark step as failed. If same step fails 3 times → abort. Output ⚠️ SKILL PARTIAL with LOOP_GUARD blocker.

Loop Guard: If the same step fails 3 times → abort the entire flow. Output ⚠️ SKILL PARTIAL: Blockers: "LOOP_GUARD: step [description] failed 3× — [last error]"

Step 6 — Assert outcome

Based on flow or snapshot-only:

npx --yes agent-browser get text @eN
npx --yes agent-browser is visible @eN

⚠️ screenshot — LAST RESORT only. Outputs raw base64 (100k+ tokens). Use ONLY when text/visibility assertions are impossible. Prefer is visible + get text.

Determine PASS / FAIL:

  • PASS: Expected elements visible, no error state detected
  • FAIL: Error message visible, expected element missing, or command failed

Step 7 — Gardener

Run Gardener Analysis per .claude/protocols/gardener.md via silent tool calls. Do NOT output Gardener text to chat. SKILL COMPLETE block must be the only chat output.


Anti-Patterns

  • If same step fails 3 times → abort flow. Output ⚠️ SKILL PARTIAL with Blockers: "LOOP_GUARD: [step] failed 3× — [error]"
  • BANNED: Re-using @eN refs after ANY navigation or click that triggers route change — ALWAYS re-snapshot first. The DOM mutates, invalidating old refs.
  • BANNED: Using double quotes "..." for fill inputs containing special characters ($, !, `). Use single quotes '...' to prevent bash expansion.
  • BANNED: Running npx without --yes flag — causes interactive prompt hang in non-TTY environments.
  • Do not use snapshot (full DOM) instead of snapshot -i — wastes tokens
  • Do not interact with elements behind a loading overlay — wait and re-snapshot first

Quality Gate

  • URL was reachable (no connection error)
  • Snapshot returned ≥1 interactive element
  • All flow steps executed without LOOP_GUARD trigger
  • PASS/FAIL determination is explicit

Output Format

✅ SKILL COMPLETE: /browser-check
├─ URL: [url checked]
├─ Flow: [flow-description | "snapshot only"]
├─ Snapshot: [N interactive elements]
├─ Steps: [N/N passed]
└─ Result: [PASS | FAIL]

On failure:

⚠️ SKILL PARTIAL: /browser-check
├─ URL: [url]
├─ Flow: [flow-description | "snapshot only"]
├─ Snapshot: [N interactive elements | "failed"]
├─ Steps: [N/N passed]
└─ Blockers: [what failed and why]

Notes

  • Framework-agnostic: works for React and Vue projects
  • No file artifacts written — output is chat-only
  • Default URL matches Vite dev server (same as /e2e-tests)
  • snapshot -i only — preserves token economy (93% fewer tokens vs raw DOM)
  • Dev server must be running before invoking this skill

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.