CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

page-collect

Extract structured resources (icons, metadata, text, forms, videos, social links) from any webpage using Playwright. Supports individual collectors via subcommands (icons, metadata, text, forms, videos, socials) or all at once. The icon collector classifies SVGs as icon/logo/image based on size and DOM context, optimizes them for EDS, and outputs to /icons/ for use with decorateIcons(). Use when migrating pages, auditing sites, or extracting assets.

Quality

83%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

SKILL.md
Quality
Evals
Security

page-collect

Extract structured resources from any webpage via Playwright.

Subcommands

SubcommandPurposeOutput
allRun all collectorscollection.json + assets
iconsSVGs, icon fonts, CSS icons → classified SVGsicons/ + icons.json
metadataMeta tags, OG, structured datametadata.json
textBody text, headings, word counttext.json
formsForm structures, fields, actionsforms.json
videosVideo embeds, sourcesvideos.json
socialsSocial media linkssocials.json

How to Run

Script Location

If CLAUDE_SKILL_DIR is set:

SCRIPT="${CLAUDE_SKILL_DIR}/scripts/page-collect.js"

Otherwise, find it:

SCRIPT="$(find ~/.claude -path "*/page-collect/scripts/page-collect.js" -type f 2>/dev/null | head -1)"

Invocation

node "$SCRIPT" <subcommand> <url> [--output <dir>]

Default output: ./page-collect-output/

Prerequisites

Playwright must be installed: npx playwright install chromium

Icon Collector Details

The icon collector extracts SVGs from multiple sources:

  • Inline <svg> elements
  • <img> tags with .svg src or data:image/svg+xml URIs
  • CSS background-image SVG data URIs
  • SVG <use> sprite references (resolved to standalone SVGs)

Classification

ClassCriteriaOutput
icon≤ 48px, inside button/link/nav/icons/{name}.svg
logoBrand area, "logo" in class/alt/src/icons/logo.svg
image> 48px, standaloneExcluded

Naming

Icons are named from DOM context (aria-label, class, ID). When no meaningful name can be derived, they get icon-{n} with nameConfidence: "low" in the manifest — review these and rename.

SVG Optimization

Each icon SVG is cleaned:

  1. Strip XML declarations, comments, metadata
  2. Ensure viewBox, remove hardcoded width/height
  3. Replace fill/stroke with currentColor (icons only, not logos)
  4. Collapse whitespace

For more details, read the collectors reference.

icons.json Manifest

{
  "url": "https://example.com",
  "icons": [
    {
      "name": "search",
      "class": "icon",
      "source": "inline-svg",
      "file": "icons/search.svg",
      "nameConfidence": "high",
      "context": "header button Search"
    }
  ]
}

After Running

For icon results:

  1. Review icons.json — rename any nameConfidence: "low" icons
  2. Copy /icons/*.svg to the EDS project's /icons/ directory
  3. Reference in content with :iconname: notation
  4. decorateIcons() in aem.js handles rendering

For all results:

Review collection.json for a full resource inventory of the page.

Integration with migrate-header

When used as part of a header migration:

  1. Run node "$SCRIPT" icons <source-url> --output <extraction-dir>
  2. The scaffold stage reads icons.json and copies SVGs to /icons/
  3. nav.plain.html uses :iconname: for tools/utility icons
  4. The polish loop's program.md notes available icons
Repository

catalan-adobe/skills

Path

skills/page-collect/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.