packrat-ai/packrat/test-browser
Claude Code and agent skill by packrat-ai/packrat
- community
Checking that the SKILL.md file is still in the repository.
Run browser tests on pages affected by current PR or branch
Install
npx vskill@latest install packrat-ai/packrat/test-browserSKILL.md
The same SKILL.md was published earlier as packrat-ai/packrat/test-browser.
Browser Test Command
<command_purpose>Run end-to-end browser tests on pages affected by a PR or branch changes using agent-browser CLI.</command_purpose>
CRITICAL: Use agent-browser CLI Only
DO NOT use Chrome MCP tools (mcp__claude-in-chrome__*).
This command 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 you find yourself calling mcp__claude-in-chrome__* tools, STOP. Use agent-browser Bash commands instead.
Introduction
<role>QA Engineer specializing in browser-based end-to-end testing</role>
This command tests affected pages in a real browser, catching issues that unit tests miss:
- JavaScript integration bugs
- CSS/layout regressions
- User workflow breakages
- Console errors
Prerequisites
<requirements>
- Local development server running (e.g.,
bin/dev,rails server,npm run dev) - agent-browser CLI installed (see Setup below)
- Git repository with changes to test
</requirements>
Setup
Check installation:
Install if needed:
See the agent-browser skill for detailed usage.
Main Tasks
0. Verify agent-browser Installation
Before starting ANY browser testing, verify agent-browser is installed:
If installation fails, inform the user and stop.
1. Ask Browser Mode
<ask_browser_mode>
Before starting tests, ask user if they want to watch the browser:
Use AskUserQuestion with:
- Question: "Do you want to watch the browser tests run?"
- Options:
- Headed (watch) - Opens visible browser window so you can see tests run
- Headless (faster) - Runs in background, faster but invisible
Store the choice and use --headed flag when user selects "Headed".
</ask_browser_mode>
2. Determine Test Scope
<test_target> $ARGUMENTS </test_target>
<determine_scope>
If PR number provided:
If 'current' or empty:
If branch name provided:
</determine_scope>
3. Map Files to Routes
<file_to_route_mapping>
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>
4. Detect Dev Server Port
<detect_port>
Determine the dev server port using this priority order:
Priority 1: Explicit argument If the user passed a port number (e.g., /test-browser 5000 or /test-browser --port 5000), use that port directly.
Priority 2: AGENTS.md / project instructions
Priority 3: package.json scripts
Priority 4: Environment files
Priority 5: Default fallback If none of the above yields a port, default to 3000.
Store the result in a PORT variable for use in all subsequent steps.
</detect_port>
5. Verify Server is Running
<check_server>
Before testing, verify the local server is accessible using the detected port:
If server is not running, inform user:
</check_server>
6. Test Each Affected Page
<test_pages>
For each affected route, use agent-browser CLI commands (NOT Chrome MCP):
Step 1: Navigate and capture snapshot
Step 2: For headed mode (visual debugging)
Step 3: Verify key elements
- Use
agent-browser snapshot -ito get interactive elements with refs - Page title/heading present
- Primary content rendered
- No error messages visible
- Forms have expected fields
Step 4: Test critical interactions
Step 5: Take screenshots
</test_pages>
7. Human Verification (When Required)
<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 your inbox for the test email and confirm receipt" | ||
| Payments | "Complete a test purchase in sandbox mode" | |
| SMS | "Verify you received the SMS code" | |
| External APIs | "Confirm the [service] integration is working" |
Use AskUserQuestion:
</human_verification>
8. Handle Failures
<failure_handling>
When a test fails:
- Document the failure:
- Screenshot the error state:
agent-browser screenshot error.png - Note the exact reproduction steps
- Ask user how to proceed:
```markdown Test Failed: [route]
Issue: [description] Console errors: [if any]
How to proceed?
- Fix now - I'll help debug and fix
- Create todo - Add to todos/ for later
- Skip - Continue testing other pages
```
- If "Fix now":
- Investigate the issue
- Propose a fix
- Apply fix
- Re-run the failing test
- If "Create todo":
- Create
{id}-pending-p1-browser-test-{description}.md - Continue testing
- If "Skip":
- Log as skipped
- Continue testing
</failure_handling>
9. Test Summary
<test_summary>
After all tests complete, present summary:
</test_summary>
Quick Usage Examples
agent-browser CLI Reference
ALWAYS use these Bash commands. NEVER use mcp__claude-in-chrome__* tools.
Security
- Security scanPassed, 91 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/test-browser/SKILL.md
Popularity
- Repository stars
- 36
- Repository forks
- 38
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Sep 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/packrat-ai/packrat/test-browser)