All skills
jwynia avatar

/scraper-builder

@dbeae09
by J Wyniajwynia/agent-skills160 stars
20

Guide AI agents to generate complete PageObject pattern web scraper projects using Playwright and TypeScript with Docker deployment. Supports agent-browser site analysis for automated selector discovery. Keywords: scraper, playwright, pageobject, web scraping, docker, typescript, data extraction, automation.

Use this Skill: https://skilld.dev/gh/jwynia/agent-skills/scraper-builder

This session only. Nothing lands on disk.

assetsconfigsdockerfile.md

≈486 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Dockerfile Template

Multi-stage Dockerfile using Microsoft's official Playwright image with all browser dependencies pre-installed.

Template

# ============================================
# Stage 1: Build
# ============================================
FROM mcr.microsoft.com/playwright:v1.48.0-jammy AS builder

WORKDIR /app

# Copy dependency manifests first for Docker cache optimization
COPY package*.json ./
RUN npm ci

# Copy source and compile TypeScript
COPY tsconfig.json ./
COPY src/ ./src/
RUN npx tsc

# ============================================
# Stage 2: Production
# ============================================
FROM mcr.microsoft.com/playwright:v1.48.0-jammy

WORKDIR /app

# Install production dependencies only
COPY package*.json ./
RUN npm ci --omit=dev

# Copy compiled output from builder
COPY --from=builder /app/dist ./dist

# Copy .env.example as reference (actual .env should be mounted or set via compose)
COPY .env.example ./.env.example

# Create output directories
RUN mkdir -p data screenshots

# Run as the non-root user included in the Playwright image
USER pwuser

CMD ["node", "dist/index.js"]

Customization Notes

  • Playwright version: Always match the image tag version (v1.48.0) to the playwright package version in package.json. Mismatched versions cause browser launch failures.
  • Base OS: jammy = Ubuntu 22.04. Use noble for Ubuntu 24.04.
  • Single-stage alternative: For simpler setups, remove the build stage and use tsx to run TypeScript directly (add tsx to production dependencies).
  • Environment variables: Pass via docker-compose.yml or docker run -e. Do not bake secrets into the image.
  • Shared memory: If Chromium crashes, add --shm-size=512m to docker run or shm_size: '512mb' in compose.

See Also

  • docker-compose.yml.md — Compose configuration
  • ../../references/docker-setup.md — Full Docker setup guide

Source: SKILL.md on GitHub

2 warnings14d5 checks · Risk SAFE
  • Gen Agent Trust Hub14d

    This skill is a generator for web scraper projects using Playwright, TypeScript, and Docker. It follows security best practices by implementing data validation via Zod schemas, using non-root users in Docker containers, and referencing official images and tools from trusted organizations.

  • Socket14d

    No alerts

  • Snyk14d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    22/22 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at dbeae09. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago
Other metadata
compatibility
Requires Deno for generator scripts. Generated projects use Node.js with Playwright.
metadata
{
  "author": "agent-skills",
  "version": "1.0",
  "domain": "development",
  "type": "generator",
  "mode": "generative"
}

README badge

README badge for jwynia/agent-skills/scraper-builder