Designs a WordPress page locally as a single Custom HTML block (markup, CSS, JS) with live preview, iteration, and feedback loop. Never touches the live site.
Ships in ai-canvas. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You and the user design a page here, on this computer. You write it as one Custom HTML block in a folder, show it in a local preview, and change it until the user is happy. Nothing in this skill touches a website. When the user wants the page on their site, that is the ai-canvas:publish skill, and only on their word.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/canvas.sh" <command> DIR
DIR is the page's folder. The script lints, builds previews, serves them, snapshots, and checks color contrast. It needs only bash and the system's standard tools.
One folder per page, inside an ai-canvas folder in a place the user picks:
<where the user said>/ai-canvas/<page-slug>/
├── block.html the page: one complete Custom HTML block. The only file you edit.
├── preview/ built by `canvas.sh preview`. Never edit.
├── history/ snapshots from `canvas.sh keep`
└── site.txt written by the publish skill once the page is on a site
Ask the user where to save it, in the same round as the brief: "Where on your computer should I keep this page's files? Your Desktop is fine." The Desktop gives ~/Desktop/ai-canvas/<page-slug>/. If they leave it to you, use the Desktop and say so. Never default to the folder Claude Code happens to be running in, and never write into this plugin's own folder: a session can be started from anywhere, and that place is often somewhere you are not allowed to write.
Ask once. The user's next page goes in the same ai-canvas folder without asking. In a later session, when you do not know where their pages are, look for an ai-canvas folder on the Desktop and in Documents before asking again.
The slug is short, lowercase, and hyphenated (spring-launch). If site.txt exists the page is already on a site: your changes stay local until it is published again, so say "this is your local copy; your site still shows the earlier version" when you show one.
A page that is on the site but has no folder here: bring it down first with the publish skill's "Bring a page down".
ai-canvas folder is known.block.html in the shape below. For a new page, load a frontend design skill first if one is listed (frontend-design) and follow its direction; the rules here are about what WordPress needs, not about taste.canvas.sh preview DIR. It lints, then builds the preview pages. Fix every error; read every warning.canvas.sh serve DIR, run in the background, once per session. The preview is at http://127.0.0.1:4173/.canvas.sh keep DIR first, then edit, preview, check, show. "Undo that" is canvas.sh undo DIR, then preview again.block.html is exactly this shape. The lint enforces the first and last lines and the two tags.
<!-- wp:html {"align":"full"} -->
<style data-wp-block-html="css">
/* all CSS, every selector starting with the root class */
/* states only JS can leave (hidden until revealed) under .is-js */
</style>
<script data-wp-block-html="js">
(function () {
function init() {
var root = document.querySelector('.canvas-spring-launch');
if (!root) return;
root.classList.add('is-js');
/* behaviour here, queried from root */
}
if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); }
})();
</script>
<div class="canvas-spring-launch">
<!-- markup -->
</div>
<!-- /wp:html -->
On the site the block sits inside the page template's <main>, at full width, with no page title printed. The user decides when publishing whether the site's own header and footer surround it or the page stands alone, so the same block has to work both ways. That fixes most of what follows.
<!DOCTYPE>, <html>, <head>, <body>, meta tags, <link>, @import, or script src. No external references at all: fonts are the theme's or a system stack, using only the weights and italics that face has.<h1>, no <main>. Neither template prints a title, so the block's first section carries the page's heading. Both supply <main>; inside the root use <section> with headings. Never assume the block starts at the top of the screen (the site header may sit above it), and never assume a site menu is there to navigate with.<nav aria-label="…"> if the page has sections to jump to, and a closing footer line. With a nav, the root's first element is a skip link to the first section, visible on focus.canvas-<slug>, and every selector starts with it. Never style body, html, :root, or a bare element; that restyles the site's header and footer. Custom properties go on the root class.h1–h6, a, button, and form fields, and an element rule beats anything the root only passes down. On each of those set font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-transform, color, and margin; on buttons and fields also background, border, border-radius, box-shadow, and padding. theme.html shows what you missed.querySelector returns null and the script silently does nothing. Keep the init shape above.opacity: 0 awaiting a reveal, hidden tab panels, one slide of a carousel) goes under .canvas-x.is-js, the class the script adds. editor.html is that view. For what must differ in the editor even then (a 100vh hero, sticky or fixed positioning, autoplaying video), write .editor-styles-wrapper .canvas-x ….< in the style or the script, and none bare in text. WordPress treats any < as the start of a tag running to the next > and rewrites every & in between to &; a && b becomes a syntax error that kills the script, and the stored page looks fine. Write b > a, !== for loop bounds, and < in text. The lint catches it in style and script.<path/> becomes <path></path>, data-open becomes data-open="", an empty style="" appears on what they touched. Test attributes with hasAttribute, never against an exact value or their absence; do not rely on :empty or on whitespace between tags.<img> tags; those are what the owner can click to edit. Text assembled by JS is not editable, so build labels from elements that are (tab buttons made from each panel's heading). A hero background is background-image inline on the element plus data-vc-bg, so the owner can swap the photo.canvas.sh preview builds five pages. Each has aiCanvasReport(), which returns one line of JSON about the page as rendered.
| Page | Shows |
|---|---|
index.html | The page between a stand-in site header and footer |
alone.html | The page with nothing around it |
editor.html | The page with its script never run: what wp-admin's editor shows |
theme.html | The page under a deliberately hostile theme stylesheet |
phone.html | index.html in a 390px-wide frame |
With the browser tools (mcp__claude-in-chrome__*; load tabs_context_mcp, tabs_create_mcp, navigate, computer, javascript_tool, browser_batch, and tabs_close_mcp in one ToolSearch), open the preview in a new tab and, for each page, run aiCanvasReport() and take a screenshot. Fix, preview, and reload until all of this holds:
| Report field | Must be |
|---|---|
errors | []. Anything listed is a script error. |
scriptRan | true, except editor.html where it is false |
h1, headingJumps | 1 and [] |
mainElements | 1 (the preview's own; 2 means the block added one) |
overflowX, pastEdge | 0 and [], on phone.html above all |
imagesWithoutAlt, imagesWithoutSize, imagesNotLoaded | [] |
smallTargets | []: every control is at least 44 by 44 pixels |
unnamedControls, smallText, duplicateIds | [] |
themeLeaks (theme.html) | []. Each entry names an element and the property the theme reached. |
The report cannot see what a person sees, so also look:
index.html: screenshot the top, then scroll through every section. It matches what the user asked for.alone.html: when the page may stand alone, look at its top and bottom. It reads as a complete page with nothing above or below it.editor.html: every section is visible and readable. Blank space where a section belongs is a state not gated on .is-js.theme.html: it looks like index.html. Pink, spaced-out, slanted, or oversized anything is a leak.phone.html: zoom the screenshot into the frame. Nothing overlaps, nothing is cut off, and controls are not crowded.Close the tab when the session's design work is done.
Without the browser tools you cannot see the page. Say so, give the user the address, and rely on the lint, the contrast check, and what they tell you.
width and height on every <img>, matching the size referenced, so nothing shifts as images load.loading="lazy" decoding="async" there; the hero stays eager with fetchpriority="high".preload="none", muted playsinline for ambient video, started and paused by an IntersectionObserver.The target is WCAG 2.1 AA on the first draft; you choose the palette, type, and markup in one pass, and nobody reviews it after you. Go to AAA (7:1 text, no text under 16px) only when the user asks, and say that you did.
Color
canvas.sh contrast FG BG [FG BG ...] with the whole palette in one call. 4.5:1 for text, 3:1 for large text (24px, or 18.66px bold) and for UI boundaries (field borders, icons, focus rings). Flatten transparent colors onto their background first. Never eyeball it.Type
max-width: 65ch).text-transform. No text baked into an image, logos aside.Structure
order, absolute positioning, or reversed flex directions.Images and motion
<img> has alt that says what the image means here; alt="" only for decoration. Icons are inline SVG with aria-hidden="true" beside a label, or role="img" with aria-label when the icon is the whole control.@media (prefers-reduced-motion: no-preference). No flashing, no parallax. Anything that moves on its own for more than five seconds has a pause control.Controls and forms
:focus-visible outline, 2px or more, holding 3:1 against its background, on every focusable element. Never outline: none without a replacement.<button type="button">, never a clickable <div>, with ARIA state the script keeps true (aria-expanded, aria-selected, aria-controls) and matching keys: Enter and Space everywhere, arrows between tabs, Escape to close. Write the no-JS markup so its ARIA is true without the script.<label for>. Errors are text next to the field, tied with aria-describedby and aria-invalid and announced with role="alert", without moving the layout. The block's JS sends data nowhere, so a working form is the site's own form block or an embed.Assume the user is non-technical unless they show otherwise. That changes how you talk, not what you build.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
wordpress-page, local-design, custom-html-block, preview-loop
2 skills in this plugin
Other plugins' skills for the same job
/ai-canvas:designfrom ai-canvas
npx claudepluginhub a8cteam51/claude-code-plugins --plugin ai-canvas