/etchwp:etch-connectorfrom etchwp
Transport layer for driving a live Etch builder tab via the Etch Connector CLI. Manages connection lifecycle, eval contract, persistence, and post-push verification. Used by /etch and /library push actions.
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.
Drives a live Etch builder tab. This skill is pure transport: the generation skills (html-generation, etch-conventions, css-generation, acss-detection) decide what to build; this skill knows how to push it into the tab and prove it landed.
References (read on first use in a session):
references/connector-cli.md — CLI, backends, connection lifecycle, etch.ai presence protocol, securityreferences/public-api.md — condensed etch.* API + persistence model + authoring gotchasreferences/eval-recipes.md — tested eval bodies (detection, scaffold, classes, components, verify)references/help-output.txt — verbatim --help capture (2026-07-25)Before the first drive of a session, run npx @digital-gravy/etch-connector --help and read it fully — it is the live agent manual and the npm package updates independently of the cached references. If it materially differs from references/help-output.txt, trust --help and note the drift.
Ask the user which backend they want (per the manual — never assume):
bridge (default): page-sandboxed, etch.* only. Enough for all building work.cdp: full DevTools privilege (requires Chrome started with --remote-debugging-port=9222). Needed only for visual verification (shot/html/computed) — offer it as an optional add-on for self-checks, not as the default.npx @digital-gravy/etch-connector serve
etch.connectAs('<name>').npx @digital-gravy/etch-connector tabs --json — run this before every push session, not just once; the link dies if the serving chat or the builder tab closes.-t <tab> selects when several are connected.await, return the result. Bridge safe mode exposes only etch.* + standard JS — no window, document, network, or storage.eval -t <tab> -f <path>. Avoids shell-quoting bugs.--timeout generously for tree-walking scripts.etch.ai presence overlay throughout (protocol in connector-cli.md): thinking from the moment a build request arrives, working around each canvas eval, waiting only when handing back, hide() the instant the task completes. Never mention the overlay to the user.| Namespace | Behavior |
|---|---|
etch.blocks, etch.styles, etch.loops | Buffered — live in the builder immediately, reach the DB only on await etch.saveAsync() |
etch.stylesheets, etch.components, etch.fields | Persist immediately (*Async methods) |
Never call etch.saveAsync() unless the user explicitly asks to save. After building, tell the user: changes are live in the builder but unsaved — say "save" to persist them (or save from the builder UI). If the user asks to discard, use etch.history.undo() per mutation or let them reload the tab.
| Exit | Meaning | Action |
|---|---|---|
| 0 | Success | Parse stdout JSON; continue |
| 2 | Script error | Read the message. EtchApiError codes are self-describing (WRONG_BLOCK_TYPE, BLOCK_NOT_FOUND, READONLY, …). Fix the eval body and retry — max 2 retries, then surface the error and stop |
| 1 | Operational | Serve dead, tab unlinked, or timeout. Re-run Step 2 checklist with the user; do not blind-retry the eval |
Repeated exit-2 on the same API call usually means the cached API reference has drifted — pull current docs (Context7 MCP or https://docs.etchwp.com/public-api) before the next attempt.
Take the generation pipeline's semantic structure and translate per references/public-api.md:
| Generated element | etch.* call |
|---|---|
| Section root | blocks.create element tag:"section", attributes: {"data-etch-element":"section"} |
| Container | child element tag:"div", attributes: {"data-etch-element":"container"} |
| Heading/Text/Div/Anchor | etch/element with the right tag; visible text as etch/text children |
| Image | etch/dynamic-image with mediaId (WP media id via REST) — never tag:"img" |
| Icon SVG | etch/svg |
| All classes (BEM + ACSS utilities) | etch.blocks.addClass(id, cls) after creation — classes cannot be authored in JSON |
| Residual custom CSS | etch.styles.create(selector, css) (component-scoped) or etch.stylesheets (global) |
| Reusable component | etch.components.createAsync + updateAsync (remember styles: [] on every element block in blocks) |
Build in as few evals as practical: one eval to create the tree (returning ids), one to apply classes/styles, rather than dozens of round-trips.
Bridge-mode structural check (always): recipe 8 — block exists, expected classes present (hasClass), tree shape correct.
Visual check (when CDP available):
npx @digital-gravy/etch-connector shot --cdp -t etch -s .<block> -o <scratchpad>/check.png
npx @digital-gravy/etch-connector computed --cdp -t etch -s .<block> --props <relevant-props>
computed values for padding/gap must equal resolved token values, not hardcoded literals — mismatch means a utility didn't apply (typo'd class) → fix and re-verify.Record the push-state either way: hand off to the persistence skill after the push and set verified to what actually happened — true when verification passed, false when it failed or could not run (no CDP and the user didn't confirm). A failed push that leaves no registry trace is worse than one marked unverified, and /library renders the unverified state. Never report success to the user on verified: false.
This skill never chooses class names, tokens, structure, or copy. If a push reveals a generation problem (wrong utility class, missing element), route back to the generation skills to regenerate — don't patch conventions inline here.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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.
/Other plugins' skills for the same job