/etchwp:etch-conventionsfrom etchwp
Defines Etch component generation conventions: BEM naming, Section > Container hierarchy, ACSS utility classes, container queries, accessibility defaults.
Ships in etchwp. 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.
Read when SKILL.md points to them.
This skill defines the structural rules that govern all generated Etch output. Every generation skill (html-generation, css-generation, js-generation) must consult this skill before producing output.
BEM always names; ACSS styles when present. There is exactly one convention, applied per ACSS mode (mode is established by the acss-detection skill and persisted in .etch-components/config.json):
| ACSS mode ON | ACSS mode OFF | |
|---|---|---|
| Naming | BEM on every structural element: block <purpose>-section (or component name), flat __elem, --modifier | Same |
| Styling in markup | ACSS utility classes (spacing, grid, buttons, gaps, widths) alongside the BEM hook — lookup-only from css-generation/references/acss-classes.md, never invented | None — BEM classes only |
| Custom CSS | Only where no utility exists; every design value a verified var(--acss-token) | BEM-scoped stylesheet with a local custom-property block (see css-generation "Non-ACSS fallback") |
Example (ACSS ON): <div class="about-section__grid grid--3 gap--m"> — BEM hook first, utilities after.
The legacy double-class convention (global class + BEM, e.g. heading about__heading) applies only to the legacy Etch-JSON import path (scripts/html-to-json.js) and must not appear in any other output.
The three delivery paths share every rule in this skill; only the transport differs:
| Path | Transport | Classes applied via |
|---|---|---|
Live (/etch) | etch-connector eval → etch.blocks.create + addClass | etch.blocks.addClass() per class (JSON attributes.class is silently dropped) |
Paste (/section) | Markup with data-etch-element + data-etch-context on Section/Container | class attribute in pasted HTML |
Offline (/generate) | Plain HTML/CSS/JS files | class attribute |
Section > Container hierarchy, BEM naming, accessibility defaults, and the ACSS-mode class convention are identical across all three.
Etch provides 15 fundamental elements. The plugin generates HTML that maps to these elements.
| Etch Element | HTML Tag | Purpose |
|---|---|---|
| Section | <section> | Top-level page section; handles semantic structure and spacing |
| Container | <div> | Inner wrapper inside Section; constrains width, organizes content |
| Div | <div> | Generic wrapper (defaults display: flex; width: 100% when "Flex Div") |
| Heading | <h1>–<h6> | Text hierarchy; defaults to <h2> (most common in page building) |
| Text | <p>, <span>, <li> | Paragraph by default; tag is changeable |
| Anchor | <a> | Link functionality |
| Image | <img> | Static image |
| Dynamic Image | <img> | WordPress dynamic image (recommended for WP integration) |
| Svg | <svg> | Vector graphics |
| Iframe | <iframe> | Embedded content |
| Html | raw HTML | Parses raw HTML; used for dynamic data and component props containing HTML |
| Element | any tag | Dynamic element — tag changeable via prop |
| Condition | ghost | Conditional rendering (no DOM output) |
| Loop | ghost | Iterative rendering (no DOM output) |
| Empty | ghost | Placeholder element |
Core structural pattern:
Section > Container > [content elements]
This hierarchy is non-negotiable. Every generated component must follow it.
Etch has a built-in AutoBEM feature that generates BEM classes from the element tree. Generated output must match what AutoBEM would produce so users can paste HTML into Etch without class conflicts.
The component name in kebab-case:
pricing-table
hero
features-grid
Flat — single depth only. Elements are direct conceptual children of the block regardless of DOM depth:
/* Correct */
.pricing-table__heading
.pricing-table__text
.pricing-table__image
.pricing-table__cta
/* Wrong — never nest BEM elements */
.pricing-table__header__heading
.pricing-table__body__text
| Etch Element | BEM Element Suffix |
|---|---|
| Heading | __heading |
| Text | __text |
| Image, Dynamic Image | __image |
| Container | __container |
| Anchor (CTA) | __cta |
| Div (wrapper) | __wrapper |
| Svg | __icon |
Double hyphen separator:
.pricing-table--featured
.pricing-table--popular
.hero--dark
In Etch's CSS panel, use &__ and &-- stemming patterns. Etch's CSS panel expands these into full selectors:
.pricing-table {
padding: var(--space-l);
&__heading {
font-size: var(--h2);
color: var(--heading-color);
}
&__text {
font-size: var(--text-m);
color: var(--text-color);
}
&--featured {
border: var(--border);
border-color: var(--primary);
}
}
Etch uses a container-query-first philosophy. Do not use @media queries with fixed device breakpoints for component-level responsive behavior.
@container syntax — same syntax as @media but scoped to the component's container context.:has(> &) pattern, which sets container-type: inline-size on whatever parent wraps it..hero {
:has(> &) {
container-type: inline-size;
}
&__container {
display: grid;
grid-template-columns: 1fr; /* mobile-first base */
}
@container (width >= 600px) {
&__container {
grid-template-columns: 1fr 1fr;
}
}
}
The :has(> &) pattern is recommended by Etch documentation. It makes components portable — they work regardless of what parent element wraps them. The component self-declares its container query needs.
All generated output must include these accessibility patterns. Do not omit accessibility features to keep output "cleaner" — they are required defaults.
Use semantic elements as wrappers — not generic <div>:
| Content Type | Element |
|---|---|
| Page section | <section> |
| Navigation | <nav> |
| Page header | <header> |
| Page footer | <footer> |
| Main content | <main> |
| Article content | <article> |
<h1> per page — reserved for the primary page title<h1> if the component is the page hero; inner sections use <h2> by defaultAll <img> elements must include:
<img
src="image.jpg"
alt="Descriptive text about the image content"
loading="lazy"
decoding="async"
width="800"
height="600"
>
alt text is required (empty string alt="" for decorative images)loading="lazy" for all non-hero images (prevents layout shift for hero images)decoding="async" alwayswidth and height attributes prevent layout shiftRespect user preference for reduced motion:
@media (prefers-reduced-motion: reduce) {
.component-name {
animation: none;
transition: none;
}
}
All interactive elements must have visible focus indicators:
.component-name__cta:focus-visible {
outline: 2px solid var(--primary);
outline-offset: 2px;
}
Never use outline: none without providing an alternative focus indicator.
| Use Case | Pattern |
|---|---|
| Toggle buttons (open/close) | aria-expanded="true/false" |
| Hidden content | aria-hidden="true" |
| Icon-only buttons | aria-label="Descriptive action" |
| Navigation landmark | aria-label="Primary navigation" |
| Live region updates | aria-live="polite" |
For components that contain navigation or repeated interactive patterns, include:
<a href="#main-content" class="skip-link">Skip to main content</a>
Read references/section-patterns.md for HTML templates of all 7 section types with correct Etch Section > Container structure, BEM naming, and accessibility attributes.
Read references/grid-system.md for ACSS grid classes, responsive variants, uneven ratios, and common layout patterns.
These rules assume ACSS mode ON (the common case). With ACSS absent, rules 2 and 4 are replaced by the local custom-property block in css-generation's "Non-ACSS fallback"; everything else still applies. When generating CSS for Etch components, follow these rules without exception:
Use &__ and &-- stemming. Etch's CSS panel expands these natively. Write &__heading { } not .block__heading { } (unless the class needs to be reachable outside the parent scope).
Reference only ACSS custom properties for design values. Colors, spacing, typography, borders — all must use var(--token-name). Acceptable exceptions: layout geometry values that have no ACSS equivalent (grid-template-columns fractions, aspect-ratio, specific z-index values).
Component-specific layout gets raw CSS values. Grid layout, flex configuration, positioning — these are component-specific and may use raw CSS values (fr units, flex: 0 0 auto, etc.).
Read ACSS token reference for token lookup. Consult @${CLAUDE_PLUGIN_ROOT}/skills/css-generation/references/acss-tokens.md for the complete token catalog. Never guess a token name — look it up.
Container queries for responsive. Use @container (width >= X) with modern range syntax. Not @media. Container query context is set via :has(> &) { container-type: inline-size; } inside the block selector.
BEM flat naming. No grandchild BEM elements. If you need to target a deeply nested element, create a flat BEM element class for it.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub flyingwebie/skills --plugin etchwp9 skills in this plugin
/acss-detectionDetects whether AutomaticCSS (ACSS) is installed for the current project/site and persists the result as the project's ACSS mode. When ACSS is present, generation is FORCED to use ACSS tokens and utility classes. Run before any generation when .etch-components/config.json is missing or has no acss key, and re-run when a new site/tab connects via the Etch Connector.
/css-generationGenerates BEM-scoped CSS with ACSS custom property references for Etch components. Uses &__/&-- stemming compatible with Etch CSS panel. ACSS mode ON: hard gate -- every design value a verified ACSS token, custom CSS only where no utility exists. ACSS mode OFF: local custom-property fallback. Container queries via :has(> &) pattern.
/etch-connectorOther plugins' skills for the same job