{"id":9571,"plugin_id":"plugin_asdk_app_6a585f804ad08191931907c9dc46a985","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T22:55:13.698Z","digest":"114740bd0fbef86a4072706805cb26a59722fdcd96e9b8f17c8697fbcda61d4c","against":null,"payload":{"name":"recreate-as-raw-html","description":"Recreate a component, screen, or pasted code from any codebase as a single self-contained raw HTML file (Tailwind Play CDN + web fonts) that faithfully reproduces its styling, colors, spacing, and fonts. Use when the user asks for a \"raw HTML recreation\", an \"HTML version\" of a component, \"make an HTML copy of X\", or references a component/screen by name (e.g. \"Take the <ComponentName> and give me raw HTML\").","included_files":[],"skill_md_contents":"---\nname: recreate-as-raw-html\ndescription: Recreate a component, screen, or pasted code from any codebase as a single self-contained raw HTML file (Tailwind Play CDN + web fonts) that faithfully reproduces its styling, colors, spacing, and fonts. Use when the user asks for a \"raw HTML recreation\", an \"HTML version\" of a component, \"make an HTML copy of X\", or references a component/screen by name (e.g. \"Take the <ComponentName> and give me raw HTML\").\n---\n\n# Recreate as raw HTML\n\nTurn a component, screen, or pasted snippet into **one self-contained `.html` file** that opens standalone in a browser and reproduces the original's styling as faithfully as possible.\n\n**Method: static.** Read the source and resolve its design tokens by inspection — do NOT run the app, Storybook, or a browser. Fidelity comes from carefully tracing whatever styling system the codebase uses down to concrete values, then re-expressing them in Tailwind.\n\nThis works for **any codebase**. The styling system varies (Tailwind, CSS/SCSS, CSS Modules, styled-components / Emotion, vanilla-extract, a design-system library like Radix/MUI/Chakra/Mantine/shadcn, or plain inline styles). Step 2 is about identifying which one is in play and following the chain to real pixel/color/font values.\n\n## Output contract\n\nProduce a single HTML document:\n\n- Tailwind via the Play CDN: `<script src=\"https://cdn.tailwindcss.com\"></script>`\n- Font `<link>`s / `@import`s in `<head>` for the fonts the source uses\n- Static markup only — no React/Vue/framework, no build step. Add JS only for trivial visual behavior if the user asks; otherwise omit it.\n- Save as `./<ComponentName>.html` (or next to where the user is working) and hand back the path.\n\n## Workflow\n\n### Step 1 — Locate the source (use subagents to explore)\n\n**First, harvest what's already in the parent agent's entire available thread context — don't re-explore what the agent already knows.** Reusable context can come from anywhere in the thread, not only this skill: previous user requests, manual exploration, earlier subagent results, pasted code, open/referenced files, or prior implementation work.\n\nBuild a concise in-memory resolved context brief for the target component source, imported SVGs/design-system rendering, theme tokens/colors, fonts, and image assets. Mark each concern **complete**, **partial**, or **missing**. Only count a concern as complete when the thread contains the concrete values it needs (verbatim `<svg>` markup, concrete hex, px/rem, font families/weights, real asset paths), ideally with source-file provenance. Reuse complete concerns directly without re-reading their files merely to verify them. For partial concerns, preserve the known values and investigate only the unresolved delta. Re-explore a complete concern only when there is evidence it became stale, such as relevant files being edited later in the thread. If everything needed is already in context, skip exploration entirely and go straight to Step 2 assembly.\n\nFor whatever remains partial or missing, you MUST delegate the codebase exploration to `explore` subagents via the Task tool — do not read/grep the files yourself. Subagents do not inherit the parent agent's thread context, so include the relevant resolved context brief, exact known values, and citations in every prompt, and ask only for the unresolved delta. Launch them with the `gpt-5.4-mini` model (fast, read-only), fanned out concurrently in a single batch, then do the HTML assembly yourself with what they return. Split the remaining work, e.g.:\n\n- One subagent finds the target component file(s) and lists its subcomponents / styled wrappers.\n- One subagent **follows the component's imports into design-system/workspace packages and `node_modules`** (monorepo sibling packages, `@scope/*` packages) and, for every imported UI symbol (icons, logos, illustrations, bespoke SVG components), opens its real source and returns the **exact `<svg>` markup / asset path** — not a description. For any third-party design-system primitive (segmented control, tabs, switch, select, etc.), also read the **library's component CSS/default rendering** and return the actual default/hover/selected part styles (track color, indicator background + shadow, label colors, per-`size` padding/height/radius).\n- One subagent identifies the styling system and locates the theme/token definitions (`tailwind.config`, `:root`/`globals.css` CSS vars, JS theme object, or the library's palette), resolving colors from the **theme source-of-truth file** (the palette/token definition) as concrete hex.\n- One subagent finds the font setup, prioritizing **local font files** (`public/fonts/`, `assets/fonts/`, `@font-face` `src: url(...)`, `next/font/local`, `.woff2`/`.woff`/`.ttf`/`.otf`) and then any `@import`/`<link>`/`font-family` declarations, returning the real file paths.\n- One subagent finds the **real image assets** (public/static image files, imported image sources) and returns their real paths, intrinsic width/height, and any hover/state variants.\n\nInstruct each subagent to return the concrete resolved values (hex colors, px/rem, font families, weights, radii, shadows, verbatim SVG markup, asset paths) and exact file/line citations — not summaries — so you can assemble the HTML without re-reading.\n\n- Named target (e.g. a component name, or \"the pricing card\", \"the settings sidebar\") → have a subagent find the component file(s) and everything that affects appearance (subcomponents, styled wrappers, imported CSS/theme files).\n- Pasted code → use it directly, but still resolve any tokens, classes, or theme imports it references (delegate that lookup to a subagent).\n\n### Step 2 — Identify the styling system and resolve to concrete values (the fidelity core)\n\nFirst determine how this component is styled, then trace every style down to a real value (hex color, px/rem size, font family, weight, radius, shadow). Common systems:\n\n- **Tailwind classes** → keep them verbatim where the CDN supports them. Resolve custom classes from the project's `tailwind.config` (custom colors, spacing, fonts) into the concrete value and emit as an arbitrary value (`bg-[#...]`).\n- **Semantic / aliased utility classes** (`bg-primary`, `text-foreground`, `border-border`, `bg-muted`, `text-accent`, common in shadcn/Tailwind theme setups) are **not literal colors** — they resolve to CSS variables (`--primary`, `--foreground`, ...) defined in `globals.css`/`:root` or `tailwind.config`. Follow them to the real value; e.g. `border-border` is usually a light gray, `text-foreground` near-black — not the accent.\n- **Plain CSS / SCSS / CSS Modules** → read the stylesheet; translate each rule to Tailwind utilities, or drop it into an inline `<style>` block if it's complex (keyframes, pseudo-elements, complex selectors).\n- **styled-components / Emotion / vanilla-extract** → read the styled definitions and template literals; translate the resulting CSS to Tailwind/inline styles.\n- **Design-system library** (Radix/Radix Themes, MUI, Chakra, Mantine, shadcn, Ant, or an in-house wrapper) → the library's props and CSS-variable tokens hide real values. Map its layout/spacing props to Tailwind, and resolve its **design tokens** (see below) to concrete values.\n- **Inline `style={{...}}`** → carry values over directly as inline `style` or the equivalent Tailwind class.\n\n**Never infer a color from convention or memory — read the element.** The most damaging errors come from assuming what a color \"should\" be instead of reading the actual `className`/`style` on that element. Chat UIs are a classic trap: many apps use a white/bordered user-message bubble, not an accent-colored one — so do not paint the user bubble the accent color (or a primary button, badge, or highlight) just because that's the common pattern. Open the source for each element and use the color it actually declares.\n\n**Follow imports into design-system / workspace packages — they are the source of truth.** A component's appearance is often defined in code it imports, not in the file you're looking at. When a component renders an imported icon, logo, or bespoke SVG component, open that component in its package (a monorepo sibling package or `node_modules`) and reproduce its **actual markup**. Never approximate a design-system component from its name — trace it to its definition and copy what it renders.\n\n**Icons, SVGs, and the logo MUST match the source 1:1 — never guess.**\n\n- Copy the exact `<svg>` markup — same `viewBox`, `<path>` data, `fill`/`stroke`, `stroke-width`, and dimensions — verbatim from the source (app file, icon package, or asset file). Do NOT redraw, simplify, approximate, or invent path data. Do NOT substitute a \"closest glyph\".\n- If an icon/logo is rendered via a component or an asset import, follow it into its package/asset source and copy the real SVG it emits, including the exact colors passed in for the relevant state.\n- The brand logo/wordmark is a common miss: copy it verbatim from its source rather than eyeballing or reusing a stale/guessed path.\n- The ONLY acceptable fallback when a source SVG truly cannot be located: stop and tell the user which icon could not be found rather than shipping a guessed one. (A distinctive icon guessed instead of copied comes out the wrong shape entirely.)\n\n**Design-system primitives: reproduce the library's real rendering, not a guess.** For a third-party design-system component, the appearance (backgrounds, borders, shadows, the active/selected indicator, sizing per `size`/`variant`) is defined by **the library's own CSS and variant defaults** — not by the app usage or the prop names. You cannot infer it from the app file, which may only be a bare `<SomeControl size=\"1\">` usage.\n\n- Resolve the real look by reading the library's component CSS/source in `node_modules` (or using accurate knowledge of that library's documented default rendering), then translate that to HTML/Tailwind.\n- Library part-name selectors in `className` overrides (generic form `[&_.<library-part-name>]`) reveal the component's internal anatomy — use them to know which parts exist and which one is being styled, and as a pointer to the exact component to read.\n- **Do NOT accent-fill a selected/active segment, tab, toggle, or menu item by default.** Many design systems render the active state as a neutral raised surface (e.g. white/panel background + a subtle shadow, with normal dark label text) on a muted track — not the brand accent. Reproduce the library's actual selected-state styling; if unsure, read the library CSS rather than guessing. (For example, a segmented control's selected item is often a white raised indicator with a shadow, not a solid accent fill.)\n\n**Resolving design tokens (CSS variables / theme scales).** When you see `var(--...)`, a theme object, or a scale reference, follow it to the source-of-truth value — do NOT guess a Tailwind named color that \"looks close\":\n\n- Find where the token is defined (a `:root`/theme CSS file, a JS theme object, or the library's published palette) and use that exact value.\n- Apply it as a Tailwind arbitrary value (`bg-[#...]`, `text-[#...]`, `border-[#...]`) or, only when no utility fits, an inline `style`.\n- For libraries that use a numbered color scale (e.g. Radix's 1–12), the step conveys role: **1–2** app/subtle backgrounds, **3–5** component backgrounds (normal/hover/active), **6–8** borders/separators/focus ring, **9–10** solid fills (9 = the accent solid, e.g. a primary button), **11** secondary/low-contrast text, **12** high-contrast text. Resolve the actual hex from the scale in use (the theme's accent + gray).\n\n**Map layout/spacing/size props to Tailwind** regardless of library:\n\n- `direction=\"column\"` → `flex-col`; `align=\"center\"` → `items-center`; `justify=\"between\"` → `justify-between`\n- `gap`, `px`, `py`, `p`, `m*` spacing steps → the matching Tailwind step (verify the scale — some libraries' step N ≠ Tailwind's step N)\n- Preserve `size`/`variant`/`weight` semantics by translating to the resolved font size, weight, and fill.\n\n**Border radius — resolve the exact value, don't approximate.** Radius is a common failure point: `rounded-md` (6px) rarely matches the source. Trace the real radius to a px/rem value and emit it as an arbitrary utility (`rounded-[10px]`) rather than the nearest named step.\n\n- Named library radii (`radius=\"large\"`, `size=\"2\"`, `--radius-3`, `borderRadius: 'md'`) are **tokens, not pixels** — look up the resolved px in the theme/scale; many libraries also multiply the base radius by a scaling factor, so verify the computed value.\n- A \"pill\"/fully-rounded element uses a huge radius (e.g. `border-radius: 9999px`) → `rounded-full`, not `rounded-lg`.\n- Match **per-corner** radii when the source only rounds some corners (`rounded-t-[10px]`, `rounded-l-lg`) and radius that changes responsively.\n- A parent with radius plus `overflow-hidden` clips children — keep the `overflow-hidden` or inner corners will bleed past the rounded parent.\n- When elements are nested, inner radius usually = outer radius minus the padding/border; preserve that difference instead of reusing the same value.\n\n**Preserve intent.** Keep responsive prefixes (`md:`, `lg:`), visibility/sizing (`hidden md:inline-flex`, `w-fit`, `whitespace-nowrap`), and hover/active/focus/disabled visual states.\n\n### Step 3 — Fonts\n\nDetect the font source and reproduce it in `<head>`. **Always prefer the codebase's own local font files over a Google Fonts (or other web) substitute** — a substitute only approximates the real typeface. Order of preference:\n\n1. **Local font files (preferred whenever they exist)** → check the project for bundled fonts (`public/fonts/`, `assets/fonts/`, `src/fonts/`, `@font-face` `src: url(...)` rules, `next/font/local` declarations, `.woff2`/`.woff`/`.ttf`/`.otf` files). If found, reference them with a `@font-face` block pointing at the file. Since the output must open standalone, resolve the path so the file loads: use an absolute path to the local file (e.g. `file:///.../public/fonts/Foo.woff2`) or the project's served URL, and only copy the files next to the HTML if the user asks. Note in a comment where the fonts came from.\n2. **Google Fonts** → only if the font is a Google font and no local file exists: add the matching `<link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=...\">`.\n3. **Third-party (Typekit/Adobe, etc.)** `@import url(...)` → mirror the same `@import` or `<link>` when there's no local copy.\n4. **Closest web substitute** → last resort when the real font isn't available locally or via a known service; pick the nearest match and note the substitution.\n5. **System/default UI font** → for a system stack, set an explicit `font-family` on the root so it doesn't fall back to Times.\n\nPut font `@import url()` first (above other CSS). Apply the correct `font-family`, weights, sizes, and line-heights on the root and headings.\n\n### Step 4 — Assemble the single file\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=...&display=swap\" />\n    <script src=\"https://cdn.tailwindcss.com\"></script>\n    <style>\n      /* Optional: resolved token vars, keyframes, base font-family */\n      :root { --accent: #3e63dd; }\n      body { font-family: \"Inter\", ui-sans-serif, system-ui, sans-serif; }\n    </style>\n  </head>\n  <body>\n    <!-- recreated markup -->\n  </body>\n</html>\n```\n\n- Icons/SVGs/logo: paste the **exact `<svg>` markup copied 1:1 from source** (see Step 2) — never a guessed or closest-glyph substitute. Inline SVG is already self-contained.\n- Raster images (PNG/JPG/WebP/GIF): **reference the real asset in `src`** rather than inlining it, at its intrinsic width/height, preserving state variants (e.g. hover swaps). Point `src` at the real image so it resolves when the HTML is opened from its saved location — prefer a **path relative to the HTML file** (e.g. `src=\"public/img/foo.png\"` when the HTML sits at the project root), or the **original remote URL** if the source used one. Emoji/placeholder only as an absolute last resort when no asset exists.\n- If the source uses many custom colors, define them once as CSS vars in the inline `<style>` and reference them, to keep markup readable.\n\n## Fidelity checklist\n\n- [ ] Colors match the resolved token/theme values (not guessed named colors), resolved from the theme file\n- [ ] Every icon/SVG matches source 1:1 (same viewBox/path/fill/stroke, copied verbatim, nothing guessed)\n- [ ] Brand logo/wordmark copied verbatim from its source\n- [ ] Real image assets used at correct dimensions (SVG inline; raster referenced by a path that resolves from the HTML's location, or a remote URL) — no emoji/placeholder stand-ins\n- [ ] Design-system primitives reproduce the library's real rendering (track/indicator/shadow/label); selected state matches the library (not an invented accent fill)\n- [ ] Spacing, font sizes, weights, and line-heights match\n- [ ] Borders, radii, and shadows match (radius resolved to the exact px/rem, per-corner and `rounded-full` preserved, `overflow-hidden` kept where the parent clips children)\n- [ ] Layout and responsive behavior preserved (flex/grid, breakpoints, intrinsic sizing)\n- [ ] Hover/active/focus/disabled visual states preserved\n- [ ] Fonts load and apply (no Times fallback)\n- [ ] No framework/import artifacts, no editor-only props; file opens standalone in a browser\n\n## Common mistakes\n\n- Inferring an element's color from UI convention/memory instead of reading its source — e.g. painting a user chat bubble the accent color when the code says `bg-white border-border text-foreground`.\n- Treating semantic classes (`bg-primary`, `text-foreground`, `border-border`) as literal colors instead of resolving their theme CSS variables.\n- Guessing a Tailwind named color (`bg-indigo-600`) instead of resolving the actual token/theme value.\n- Guessing/redrawing an SVG instead of copying it 1:1 (a distinctive icon comes out the wrong shape).\n- Substituting a closest-glyph icon when the real SVG exists in source.\n- Emoji or a generic placeholder instead of the real image asset.\n- Referencing an image by a path that won't resolve from where the HTML is saved (e.g. an app-served `/img/...` path or a stale relative path) — make the `src` relative to the HTML file's location, or use the remote URL.\n- Stopping at the app file instead of following imports into the design-system package/`node_modules`.\n- Accent-filling a selected segment/tab/toggle when the library renders the active state as a neutral raised indicator (white + shadow, dark text).\n- Inferring a design-system component's look from the app usage/prop names instead of the library's CSS/variant defaults.\n- Eyeballing colors instead of reading the theme palette file.\n- Substituting a Google/web font when the codebase ships the real font locally — use the local file via `@font-face` instead.\n- Dropping fonts, so the page falls back to a serif default.\n- Leaving library layout props (`gap`, `px`, `direction`) unconverted — they do nothing in raw HTML.\n- Assuming a library's spacing step equals Tailwind's step without checking the scale.\n- Approximating border radius with `rounded-md`/`rounded-lg` instead of resolving the exact px value; dropping per-corner radii, `rounded-full`, or the `overflow-hidden` that clips a rounded parent.\n- Omitting hover/active/disabled states that the original clearly has.\n- Splitting into multiple files — the output must be a single self-contained `.html`.\n- Re-launching subagents to re-derive information already resolved in context instead of reusing it — or the inverse, trusting a vague mention/filename and skipping a concern that actually needs its values resolved.\n\n## Example\n\nUser: \"Take the `<ComponentName>` from my codebase and give me a raw HTML recreation.\"\n\n1. Search for the named component, read it and its subcomponents.\n2. Identify the styling system; convert framework markup to plain HTML, map layout props to Tailwind, and resolve every color/spacing/font token to a concrete value (arbitrary Tailwind values or inline styles).\n3. Add the app's font `<link>` and set the root `font-family`.\n4. Emit `<ComponentName>.html` with the Tailwind CDN and hand back the path.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}