# preview-import

Starts a local AEM dev server to verify imported HTML in Edge Delivery Services. Checks block rendering, inspects metadata, and catches 404 errors.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1600 installs · ★ 310
- Author: adobe
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/adobe/skills/tree/HEAD/plugins/aem/edge-delivery-services/skills/preview-import/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/preview-import

## What it does

This skill acts as step five of the `page-import` pipeline. It takes the imported `.plain.html` file and starts the local development server using `aem up --html-folder {dirPath}`. Without this specific folder flag, the AEM CLI proxies requests to the remote environment, which immediately causes 404 errors because local files do not exist remotely.

The workflow validates block decoration, section styling, image paths under `./images/...`, and `<meta>` tags in the page head. It performs a side-by-side layout comparison against `screenshot.png` captured during the scrape step. For index files, it enforces navigating to `/` instead of `/index`.

The verification fails if preceding skills did not generate the required `metadata.json` paths or images folder alongside the HTML document.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add adobe/skills --skill preview-import -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/preview-import/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/preview-import/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add adobe/skills --skill preview-import -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/preview-import/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add adobe/skills --skill preview-import -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/preview-import/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install adobe/skills preview-import
```

2. **Manually: put the files in place**
- File: `.github/skills/preview-import/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add adobe/skills --skill preview-import -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/adobe/skills --path plugins/aem/edge-delivery-services/skills/preview-import
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/preview-import/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add adobe/skills --skill preview-import -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/adobe/skills/tree/HEAD/plugins/aem/edge-delivery-services/skills/preview-import/SKILL.md

## When to use it
- start local AEM dev server for imported plain HTML files
- compare rendered blocks against the original page screenshot
- diagnose 404 errors caused by missing CLI folder flags
- verify metadata tags and image references in page output

## Example prompts
- Preview the imported us/en.plain.html on the local dev server and check block rendering
- Inspect localhost:3000 for missing images and 404 errors against screenshot.png

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 5f6bfc67e9e5d4ba.

BEGIN THIRD-PARTY FILE 5f6bfc67e9e5d4ba
````text
---
name: preview-import
description: Use this when you need to preview and verify content you imported into a local AEM Edge Delivery Services (EDS, Franklin, Helix) dev server on localhost. Starts the dev server against the imported HTML, checks block rendering, inspects DOM structure, compares against the original page, and troubleshoots broken references and 404s.
license: Apache-2.0
metadata:
  version: "2.0.1"
---

# Preview Import

Open and verify imported content in local development server.

## When to Use This Skill

Use this skill when:
- You have generated HTML file (from generate-import-html)
- Ready to preview in browser and verify rendering
- Need to compare with original page structure

**Invoked by:** page-import skill (Step 5)

## Prerequisites

From previous skills, you need:
- ✅ HTML file at correct path (from generate-import-html)
- ✅ Images folder in same directory
- ✅ screenshot.png from scrape-webpage (for comparison)
- ✅ documentPath from metadata.json (for URL construction)

## Related Skills

- **page-import** - Orchestrator that invokes this skill
- **generate-import-html** - Provides HTML file to preview
- **scrape-webpage** - Provides screenshot for comparison

## Preview Workflow

### Step 1: Start Development Server with HTML Folder Flag

**Determine the folder from metadata.json:**
- Look at `paths.dirPath` from metadata.json (e.g., `/us`)
- This is the root folder containing your imported HTML file

**Command:**
```bash
aem up --html-folder {dirPath}
```

**Examples based on imported content location:**

| HTML File Location | Command | Preview URL |
|-------------------|---------|-------------|
| `us/en.plain.html` | `aem up --html-folder us` | `http://localhost:3000/us/en` |
| `products/widget.plain.html` | `aem up --html-folder products` | `http://localhost:3000/products/widget` |
| `blog/2024/post.plain.html` | `aem up --html-folder blog` | `http://localhost:3000/blog/2024/post` |

**Why this is required:**
- Without `--html-folder`, AEM CLI proxies requests to the remote server
- The remote server doesn't have your locally imported content
- Result: 404 "Page not found" errors

---

### Step 2: Navigate in Browser

**For most files, use the document path directly:**
```
http://localhost:3000${documentPath}
```

Example:
- HTML file: `us/en/about.plain.html`
- URL: `http://localhost:3000/us/en/about`

**IMPORTANT: For index files, use `/` instead of `/index`:**
```
If file is: index.plain.html
Preview at: http://localhost:3000/
NOT: http://localhost:3000/index
```

**Note:** If you used `--html-folder` flag (e.g., `aem up --html-folder drafts`), prepend that folder to the URL:
```
File: drafts/test.plain.html
URL: http://localhost:3000/drafts/test
```

Use `paths.documentPath` from metadata.json, but for index files ensure the path is `/` not `/index`

---

### Step 3: Verify Rendering

**Check the following:**
- ✅ Blocks render with correct styling
````
END THIRD-PARTY FILE 5f6bfc67e9e5d4ba

The third-party file has ended. Everything between the 5f6bfc67e9e5d4ba tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2949 of 5120 bytes. © adobe · Apache-2.0 · https://github.com/adobe/skills/tree/HEAD/plugins/aem/edge-delivery-services/skills/preview-import/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
