/soleur:test-browserfrom soleur
Runs end-to-end browser tests on pages affected by a PR using agent-browser CLI to map changed files to routes and capture screenshots. Intended as a post-ship smoke test for page reachability and console errors.
Ships in soleur. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Cloud Mode (Devin): before pipeline work run bash "${CLAUDE_PLUGIN_ROOT}/scripts/cloud-detect.sh". If CLAUDE_PLUGIN_ROOT is unset (cloud exec shells do not export it), resolve the root by IDENTITY, never by script basename: for d in "$HOME/.local/share/devin/cli/plugins/cache" and /opt/.devin/plugins, skip unless [ -d "$d" ], then MANIFEST="$(find "$d" -path '*/.claude-plugin/plugin.json' -exec grep -l '"name"[[:space:]]*:[[:space:]]*"soleur"' {} + 2>/dev/null | head -1)", ROOT="${MANIFEST%/.claude-plugin/plugin.json}" — one resolution, two consumers: $ROOT/scripts/cloud-detect.sh and $ROOT/scripts/precommit-guard.sh. (Shape check, not authentication: a planted {"name":"soleur"} dir passes — ADR-179 A11.) local or not-local:no-devin-env proceeds normally; any other not-local:<reason> applies <plugin-root>/devin/INSTRUCTIONS.md §Cloud Mode: emit the --banner, fan out sequentially with Reviewed-Coverage: sequential-fallback disclosure (never claim an independent review ran), message_user ack before any secrets read or production mutation, and run precommit-guard.sh before any git commit — hooks do not fire in cloud.
Grok Build (plugins/soleur/lib/harness.ts invokeSkill()): Read this SKILL.md in this process and run it to completion. A one-segment soleur:<name> in this document names a SKILL — on Grok Build, Read plugins/soleur/skills/<name>/SKILL.md in this process; it is not a nested tool_use. A multi-segment id such as soleur:<domain>:<name> names an AGENT: spawn it, never Read it, and on Grok Build spawn_subagent takes the id with its colons replaced by hyphens (agentIdToGrokSubagentType). Claude Code: Skill tool for a skill (soleur:<name>), Task tool with subagent_type for an agent. Forbidden is executing a subset, not the Read.
<command_purpose>Run end-to-end browser tests on pages affected by a PR or branch changes using agent-browser CLI.</command_purpose>
Positioning (ADR-049, #4834): for structural-UI diffs (nav/rail/dashboard shell), the pre-merge visual check is now the committed, CI-blocking
nav-states-*.e2e.tsgate run bysoleur:qaStep 2.6 — not this skill. Runningtest-browseronly after ship is the deferral trap that let the #4810 layout bugs reach prod. Treat this skill as a post-ship smoke (broad page reachability + console-error sweep) that complements, never replaces, the pre-mergesoleur:qagate.
DO NOT use Chrome MCP tools (mcp__claude-in-chrome__*).
This skill uses the agent-browser CLI exclusively. The agent-browser CLI is a Bash-based tool from Vercel that runs headless Chromium. It is NOT the same as Chrome browser automation via MCP.
If calling mcp__claude-in-chrome__* tools, STOP. Use agent-browser Bash commands instead.
QA Engineer specializing in browser-based end-to-end testing
This skill tests affected pages in a real browser, catching issues that unit tests miss:
Check installation:
command -v agent-browser >/dev/null 2>&1 && echo "Installed" || echo "NOT INSTALLED"
Install if needed:
npm install --prefix ~/.local -g [email protected]
agent-browser install # Downloads Chrome for Testing (~300MB)
On Linux (Ubuntu 23.10+, containers, VMs), export the no-sandbox launch flag
before the first command — otherwise Chrome cannot launch and open hangs:
export AGENT_BROWSER_ARGS="--no-sandbox"
See the agent-browser skill for detailed usage and the "Chrome fails to launch
/ open hangs" troubleshooting entry.
Before starting ANY browser testing, verify agent-browser is installed:
command -v agent-browser >/dev/null 2>&1 && echo "Ready" || (echo "Installing..." && npm install --prefix ~/.local -g [email protected] && agent-browser install)
If installation fails, inform the user and stop.
<ask_browser_mode>
Before starting tests, ask the user if they want to watch the browser:
Use AskUserQuestion with:
Store the choice and use --headed flag when user selects "Headed".
</ask_browser_mode>
<test_target> $ARGUMENTS </test_target>
<determine_scope>
If PR number provided:
gh pr view [number] --json files -q '.files[].path'
If 'current' or empty:
git diff --name-only main...HEAD
If branch name provided:
git diff --name-only main...[branch]
</determine_scope>
<file_to_route_mapping>
Repo feature map first. When the repository carries a maintained feature
map — convention: docs/feature-map.md (soleur's own lives at
apps/web-platform/test/feature-map.md; the entry schema and update contract
are in feature-map.md) — its route entries are
the navigation source of truth: each ## \/route`` section names stable
selectors, the user-POV expected outcome, auth/fixture needs, and gotchas.
Prefer it over inferring routes from file paths; the generic table below is
the fallback for repos without a map AND for routes a partial map does not
cover — a map is authoritative per-route, never a reason to skip testing an
unmapped route.
Map changed files to testable routes:
| File Pattern | Route(s) |
|---|---|
app/views/users/* | /users, /users/:id, /users/new |
app/controllers/settings_controller.rb | /settings |
app/javascript/controllers/*_controller.js | Pages using that Stimulus controller |
app/components/*_component.rb | Pages rendering that component |
app/views/layouts/* | All pages (test homepage at minimum) |
app/assets/stylesheets/* | Visual regression on key pages |
app/helpers/*_helper.rb | Pages using that helper |
src/app/* (Next.js) | Corresponding routes |
src/components/* | Pages using those components |
Build a list of URLs to test based on the mapping.
</file_to_route_mapping>
<check_server>
Before testing, verify the local server is accessible:
The redactor is reached through ${CLAUDE_PLUGIN_ROOT}. An ambient value pointing at a
directory that is not a Soleur install would resolve to a path that does not exist — or, worse,
to one an attacker chose. Verify plugin IDENTITY and halt if it does not hold (ADR-179 decision 2);
a test -f on the script alone is a shape check and was measured bypassable.
[ -f "${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json" ] \
&& grep -q '"name"[[:space:]]*:[[:space:]]*"soleur"' "${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json" \
|| { echo "SOLEUR_SNAPSHOT_HALT reason=plugin-root-unverified root=[${CLAUDE_PLUGIN_ROOT}]" >&2
echo " Cannot locate the snapshot redactor, so no accessibility snapshot may be taken here." >&2
echo " Root EMPTY: no Soleur plugin is loaded in this session. Install it and start a NEW session." >&2
echo " Root set but wrong: a repo checkout is not an install. Run 'claude plugin update soleur@soleur-marketplace' (or the id 'claude plugin list' prints, if you added the repository directly), then RESTART Claude Code." >&2
echo " Nothing has been captured yet, so nothing has leaked." >&2
exit 2; }
agent-browser open http://localhost:3000
agent-browser snapshot -i 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py"
If server is not running, inform user:
**Server not running**
Please start the development server:
- Rails: `bin/dev` or `rails server`
- Node/Next.js: `npm run dev`
Then run `soleur:test-browser` again.
</check_server>
<test_pages>
For each affected route, use agent-browser CLI commands (NOT Chrome MCP):
Step 1: Navigate and capture snapshot
agent-browser open "http://localhost:3000/[route]"
agent-browser snapshot -i 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py"
Step 2: For headed mode (visual debugging)
agent-browser --headed open "http://localhost:3000/[route]"
agent-browser --headed snapshot -i 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py"
Step 3: Verify key elements
agent-browser snapshot -i 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py" to get interactive elements with refsCredential safety (#7947). An accessibility snapshot serializes the value
of input fields, including a value the agent never typed (a password manager's
autofill, a static value=, a generated-credential panel). On any page carrying
a password or credential field, route the snapshot through the redactor —
agent-browser snapshot -i 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py"
— and never capture a page that is displaying a credential value: a screenshot
is safe for a type=password field but not for a readonly type=text
credential panel, which renders in clear. Full rule and its measured ceiling:
plugins/soleur/skills/agent-browser/SKILL.md §"Credential safety on a login or
credential page".
Step 4: Test critical interactions
agent-browser click @e1 # Use ref from snapshot 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py"
agent-browser snapshot -i 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py"
Step 5: Take screenshots
agent-browser screenshot page-name.png
agent-browser screenshot --full page-name-full.png # Full page
</test_pages>
After all affected routes are tested, maintain the repository's feature map —
docs/feature-map.md by convention (soleur's own lives at
apps/web-platform/test/feature-map.md); see
feature-map.md for the schema and update
contract:
docs/feature-map.md seeded with the exercised routes only — real
observed selectors, expects, and gotchas, the update-contract
header, and a ## Deliberately unmapped section (empty is fine). Do not
enumerate unvisited routes as entries.## \/route`` entries for exercised routes that were missing; leave every
untouched entry and the header byte-identical (operator annotations
survive).The map is a working-tree edit that lands with the feature's PR — same change, per the update contract.
Report: the Step 8 test summary names the map action taken — written,
refreshed, or skipped + one-word reason (non-web, no-routes) — so a
silently-absent map is never mistaken for a maintained one.
<human_verification>
Pause for human input when testing touches:
| Flow Type | What to Ask |
|---|---|
| OAuth | "Please sign in with [provider] and confirm it works" |
| "Check inbox for the test email and confirm receipt" | |
| Payments | "Complete a test purchase in sandbox mode" |
| SMS | "Verify the SMS code was received" |
| External APIs | "Confirm the [service] integration is working" |
Use AskUserQuestion:
**Human Verification Needed**
This test touches the [flow type]. Please:
1. [Action to take]
2. [What to verify]
Did it work correctly?
1. Yes - continue testing
2. No - describe the issue
</human_verification>
<failure_handling>
When a test fails:
Document the failure:
agent-browser screenshot error.pngAsk user how to proceed:
**Test Failed: [route]**
Issue: [description]
Console errors: [if any]
How to proceed?
1. Fix now - help debug and fix
2. Create todo - Add to todos/ for later
3. Skip - Continue testing other pages
If "Fix now":
If "Create todo":
{id}-pending-p1-browser-test-{description}.mdIf "Skip":
</failure_handling>
<test_summary>
After all tests complete, present summary:
## Browser Test Results
**Test Scope:** PR #[number] / [branch name]
**Server:** http://localhost:3000
**Feature map:** [written | refreshed | skipped: <reason>]
### Pages Tested: [count]
| Route | Status | Notes |
|-------|--------|-------|
| `/users` | Pass | |
| `/settings` | Pass | |
| `/dashboard` | Fail | Console error: [msg] |
| `/checkout` | Skip | Requires payment credentials |
### Console Errors: [count]
- [List any errors found]
### Human Verifications: [count]
- OAuth flow: Confirmed
- Email delivery: Confirmed
### Failures: [count]
- `/dashboard` - [issue description]
### Created Todos: [count]
- `005-pending-p1-browser-test-dashboard-error.md`
### Result: [PASS / FAIL / PARTIAL]
</test_summary>
Playwright MCP writes screenshots to the main repo root when invoked from a worktree, so clean both locations. If any test failures were recorded with error.png, upload or review those screenshots before running cleanup.
# Remove session screenshots from current working directory
rm -f *.png
# If in a worktree, also clean the main repo root
MAIN_REPO=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
if [[ -n "$MAIN_REPO" ]]; then
rm -f "$MAIN_REPO"/*.png
fi
Do NOT delete files under plugins/soleur/docs/ -- those are legitimate assets.
# Test current branch changes
soleur:test-browser
# Test specific PR
soleur:test-browser 847
# Test specific branch
soleur:test-browser feature/new-dashboard
ALWAYS use these Bash commands. NEVER use mcp__claude-in-chrome__ tools.*
# Navigation
agent-browser open <url> # Navigate to URL
agent-browser back # Go back
agent-browser close # Close browser
# Snapshots (get element refs)
agent-browser snapshot -i 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py" # Interactive elements with refs (@e1, @e2, etc.)
agent-browser snapshot -i --json 2>&1 | python3 "${CLAUDE_PLUGIN_ROOT}/skills/agent-browser/scripts/redact-a11y-snapshot.py" # JSON output
# Interactions (use refs from snapshot)
agent-browser click @e1 # Click element
agent-browser fill @e1 "text" # Fill input
agent-browser type @e1 "text" # Type without clearing
agent-browser press Enter # Press key
# Screenshots
agent-browser screenshot out.png # Viewport screenshot
agent-browser screenshot --full out.png # Full page screenshot
# Headed mode (visible browser)
agent-browser --headed open <url> # Open with visible browser
agent-browser --headed click @e1 # Click in visible browser
# Wait
agent-browser wait @e1 # Wait for element
agent-browser wait 2000 # Wait milliseconds
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jikig-ai/soleur --plugin soleur108 skills in this plugin
/admin-ip-refreshThis skill should be used to refresh the prod SSH allowlist (Doppler ADMIN_IPS) after operator IP rotation. Detects drift, mutates Doppler with explicit ack./agent-browserThis skill should be used when automating browser interactions via Vercel's agent-browser CLI. It handles web page navigation, form filling, screenshots, and data scraping using ref-based element selection./agent-native-architectureThis skill should be used when designing agent-native applications where agents are first-class citizens: architecting autonomous agents, creating MCP tools, building apps where features are agent-driven outcomes./agent-native-auditThis skill should be used when conducting a scored agent-native architecture review. It launches 8 parallel sub-agents to audit action parity, context injection, CRUD completeness, capability discovery, and prompt-native features./andrew-kane-gem-writerThis skill should be used when writing Ruby gems following Andrew Kane's patterns. It applies when creating new gems, refactoring existing gems, or designing gem APIs with clean, minimal, production-ready code./architectureThis skill should be used when managing Architecture Decision Records or C4 diagrams.Other plugins' skills for the same job