browser-devtools

Browser debugging and automation using Playwright. Use for web debugging, console monitoring, network analysis, screenshot capture, DOM inspection, and UI testing during development.

⭐6stars🔀0forks📁View on GitHub🕐Updated Nov 7, 2025⬇️4downloads

When & Why to Use This Skill

This Claude skill leverages Playwright to provide robust browser automation and debugging capabilities. It enables agents to perform end-to-end web testing, monitor real-time console logs, analyze network performance, and interact with DOM elements, making it an essential tool for developers and QA engineers to automate complex web workflows and troubleshoot front-end issues.

Use Cases

  • Automated UI Testing: Execute end-to-end test suites by simulating user actions such as clicking, form filling, and navigation to ensure web application reliability.
  • Web Performance & Health Monitoring: Analyze network requests and Core Web Vitals to identify performance bottlenecks and track site speed metrics.
  • Live Debugging & Error Tracking: Monitor browser console logs and capture screenshots of runtime errors to accelerate the identification and resolution of front-end bugs.
  • DOM Inspection & Data Extraction: Use snapshot and evaluate tools to inspect the document object model (DOM) and extract specific data or verify UI element states.
  • Visual Regression Testing: Capture full-page or element-specific screenshots to compare visual changes across different browser engines (Chromium, Firefox, WebKit).
namebrowser-devtools
descriptionBrowser debugging and automation using Playwright. Use for web debugging, console monitoring, network analysis, screenshot capture, DOM inspection, and UI testing during development.
licenseApache-2.0

Browser Devtools

Browser automation and debugging using Playwright for web development testing and analysis.

Decision tree

Here the decison tree when user want to inspect the console log, apply the same pattern for other prompt.

User task → Is URL provided?
    ├─ Yes → Detect if it reachable.
    │         ├─ Success → Implement Reconnaissance-then-action (RTA)
    |         |              1. Navigate to provided URL.
    |         |              2. Inspect console log
    |         |              3. Identify the errors
    |         |              4. Execute actions with discovered issues
    │         └─ Fails → End
    │
    └─ No → Is the development server already running?
              ├─ No → End
              │
              └─ Yes → Ask user if they want to test development server?
                        ├─ Yes →  Reconnaissance-then-action (RTA)
                        ├─ No → End

Quick Start

Install dependencies:

cd plugins/browser-devtools/skills
./scripts/install.sh

Test installation:

node dist/scripts/navigate.js --url https://example.com

Scripts

All scripts located in scripts/ (compiled to dist/scripts/):

Core Commands:

  • navigate.js - Navigate to URLs
  • screenshot.js - Capture screenshots (full page or elements)
  • snapshot.js - DOM inspection and element discovery
  • evaluate.js - Execute JavaScript in browser context
  • click.js - Element interaction
  • fill.js - Form input testing

Monitoring:

  • console.js - Console log monitoring and error tracking
  • network.js - Network request analysis and performance debugging
  • performance.js - Core Web Vitals and performance metrics

Best Practices

  • Compliance Decision tree: The decision tree must be followed strictly.
  • Wait for elements: Use appropriate wait strategies for dynamic content
  • Clean up sessions: Close sessions when done to free resources

Usage

Single Commands

# Screenshot
node dist/scripts/screenshot.js --url https://example.com --output page.png

# Performance analysis
node dist/scripts/performance.js --url https://example.com | jq '.vitals.LCP'

# Console monitoring (10 seconds)
node dist/scripts/console.js --url https://example.com --types error,warn --duration 10000

Chained Commands (reuse session)

# Start session (keep browser open)
node dist/scripts/navigate.js --url https://example.com/login --close false

# Continue with same browser
node dist/scripts/fill.js --selector "#email" --value "user@example.com" --close false
node dist/scripts/click.js --selector "button[type=submit]"

Common Debugging Patterns

# Find elements
node dist/scripts/snapshot.js --url https://example.com | jq '.elements[] | {tagName, text, selector}'

# Check for errors
node dist/scripts/console.js --url https://example.com --types error

# Monitor API calls
node dist/scripts/network.js --url https://example.com --types xhr,fetch --duration 5000

# Test forms
node dist/scripts/fill.js --url https://example.com --selector "#search" --value "query" --close false
node dist/scripts/click.js --selector "button[type=submit]"

Options

All scripts support:

  • --headless false - Show browser window (default: true)
  • --close false - Keep browser open for chaining (default: true)
  • --timeout 30000 - Timeout in milliseconds
  • --browser chromium|firefox|webkit - Browser engine (default: chromium)

Output Format

Success:

{
  "success": true,
  "url": "https://example.com",
  "title": "Example Domain",
  "sessionId": "session_1234567890_abc123",
  "timestamp": "2024-01-01T12:00:00.000Z",
  "...": "script-specific data"
}

Error:

{
  "success": false,
  "error": "Element not found: .missing-element",
  "stack": "Error: Element not found..."
}

Selectors

# CSS selectors
node dist/scripts/click.js --selector "#main .button.primary"

# XPath
node dist/scripts/click.js --selector "xpath=//button[contains(text(), 'Submit')]"

# Text selectors
node dist/scripts/click.js --selector "text=Click me"

Troubleshooting

Browser not installed: Run npm run install-browsers Element not found: Use snapshot.js first to find correct selectors Script timeout: Increase with --timeout 60000 Permission denied: Run chmod +x scripts/install.sh

Debug mode: Use --headless false to see browser actions Stale sessions: Start new session with --close true

Integration

Pre-commit testing:

node dist/scripts/navigate.js --url http://localhost:3000 && \
node dist/scripts/performance.js --url http://localhost:3000 | jq '.vitals.LCP'

Performance regression:

node dist/scripts/performance.js --url $APP_URL | jq '.vitals.LCP' | \
  awk '{print $1 < 2500 ? "PASS" : "FAIL"}'

References