Writes demo HTML files for custom elements compatible with cem serve. Handles partials, metadata, and multi-element demos.
Ships in cem. 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.
Never include <!DOCTYPE>, <html>, <head>, or <body>.
The dev server wraps partials with its own document shell, import maps,
and live reload. Adding document structure breaks rendering.
Read the element's manifest data (cem://element/{tagName} and sub-resources)
and check .config/cem.yaml for:
generate.demoDiscovery — fileGlob determines where demos live;
urlPattern captures path segments with :param; urlTemplate builds
served URLs from those params (supports alias, slug, lower, upper
template functions). Example: elements/rh-card/demo/sizes.html with
urlTemplate: /elements/{{.tag | alias}}/demo/{{.demo}}/ serves at
/elements/card/demo/sizes/. Index demos become the directory root.serve.urlRewrites (if present) — maps served URLs back to filesystem
paths when they differ (e.g., /elements/card/... to /elements/rh-card/...).
Most projects don't need this. Check if configured, and set up if asked.serve.importMap — bare specifiers need to be in dependencies or the
import map configPlace files where fileGlob expects them (typically elements/my-el/demo/).
Index demo — simplest possible usage, no metadata needed:
<script type="module">
import '../my-button.js';
</script>
<my-button>Click Me</my-button>
Feature demos — one feature per file, with metadata:
<meta itemprop="name"
content="With Icon">
<meta itemprop="description"
content="Button with a leading icon in the icon slot">
<script type="module">
import '../my-button.js';
import '../../my-icon/my-icon.js';
</script>
<my-button variant="primary">
<my-icon slot="icon"
name="check"></my-icon>
Save Changes
</my-button>
Multi-element demos — use demo-for to associate with specific elements:
<meta itemprop="demo-for"
content="my-button my-icon">
Call validate_html on the demo content, then verify:
<meta> tags use itemprop, not name or property| Mistake | Fix |
|---|---|
Adding <!DOCTYPE> / <html> | Demos are partials |
<meta name="description"> | <meta itemprop="description"> |
| Absolute import paths | Relative from demo file to source |
Importing from devDependencies | Move to dependencies |
| External CSS/JS links | Inline styles and scripts |
| Everything in one file | One feature per demo |
Missing type="module" | Always <script type="module"> |
generate_html: produce valid element markup via the MCP toolWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/a11y-reviewReview custom element HTML for accessibility issues. Use when the user asks to "review accessibility", "check a11y", "audit accessibility", "find accessibility issues", or mentions "WCAG", "screen reader", "keyboard navigation", or "ARIA" in the context of custom elements.
/angularShow how to use custom elements in Angular, including required CUSTOM_ELEMENTS_SCHEMA configuration. Use when the user asks to "use in Angular", "Angular custom elements", "custom elements in Angular", "CUSTOM_ELEMENTS_SCHEMA", or mentions "Angular module", "standalone component", or "angular integration"./cem-serveSet up cem serve for custom element development. Use when the user asks to "start dev server", "set up cem serve", "preview elements", "run demos", or needs help configuring the dev server, import maps, or CSS transforms.
/cem:write-demosfrom cem
npx claudepluginhub bennypowers/cem --plugin cemOther plugins' skills for the same job