plugins/web/skills/page-reduce/SKILL.md
Reduce a webpage to a structural skeleton with semantic tokens. Two-phase pipeline: Phase 1 injects a browser script that tokenizes content ({TEXT}, {HEADING:n}, {IMAGE:WxH}, {CTA:label}, {LINK:label}, {INPUT:type}, {VIDEO}, {ICON}). Phase 2 applies LLM structural reasoning to collapse repeated patterns ({REPEAT:N}), remove decorative wrappers, strip utility classes, and produce skeleton.html + manifest.json. Use when migrating pages to EDS, analyzing page structure, extracting page blueprints, or preparing input for GenAI block generation. Triggers on: reduce page, page skeleton, page blueprint, extract structure, tokenize page, page reduction, structural skeleton, reduce URL.
npx skillsauth add adobe/skills page-reduceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reduce any webpage to a minimal structural skeleton by combining browser-based content tokenization (Phase 1) with LLM structural reasoning (Phase 2).
Phase 1 (browser script): Injects the blueprint detector + tokenizer
into the live page. Detects sections, cleans the DOM (removes scripts,
invisible elements, styling tags, comments, tracking attributes), then
replaces content with tokens. Output: JSON with tokenizedHtml per section.
Phase 2 (you, the agent): Applies structural reasoning to the tokenized HTML — collapses repeated patterns, removes decorative wrappers, strips utility CSS classes, and generates the final skeleton + manifest.
/page-reduce <URL>
Optional flags the user may provide:
--phase1-only — stop after Phase 1, output raw tokenized JSON--output <dir> — write files to a specific directory (default: cwd)if [[ -n "${CLAUDE_SKILL_DIR:-}" ]]; then
BUNDLE="${CLAUDE_SKILL_DIR}/scripts/page-reduce-bundle.js"
else
BUNDLE="$(find ~/.claude \
-path "*/page-reduce/scripts/page-reduce-bundle.js" \
-type f 2>/dev/null | head -1)"
fi
Verify the path is non-empty before continuing. If missing, report an error: the skill's scripts directory needs the combined bundle.
Uses playwright-cli as the browser layer. Run playwright-cli --help
for the command reference.
After the page is open (Step 3 handles the actual playwright-cli open call with the bundle config):
page-prep skill is available, invoke it to dismiss cookie
banners, GDPR consent modals, and other overlays[...document.body.querySelectorAll('*')].forEach(el => {
const s = window.getComputedStyle(el);
if (s.position === 'fixed' || s.position === 'sticky')
el.style.position = 'relative';
});
Inject the bundle via initScript in a playwright-cli --config JSON, along with a
bootstrap script that runs detection asynchronously after the page loads and stores the
result in window.__reduceResult. Then read it via a synchronous eval expression.
REDUCE_CONFIG="/tmp/reduce-config-$$.json"
BOOTSTRAP="/tmp/reduce-bootstrap-$$.js"
# Bootstrap: runs async detection after page load, stores result
cat > "$BOOTSTRAP" << 'EOF'
window.addEventListener('load', async () => {
await window.xp.detectSections(document.body, window, {
autoDetect: true,
highlightBoxes: false,
highlightSections: false,
});
window.__reduceResult = window.__reduceForSkill(document.body, window);
});
EOF
# Config: inject bundle first (exposes window.xp + window.__reduceForSkill),
# then bootstrap (runs detection after load)
echo "{\"browser\":{\"initScript\":[\"$BUNDLE\",\"$BOOTSTRAP\"]}}" > "$REDUCE_CONFIG"
# Open page — initScripts run before any page JS
URL="<target URL from /page-reduce input>"
playwright-cli open "$URL" --config="$REDUCE_CONFIG"
sleep 3 # wait for load + async detection to complete
# Read result — pure expression, no await needed
RESULT=$(playwright-cli eval "JSON.stringify(window.__reduceResult)")
rm -f "$REDUCE_CONFIG" "$BOOTSTRAP"
Parse the returned JSON:
{
"url": "...", "title": "...", "viewport": { "width": 1280 }, "templateHash": "...",
"sections": [{ "index": 0, "sectionType": "hero", "xpath": "...", "tokenizedHtml": "...",
"layout": { "numCols": 2, "numRows": 1 }, "features": ["hasHeading", "hasCTA"] }]
}
If --phase1-only was requested, write this JSON to
phase1-output.json and stop.
Read the Phase 2 rules and apply them to
each section's tokenizedHtml.
Process each section:
{REPEAT:N}data-analytics-*, etc.{FORM:N-fields}{NAV:N-items}{REPEAT:N}unknown with tab panels → tabs)skeleton.html — all sections with comment separators:
<!-- section:0 type:hero xpath:/html/body/main/section[1] -->
<section class="hero">
<h1>{HEADING:1}</h1>
<p>{TEXT}</p>
{CTA:Get Started}
{IMAGE:1200x600}
</section>
<!-- section:1 type:cards xpath:/html/body/main/div[2] -->
<div class="cards-container">
<div class="card">
{IMAGE:400x300}
<h3>{HEADING:3}</h3>
<p>{TEXT}</p>
<a>{LINK:Read more}</a>
</div>
<div class="card">
{IMAGE:400x300}
<h3>{HEADING:3}</h3>
<p>{TEXT}</p>
<a>{LINK:Read more}</a>
</div>
{REPEAT:4}
</div>
Pretty-print with 2-space indentation.
manifest.json — structured metadata per section. See Phase 2 rules for the full schema.
Write both files to the output directory.
Print:
playwright-cli on PATH (the browser layer)page-prep — overlay dismissalThe bundle at scripts/page-reduce-bundle.js is built from the
site-transfer-blueprint-detector project (internal Adobe AEM Foundation repository).
To update:
cd <detector-repo>
npm run build # builds dist/detect.js
npm run build:skill # builds dist/reduce-for-skill.js
cat dist/detect.js dist/reduce-for-skill.js > <skills-repo>/skills/page-reduce/scripts/page-reduce-bundle.js
tools
Use the run-workflow MCP to discover, compose, execute, publish, and save Adobe Firefly workflows. TRIGGER when: user asks what actions are available, what the MCP can do, how to process images/video/3D via workflow, wants to build/run/save/publish a workflow, OR pastes any workflow/batch/execution ID. BARE ID (UUID/workflowId/batchId) = INSPECT ONLY — call inspect_run, NEVER run_workflow_submit. ALWAYS call list_actions first for capability/discovery questions. DO NOT TRIGGER for direct Firefly API calls without MCP (use firefly-api-specs).
tools
Run predefined featured workflows via run-workflow MCP. TRIGGER when user names a featured workflow (retargeting, banners at scale, localization, packaging, banner advertising, etc.) or asks to run a known marketing/production workflow. Requires run-workflow MCP. ALWAYS call get_featured_workflow before compose_workflow. DO NOT TRIGGER for custom one-off workflows with no named template — use run-workflow skill.
tools
Migrate an Adobe Commerce App Builder project from the Integration Starter Kit or Checkout Starter Kit to the new App Management approach. Run from the root of the App Builder project to be migrated. Pass --auto to skip confirmation prompts (suitable for CI or batch use) — auto mode prints a summary of all Q&A questions answered with their defaults. Pass --doc-scan-only to scan README.md and env.dist for outdated content without modifying any files. Use when the user wants to migrate an App Builder project from the Integration Starter Kit or Checkout Starter Kit to the App Management approach, or mentions upgrading their Adobe Commerce extension architecture.
development
Add or modify webhook interceptors in an Adobe Commerce app. Use when the user wants to intercept Commerce operations to validate input, append data, or modify behavior — before or after execution. Requires a base app initialized with commerce-app-init.