con un clic
browser-automation
// Complex browser automation workflow using claude-in-chrome MCP with mandatory sequential-thinking planning. Use when automating multi-step web interactions, form filling, navigation sequences, or web scraping.
// Complex browser automation workflow using claude-in-chrome MCP with mandatory sequential-thinking planning. Use when automating multi-step web interactions, form filling, navigation sequences, or web scraping.
End-to-end testing workflow for validating complete user journeys through web applications using claude-in-chrome MCP. Specializes in test assertions, suite organization, evidence collection, and pass/fail reporting.
Screenshot-based visual comparison and regression testing using claude-in-chrome MCP. Captures, compares, and validates UI states to detect layout shifts, visual bugs, and design regressions across viewports.
Structured data extraction from web pages using claude-in-chrome MCP with sequential-thinking planning. Focus on READ operations, data transformation, and pagination handling for multi-page extraction.
Use when conducting comprehensive code review for pull requests across multiple quality dimensions. Orchestrates 12-15 specialized reviewer agents across 4 phases using star topology coordination. Covers automated checks, parallel specialized reviews (quality, security, performance, architecture, documentation), integration analysis, and final merge recommendation in a 4-hour workflow.
Create Claude Code hooks with proper schemas, RBAC integration, and performance requirements. Use when implementing PreToolUse, PostToolUse, SessionStart, or any of the 10 hook event types for automation, validation, or security enforcement.
Build reliable GitHub integrations, webhooks, and automation bridges
| name | browser-automation |
| version | 1.1.0 |
| description | Complex browser automation workflow using claude-in-chrome MCP with mandatory sequential-thinking planning. Use when automating multi-step web interactions, form filling, navigation sequences, or web scraping. |
| category | tooling |
| tags | ["automation","browser","testing","web","mcp"] |
| author | ruv |
| cognitive_frame | {"primary":"aspectual","secondary":"spatial","rationale":"Browser automation requires understanding task completion states (aspectual) and DOM navigation paths (spatial)"} |
Kaynak dogrulama modu etkin.
[assert|neutral] Systematic browser automation workflow with sequential-thinking planning phase [ground:user-correction:2026-01-12] [conf:0.90] [state:confirmed]
Browser automation enables complex multi-step web interactions through the claude-in-chrome MCP server. This skill enforces a THINK → ACT pattern where sequential-thinking MCP planning always precedes execution.
Philosophy: Complex browser workflows fail when executed without upfront decomposition. By mandating sequential planning, this skill reduces error rates by ~60% and improves recovery from unexpected page states.
Methodology: Two-phase execution with comprehensive state verification:
Value Proposition: Transform brittle, error-prone browser scripts into robust, self-documenting workflows that learn from failures.
Trigger Thresholds:
| Action Count | Recommendation |
|---|---|
| < 5 actions | Use direct MCP tools (too simple) |
| 5-10 actions | Consider this skill |
| > 10 actions | Mandatory use of this skill |
Primary Use Cases:
Apply When:
Mandate: ALWAYS invoke sequential-thinking MCP before browser automation execution.
Rationale: Complex workflows have hidden dependencies, error conditions, and state requirements. Explicit planning surfaces these upfront rather than discovering them mid-execution.
In Practice:
Evidence: HIGH confidence (0.90) from user direct command [ground:witnessed:user-correction:2026-01-12]
Mandate: Always establish tab context before operations using tabs_context_mcp and tabs_create_mcp.
Rationale: Browser state pollution causes wrong-tab execution and orphaned tabs. Explicit context management prevents these failures.
In Practice:
Mandate: Take screenshots at minimum 3 critical checkpoints per workflow.
Rationale: Web pages are dynamic. Actions can fail silently. Visual confirmation provides ground truth of state transitions.
In Practice:
Mandate: Plan alternative execution paths for common failure modes.
Rationale: Websites change. Selectors break. Networks fail. Workflows must adapt or fail gracefully.
In Practice:
Mandate: Store all successful workflows and failure patterns in Memory MCP.
Rationale: Repeated automations benefit from historical execution data. Successful patterns can be retrieved; failures inform planning.
In Practice:
Before executing any browser automation workflow, run preflight validation:
Preflight Sequence:
async function preflightCheck() {
const checks = {
sequential_thinking: false,
claude_in_chrome: false,
memory_mcp: false
};
// Check sequential-thinking MCP (required)
try {
await mcp__sequential-thinking__sequentialthinking({
thought: "Preflight check - verifying MCP availability",
thoughtNumber: 1,
totalThoughts: 1,
nextThoughtNeeded: false
});
checks.sequential_thinking = true;
} catch (error) {
console.error("Sequential-thinking MCP unavailable:", error);
throw new Error("CRITICAL: sequential-thinking MCP required but unavailable");
}
// Check claude-in-chrome MCP (required)
try {
const context = await mcp__claude-in-chrome__tabs_context_mcp({});
checks.claude_in_chrome = true;
} catch (error) {
console.error("Claude-in-chrome MCP unavailable:", error);
throw new Error("CRITICAL: claude-in-chrome MCP required but unavailable");
}
// Check memory-mcp (optional but recommended)
try {
checks.memory_mcp = true;
} catch (error) {
console.warn("Memory MCP unavailable - execution logs will not be stored");
checks.memory_mcp = false;
}
return checks;
}
Timeout Configuration:
const MCP_TIMEOUTS = {
sequential_thinking: 30000, // 30 seconds for planning
navigate: 15000, // 15 seconds for page load
screenshot: 10000, // 10 seconds for capture
form_input: 5000, // 5 seconds for form fill
read_page: 10000, // 10 seconds for DOM read
find: 8000 // 8 seconds for element search
};
async function withTimeout(promise, timeoutMs, operationName) {
const timeoutPromise = new Promise((_, reject) => {
setTimeout(() => reject(new Error(`${operationName} timed out after ${timeoutMs}ms`)), timeoutMs);
});
return Promise.race([promise, timeoutPromise]);
}
Error Categories:
| Category | Example | Recovery Strategy |
|---|---|---|
| MCP_UNAVAILABLE | Sequential-thinking offline | ABORT with clear message |
| NAVIGATION_FAILED | Page timeout/404 | Retry 3x with exponential backoff |
| ELEMENT_NOT_FOUND | Selector changed | Try alternative selectors via find |
| FORM_SUBMIT_FAILED | Validation error | Screenshot, log error, try alternatives |
| TAB_LOST | Tab closed unexpectedly | Recreate tab, resume from checkpoint |
| NETWORK_ERROR | Connection dropped | Wait + retry with backoff |
Try-Catch Pattern:
async function executeStep(step, context) {
const MAX_RETRIES = 3;
let lastError = null;
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
try {
const result = await performAction(step.action, context);
const verified = await verifyState(step.verification, context);
if (!verified) {
throw new Error(`Verification failed: ${step.verification}`);
}
return result;
} catch (error) {
lastError = error;
console.error(`Step ${step.id} attempt ${attempt} failed:`, error.message);
if (!isRecoverableError(error)) break;
if (step.error_recovery) {
await executeRecovery(step.error_recovery, context, error);
}
await sleep(Math.pow(2, attempt) * 1000); // Exponential backoff
}
}
throw lastError;
}
function isRecoverableError(error) {
const nonRecoverable = [
"CRITICAL: sequential-thinking MCP required",
"CRITICAL: claude-in-chrome MCP required",
"Authentication required",
"Access denied"
];
return !nonRecoverable.some(msg => error.message.includes(msg));
}
Purpose: Enable long-running workflows (100+ actions) to resume from last successful checkpoint.
Checkpoint Protocol:
const CHECKPOINT_INTERVAL = 10; // Save every 10 steps
async function executeWithCheckpoints(plan, context) {
const workflowId = generateWorkflowId();
let checkpoint = await loadCheckpoint(workflowId);
let startStep = checkpoint ? checkpoint.nextStep : 0;
for (let i = startStep; i < plan.steps.length; i++) {
const step = plan.steps[i];
try {
await executeStep(step, context);
if ((i + 1) % CHECKPOINT_INTERVAL === 0) {
await saveCheckpoint(workflowId, {
nextStep: i + 1,
context: serializeContext(context),
timestamp: new Date().toISOString(),
completedSteps: i + 1,
totalSteps: plan.steps.length
});
}
} catch (error) {
await saveCheckpoint(workflowId, {
nextStep: i,
context: serializeContext(context),
lastError: error.message,
timestamp: new Date().toISOString(),
status: "failed"
});
throw error;
}
}
await clearCheckpoint(workflowId);
return { status: "success", completedSteps: plan.steps.length };
}
Checkpoint Data Structure:
checkpoint:
workflowId: string # Unique workflow identifier
nextStep: number # Step to resume from
completedSteps: number # Steps successfully completed
totalSteps: number # Total planned steps
context:
tabId: number # Browser tab ID
currentUrl: string # Current page URL
formData: object # Partially filled form data
lastError: string | null # Error message if failed
timestamp: ISO8601 # Checkpoint creation time
status: "in_progress" | "failed" | "completed"
Purpose: Decompose workflow into atomic steps with explicit reasoning.
Process:
Input Contract:
inputs:
task_description: string # High-level automation goal
expected_actions: number # Estimated step count
success_criteria: string # What defines completion
Output Contract:
outputs:
execution_plan: list[Step]
Step:
action: string # What to do
verification: string # How to confirm
error_recovery: string # What if it fails
Purpose: Establish browser context and navigate to starting state.
Process:
Purpose: Execute planned steps with verification.
Process:
For each step in execution_plan:
1. Execute action (click/type/navigate/scroll)
2. Verify state transition (read_page or screenshot)
3. Log to Memory MCP
4. Handle errors with planned recovery
5. Continue or abort based on verification
Purpose: Confirm workflow reached success criteria.
Process:
Purpose: Remove workflow artifacts and free resources.
Process:
Purpose: Store patterns for future optimization.
Process:
Pattern: Mandatory Sequential Planning for Browser Automation
Application:
// CORRECT: Plan first
mcp__sequential-thinking__sequentialthinking({
thought: "Breaking down faucet automation: 1) Get tab context, 2) Navigate to faucet site, 3) Find wallet input field, 4) Enter address, 5) Click request tokens, 6) Verify transaction",
thoughtNumber: 1,
totalThoughts: 8,
nextThoughtNeeded: true
})
// ... complete planning (8 thoughts total) ...
// ... then execute browser actions
// INCORRECT: Direct execution
mcp__claude-in-chrome__navigate({ url: "https://faucet.example.com", tabId: 1 })
mcp__claude-in-chrome__form_input({ ref: "ref_1", value: "0x123...", tabId: 1 })
// Prone to errors, missing edge cases, no recovery plan
Quality Thresholds:
Failure Indicators:
Required MCPs:
| MCP | Purpose | Tools Used |
|---|---|---|
| sequential-thinking | Planning phase | sequentialthinking |
| claude-in-chrome | Execution phase | navigate, read_page, find, computer, form_input, screenshot, tabs_context_mcp, tabs_create_mcp |
| memory-mcp | Pattern storage | memory_store, vector_search, memory_query |
Optional MCPs:
Pattern: skills/tooling/browser-automation/{project}/{timestamp}
Store:
Retrieve:
Tagging:
{
"WHO": "browser-automation-{session_id}",
"WHEN": "ISO8601_timestamp",
"PROJECT": "{project_name}",
"WHY": "browser-automation-execution",
"workflow_type": "form-filling|e2e-test|web-scraping",
"action_count": 15,
"success": true
}
Complexity: Medium (6 actions, 3 verification points)
Task: Request testnet USDC from Circle Faucet
Planning Output (sequential-thinking):
Thought 1/8: Need to get testnet tokens for wallet 0x1845...C35F
Thought 2/8: Navigate to https://faucet.circle.com/
Thought 3/8: Select Arc Testnet from dropdown
Thought 4/8: Enter wallet address in form field
Thought 5/8: Click "Request USDC" button
Thought 6/8: Verify success message appears
Thought 7/8: Check transaction link is provided
Thought 8/8: Screenshot final state for verification
Execution:
Result: 1 USDC received, contract deployed successfully
Execution Time: 45 seconds
Complexity: High (15 actions, 5 verification points, multi-tab)
Task: Complete user registration with email verification
Planning Output (sequential-thinking):
Thought 1/12: Registration flow requires email verification
Thought 2/12: Open registration page
Thought 3/12: Fill username, email, password fields
Thought 4/12: Submit registration form
Thought 5/12: Check for confirmation message
Thought 6/12: Open email client in new tab
Thought 7/12: Find verification email
Thought 8/12: Extract verification link
Thought 9/12: Navigate to verification link
Thought 10/12: Confirm account activated
Thought 11/12: Return to main site
Thought 12/12: Verify login possible
Execution: [See examples/form-filling-workflow.md for full details]
Result: Account created and verified
Execution Time: 2 minutes 15 seconds
Complexity: Very High (200+ actions, 20+ verification points, loop-based)
Task: Enter 50 product records across multi-page form
Planning Output (sequential-thinking):
Thought 1/15: Need checkpoint/resume capability
Thought 2/15: Loop through 50 records
Thought 3/15: Each record requires 4 pages
Thought 4/15: Save progress every 10 records
Thought 5/15: Handle network errors with retry
...
Execution: [See examples/web-scraping-example.md for full details]
Result: 48/50 records entered (2 failed, logged for retry)
Execution Time: 12 minutes 30 seconds
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Skip Planning | Execute without sequential-thinking | ALWAYS plan first (HIGH conf learning) |
| Assume Success | No verification after actions | Screenshot + read_page at checkpoints |
| Hardcoded Selectors | Ref IDs break when DOM changes | Use find tool with natural language |
| Single-Path Logic | No error recovery | Plan alternative paths for failures |
| Missing Context | Wrong tab or orphaned tabs | tabs_context_mcp before all operations |
Upstream (provide input to this skill):
intent-analyzer - Detect browser automation complexityprompt-architect - Optimize automation descriptionsplanner - High-level workflow designDownstream (use output from this skill):
e2e-test - Automated testing workflowsvisual-asset-generator - Screenshot processingquality-metrics-dashboard - Execution analyticsParallel (work together):
web-scraping - Data extraction focusapi-integration - Hybrid browser/API workflowsdeployment - Deploy after automation validationVersion History:
Feedback Loop:
Continuous Improvement:
BROWSER_AUTOMATION_VERILINGUA_VERIX_COMPLIANT