---
name: "puppeteer-cluster-pool"
description: "Scale headless Chrome scraping across multiple browser worker instances."
metadata:
  author: "Thomas Dondorf"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "scale puppeteer scraping"
  - "use puppeteer-cluster"
  - "parallel browser workers nodejs"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Puppeteer Cluster Parallel Concurrency Pool

Orchestrates parallel web scraping using puppeteer-cluster: managing browser pools (CONCURRENCY_PAGE, CONCURRENCY_CONTEXT), auto-restarting crashed workers, and rate-limiting request queues.

## When to Invoke
Invoke this skill whenever you need to:
- scale puppeteer scraping
- use puppeteer-cluster
- parallel browser workers nodejs

## Execution SOP & Rules
1. Initialize cluster with Cluster.launch({ concurrency: Cluster.CONCURRENCY_CONTEXT, maxConcurrency: 8 }).
2. Define task handlers with cluster.task(async ({ page, data: url }) => { ... }).
3. Queue URLs dynamically using cluster.queue(url) and await cluster.idle().
4. Always close the cluster with await cluster.close() in process exit handlers.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
