Skip to content
Back to skills

Multi Layout Preview

ASecurity

Use when creating multi-layout website previews.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 21, 2026
ai-agentsjavascriptpythongojavasecurity

Works with

  • cli

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add Rafaelrr5/agent-cortex --skill multi-layout-preview --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Multi Layout Preview?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Multi Layout Preview
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rafaelrr5-multi-layout-preview/badge)](https://www.skillsdirectory.com/skills/rafaelrr5-multi-layout-preview)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: multi-layout-preview
description: Use when creating multi-layout website previews.
version: 1.0.0
author: Rafael with AI assistance
license: MIT
category: creative
---
## When to Use
Create functional prototypes of multiple website layouts to compare designs visually and interactively, ensuring they work in a real browser without console errors or layout overflow.

Concept round (first round of prototypes for a new site):
  - Build 3 genuinely different concepts (metaphor, palette, type, interaction), not 3 color swaps. Each is a real page with a hero and one content section that shows how the core content is displayed.
  - Tie each concept to the site owner's actual brief (the problem they described) and taste. Placeholder content is labeled as an example; no generated photos of a real person.
  - Send desktop hero and content-section shots (plus one mobile shot) per concept, recommend one with the reason, list what the owner must supply, then stop for a choice before creating a repo or deploying.
  - Keep each round in its own folders (proto2/, shots2/) so earlier rounds stay comparable.
  - If the owner already has a visual identity, it is the brief for later rounds: sample exact colors from their material (PIL `getpixel` on flat areas), match the fonts by look, and reuse their motifs.

Procedure:
  1. Prepare layout directories: each layout in its own folder with an index.html.
  2. Prepare palette preview images: each as P-<palette>.png in a palettes/ directory.
  3. Write a rendering script (e.g., shoot.py) that:
        - Uses Playwright to load each layout in a browser.
        - Waits for layout to stabilize (e.g., 1800ms).
        - Checks for console errors and fails if any.
        - Checks the wordmark (or a specific element) for overflow (scrollWidth > clientWidth) and fails if clipped.
        - Checks horizontal page overflow (document.documentElement.scrollWidth > innerWidth) at desktop and at 390 px wide, and fails if either overflows.
        - Takes a screenshot of the layout (and optionally scrolls to other sections).
        - Saves screenshots to a shots/ directory with a naming convention (e.g., A1-hero.png).
  4. After generating layout screenshots, generate a palette sheet:
        - Create a blank canvas.
        - For each layout and palette, place the palette preview image and label.
        - Save the combined image (e.g., PALETTES.png).
  5. Verify the output by checking the screenshots and palette sheet for correctness.
Preferences:
  - Functional prototypes: the layouts must be actual HTML/CSS/JS that run in a browser.
  - No static mockups: avoid using image editors to create the previews; use the actual browser.
  - Error checking: treat any console error as a failure.
  - Clipping check: treat any overflow of the wordmark (or designated element) as a failure.
  - Palette sheet: must show all palette previews with labels for easy comparison.
Pitfalls:
  - A preview served behind a strict Content-Security-Policy silently drops inline <style>, inline <script> and style="" attributes, so the page shows unstyled while a local file test looks perfect. Generate external CSS and JS files (setting styles from JS through CSSOM is fine), and run the final console check against the public preview URL.
  - An off-canvas decorative element causes horizontal overflow. Put overflow:hidden on its section; overflow-x:hidden on body is not enough.
  - Items in a flex-direction:column scroll box get squashed (cards collapse to their header); give them flex-shrink:0.
  - Highlight blocks (background plus padding) inside multi-line heavy headlines need line-height of about 1.08 or more, or each block covers the descenders of the line above.
  - Fixed aspect-ratio slides overflow their content on a 390 px phone; switch to height:auto with a min-height on mobile.
  - Never apply an SVG displacement filter to an image that contains text; it warps the text. Keep it on the backing shape.
  - Screenshot interactive states too (open a menu, click an item, then shoot) and look at every shot; geometry checks miss text hidden behind overlapping layers.
  - Screenshots of a live app: dismiss consent, onboarding and permission modals first. If you crop out an error banner, still tell the user the live app shows that error.
  - If the installed Playwright package is newer than the cached browser, pass --browser with the cached Chromium executable instead of downloading another one.
  - Do not skip the console error check; JavaScript errors can break the layout unpredictably.
  - Do not skip the clipping check; overflow may not be visible in the screenshot but breaks the design.
  - Do not reuse screenshots from previous runs without verifying the layout and palette are up-to-date.
  - Do not forget to update the palette sheet when changing palettes; it should reflect the current set.
## Runnable public anchor

Run `python scripts/preview.py` from this directory. See [verification](VERIFICATION.md) for scope and negative tests.

## Attribution

Prepared by Rafael with AI assistance. Adapted from private procedural notes whose recorded author was Hermes Agent. This is not a claim of sole authorship of those notes. Third-party tools retain their own licenses.

Files in this skill

  • SKILL.md2.6 KB
  • VERIFICATION.md1.2 KB
  • fixtures/a-cards/index.html386 B
  • fixtures/b-columns/index.html388 B
  • outputs/a-cards.png6.4 KB
  • outputs/b-columns.png6.5 KB
  • references/layout-palette-convention.md863 B
  • scripts/preview.py2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.