playwright-tab-comparison
Open multiple browser tabs and compare content, behavior, or visual appearance across pages. Use when comparing staging vs production, A/B testing page variants, testing cross-browser consistency, verifying content parity, or analyzing differences between multiple URLs. Trigger phrases include "compare these pages", "open multiple tabs and compare", "test consistency across", "A/B test", "staging vs production", or "compare versions". Works with Playwright MCP browser automation tools for multi-tab workflows.
What this skill does
# Playwright Tab Comparison
Open multiple browser tabs and systematically compare content, behavior, or visual appearance across pages.
## Quick Start
```
User: "Compare the staging and production checkout pages"
Workflow:
1. Create/list tabs
2. Navigate tab 1 to staging URL
3. Navigate tab 2 to production URL
4. For each tab: capture snapshot + screenshot + extract data
5. Generate comparison report
```
## When to Use This Skill
**Explicit triggers:**
- "Compare these pages"
- "Open multiple tabs and compare"
- "Test cross-browser consistency"
- "A/B test these variants"
- "Compare staging vs production"
**Implicit triggers:**
- User provides multiple URLs to analyze
- Testing consistency across environments
- Verifying content parity
- Evaluating page variants
**Use cases:**
- A/B testing different landing page designs
- Comparing staging vs production environments
- Cross-browser consistency validation
- Multi-variant feature testing
- Content parity verification
- Performance comparison
## Core Workflow
### Step 1: Tab Setup
**List existing tabs:**
```python
browser_tabs(action="list")
```
**Create additional tabs:**
```python
# Create new tab
browser_tabs(action="new")
# Switch to specific tab (0-indexed)
browser_tabs(action="select", index=1)
```
### Step 2: Navigate Each Tab
Navigate each tab to its target URL:
```python
# Tab 1: Production
browser_tabs(action="select", index=0)
browser_navigate(url="https://example.com/checkout")
# Tab 2: Staging
browser_tabs(action="select", index=1)
browser_navigate(url="https://staging.example.com/checkout")
# Tab 3: Variant A
browser_tabs(action="select", index=2)
browser_navigate(url="https://example.com/checkout?variant=a")
```
### Step 3: Capture Data from Each Tab
For each tab, collect comparison data:
**a) Capture accessibility snapshot:**
```python
browser_snapshot(filename="tab1-snapshot.md")
```
**b) Take screenshot:**
```python
browser_take_screenshot(filename="tab1-screenshot.png", fullPage=True)
```
**c) Extract structured data:**
```python
browser_evaluate(function="""
() => {
return {
title: document.title,
url: window.location.href,
headingCount: document.querySelectorAll('h1, h2, h3').length,
buttonCount: document.querySelectorAll('button').length,
formCount: document.querySelectorAll('form').length,
// Custom extraction logic
productPrice: document.querySelector('.price')?.textContent,
ctaText: document.querySelector('.cta-button')?.textContent
};
}
""")
```
**d) Capture network activity (optional):**
```python
browser_network_requests()
```
### Step 4: Structure Tab Data
Organize captured data into JSON for comparison:
```json
[
{
"tab_index": 0,
"url": "https://example.com/checkout",
"snapshot": "tab1-snapshot.md",
"screenshot": "tab1-screenshot.png",
"data": {
"title": "Checkout - Example",
"headingCount": 5,
"productPrice": "$49.99"
},
"timestamp": "2025-12-20T10:30:00Z"
},
{
"tab_index": 1,
"url": "https://staging.example.com/checkout",
"snapshot": "tab2-snapshot.md",
"screenshot": "tab2-screenshot.png",
"data": {
"title": "Checkout - Staging",
"headingCount": 6,
"productPrice": "$49.99"
},
"timestamp": "2025-12-20T10:30:15Z"
}
]
```
Save to `tab-data.json`.
### Step 5: Compare Results
**Option A: Use comparison script**
```bash
python scripts/compare_tabs.py tab-data.json
```
Outputs:
- Text summary of differences
- JSON comparison file
**Option B: Manual comparison**
Compare key metrics:
- Element counts (headings, buttons, forms)
- Extracted data values (prices, CTA text)
- Visual appearance (review screenshots side-by-side)
- Network patterns (request counts, API endpoints)
### Step 6: Generate Report
Create HTML report with side-by-side comparison:
```bash
python scripts/generate_comparison_report.py tab-data.json comparison-report.html
```
Open `comparison-report.html` in browser to view:
- Screenshots side-by-side
- Extracted data comparison
- Element count statistics
## Comparison Strategies
Choose strategy based on what you're testing:
**Visual Comparison** - Screenshots for design consistency
**Content Comparison** - Snapshots for structure/content parity
**Behavioral Comparison** - Network requests for functionality testing
**Performance Comparison** - Network timing for optimization
**Data Extraction Comparison** - Evaluate for structured data validation
See [references/comparison-strategies.md](references/comparison-strategies.md) for detailed guidance.
## Example: Staging vs Production
```python
# 1. Setup tabs
browser_tabs(action="list") # Check existing
browser_tabs(action="new") # Create second tab
# 2. Navigate tabs
browser_tabs(action="select", index=0)
browser_navigate(url="https://example.com/products")
browser_tabs(action="select", index=1)
browser_navigate(url="https://staging.example.com/products")
# 3. Collect data from both tabs
tabs_data = []
for i in [0, 1]:
browser_tabs(action="select", index=i)
# Snapshot
browser_snapshot(filename=f"tab{i}-snapshot.md")
# Screenshot
browser_take_screenshot(filename=f"tab{i}-screenshot.png", fullPage=True)
# Extract data
result = browser_evaluate(function="""
() => ({
url: window.location.href,
productCount: document.querySelectorAll('.product-card').length,
categories: Array.from(document.querySelectorAll('.category')).map(c => c.textContent)
})
""")
tabs_data.append({
"tab_index": i,
"snapshot": f"tab{i}-snapshot.md",
"screenshot": f"tab{i}-screenshot.png",
"data": result
})
# Save for comparison
import json
with open('tab-data.json', 'w') as f:
json.dump(tabs_data, f, indent=2)
# 4. Generate report
# Run: python scripts/generate_comparison_report.py tab-data.json report.html
```
## Resources
### scripts/
**compare_tabs.py** - Analyzes tab data and generates comparison summary
- Input: `tab-data.json` (structured tab data)
- Output: Text summary + JSON comparison file
- Compares element counts, identifies differences
**generate_comparison_report.py** - Creates HTML visual comparison report
- Input: `tab-data.json` + `assets/report-template.html`
- Output: HTML file with side-by-side screenshots and data
- Embeds screenshots as base64
### references/
**mcp-playwright-tools.md** - Quick reference for Playwright MCP tools used in this workflow (browser_tabs, browser_navigate, browser_snapshot, browser_evaluate, browser_take_screenshot)
**comparison-strategies.md** - Detailed guide for choosing comparison approach (visual, content, behavioral, performance, data extraction, hybrid)
### assets/
**report-template.html** - HTML template for comparison reports with responsive grid layout and embedded styling
## Expected Outcomes
**Successful comparison:**
- Multiple tabs opened and navigated
- Data captured from each tab (snapshots, screenshots, extracted data)
- Differences identified and documented
- HTML report generated showing side-by-side comparison
**Common differences to identify:**
- Element count variations
- Content changes (text, prices, CTAs)
- Visual appearance differences
- Network request patterns
- Performance metrics
## Requirements
**Tools:**
- Playwright MCP browser automation
- Python 3.x for scripts
- Browser with tab support
**Data structure:**
- tab-data.json with consistent schema
- Screenshots saved to accessible paths
- Snapshots saved as markdown files
## Red Flags to Avoid
- Opening too many tabs (>5) without cleanup
- Not waiting for page load before capturing data
- Inconsistent viewport sizes across tabs (affects visual comparison)
- Not saving tab data before closing tabs
- Forgetting to switch tabs before navigation/capture
- Comparing pages in difRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.