agentleFS
MrCyber02MrCyber02/vibepress/.claude/skills/lovable-to-elementor/SKILL.md

lovable-to-elementor

Skill0 starsChanged 3 months agoMITView on GitHub

Convert an AI-generated React site (Lovable, v0, Bolt, or any React/Tailwind export) into a native, client-editable WordPress + Elementor site — real containers and widgets, theme-builder header/footer, working forms — verified visually at every breakpoint. Use when asked to migrate, rebuild, or "convert" a React project, AI-builder export, or live site into WordPress/Elementor. Never dump source HTML into HTML widgets.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. argon-media/argon-claude-skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    The rendered page is the only source of truth: Read CSS classes off the live DOM before styling them.

    line 14
  2. Distinctive:

    Idempotent pipeline: All build state lives in re-runnable local scripts (generator DSL → JSON trees → applier).

    line 16
  3. Very specific:

    Use scripts/extract-data.js (brace-matching grabObject) to pull structured consts (serviceCategories, reviews, packages…) straight from the …

    line 37
  4. Very specific:

    Create pages (slug per route), set show_on_front, build the nav menu, assign menu location.

    line 41
  5. Very specific:

    Import all assets via wp media import.

    line 43
  6. Very specific:

    Create forms via the form plugin's PHP API (see scripts/wp/create-wpforms-form.php).

    line 45
  7. Very specific:

    Use the DSL in scripts/build-elementor.js — section() / row() / col() / heading() / text() / button() / image() / iconW() — emitting one …

    line 49
  8. Very specific:

    Every container: container_type: "flex" — without it the validator silently drops every flex_* key.

    line 51
  9. Very specific:

    If the site's REST /wp-json/ 404s (fresh CyberPanel/OpenLiteSpeed installs: the WP rewrite block is missing and OLS caches .htaccess until …

    line 71
  10. Distinctive:

    Exactly one H1 per page: If the visible headline is baked into a photo, add a screen-reader-only H1.

    line 90
  11. Very specific:

    Follow docs/06-migration.md.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lovable → Elementor conversion playbook

You are converting a React/Tailwind site into native Elementor. The client must be able to edit the result in the Elementor editor afterwards. That constraint drives everything below.

Non-negotiable rules

  1. Native widgets only. Headings → heading, paragraphs → text-editor, buttons → button, images → image, layout → container. The html widget is reserved for things Elementor genuinely cannot express (a fixed sticky bar, a third-party embed). A page of HTML widgets is a failed conversion.
  2. Containers, not sections/columns (legacy v3 flex containers unless the site has the v4 atomic experiment ON — check first, see Phase 0).
  3. The rendered page is the only source of truth. Read CSS classes off the live DOM before styling them. Screenshot after every apply. "The API accepted the tree" ≠ done; "the screenshot matches the reference" = done.
  4. Bulk content never passes through your context. Parse price lists, testimonials, and long copy from the React source into JSON with a script; have the generator consume the JSON directly. You reason about structure, not 25 KB of prices.
  5. Idempotent pipeline. All build state lives in re-runnable local scripts (generator DSL → JSON trees → applier). Any fix = edit generator, rebuild, re-apply all. Never hand-patch live widget JSON you can't reproduce.
  6. Verify credentials/licensing questions with the user, never assume. And never commit or echo credentials — env vars only.

Phase 0 — Preflight

  1. Inventory the target site. Via the WordPress MCP bridge (see docs/02-mcp-servers.md) or WP-CLI:
    • elementor-check-setup (or equivalent): Elementor version, is the v4/atomic experiment on? (usually OFF → build v3), active breakpoints, container width.
    • List installed widget packs (elementor-get-schema action=list). Note what exists (XPro, Essential Addons…) — prefer an existing widget over hand-building, but only widgets whose schema you have verified.
  2. Decide the widget palette up front: core heading/text-editor/button/image/icon/icon-list/video/shortcode + the minimum add-on widgets you truly need (menu, marquee, before/after, accordion). Every extra widget type is a schema you must verify.
  3. Confirm with the user: form plugin (WPForms?), header/footer mechanism (theme builder plugin? which?), fonts/colors source of truth.

Phase 1 — Render and capture the source

  1. npm install && npm run dev in the export. It's usually Vite on :8080.
  2. Playwright (scripts/qa/ patterns): full-page screenshots of every route, desktop AND mobile. Scroll the page first to trigger lazy/scroll-reveal content.
  3. Dump the design tokens from tailwind.config.* and index.css: colors (convert HSL vars to hex), font families, radii. These become Elementor kit globals and your DSL constants.
  4. Extract per-section structure (headings, copy, image filenames, alt text) from the rendered DOM — order and grouping matter more than pixel values.
  5. Videos: probe every media file with ffprobe. AI-builder exports frequently ship corrupt/streamless videos (no moov atom, 0 kb/s). Tell the user immediately and substitute stills; don't discover it at QA time.

Phase 2 — Extract content to JSON

Use scripts/extract-data.js (brace-matching grabObject) to pull structured consts (serviceCategories, reviews, packages…) straight from the React source into content.json. Strip JSX icon props before eval. Verify counts (categories: 14, descriptions: 49…) and spot-check one entry.

Phase 3 — Prepare WordPress

  1. Create pages (slug per route), set show_on_front, build the nav menu, assign menu location.
  2. Set Elementor kit globals (system colors, fonts, container width, body background) so the editor's pickers match the design.
  3. Import all assets via wp media import; set alt text; then generate a media map (scripts/wp/refresh-media-map.php): filename → {id, url}. The generator resolves every image through this map. Gotcha: some attachment GUIDs lose the file extension — match by basename stem as fallback.
  4. Re-encode videos server-side (ffmpeg -movflags +faststart, H.264, cap width) before importing.
  5. Create forms via the form plugin's PHP API (see scripts/wp/create-wpforms-form.php). WPForms: the JSON in post_content must contain a top-level "id": "<form_id>" key or the shortcode renders nothing.

Phase 4 — Generate the trees

Use the DSL in scripts/build-elementor.js — section() / row() / col() / heading() / text() / button() / image() / iconW() — emitting one JSON file per document. The DSL bakes in the rules that cost hours to learn:

  • Every container: container_type: "flex" — without it the validator silently drops every flex_* key.
  • Alignment vocabularies differ per widget: heading/text/image/icon take start|center|end; button/icon-list take left|center|right. Map, don't guess.
  • Rows are flex_wrap: nowrap on desktop (sub-pixel rounding wraps % widths + px gaps and silently stacks columns), wrap on tablet/mobile; opt in to wrap only when children exceed one line by design.
  • Never image_size: "custom" — on-the-fly crops can generate broken 0×0 files. Registered size + a CSS class (.h340 img { height:340px; object-fit:cover }).
  • Image widgets are flex items: give them width:100%; align-self:stretch via CSS or they shrink to intrinsic width inside flex-start columns.
  • Buttons: background/hover colors are gated behind background_background: "classic" / button_background_hover_background: "classic".
  • Icons: verify Font Awesome free names (fa-sparkles is Pro; use fa-magic).
  • Full-bleed bg + boxed content: content_width: "boxed" + boxed_width on the section.
  • Stable pseudo-random element IDs (seeded) so re-runs don't churn diffs.
  • Styling controls can't express → one CSS file applied to Customizer Additional CSS (loads on every page — important because Elementor's per-document CSS for theme-builder templates does not reliably enqueue on other pages).

Also read docs/03-elementor-gotchas.md before writing any tree.

Phase 5 — Apply

Apply through the MCP transport (scripts/apply_via_mcp.py → novamira/elementor-set-content), not raw meta writes, and not wp_get_ability()->execute() from WP-CLI:

  • The MCP path validates server-side and returns the offending keys inline — fix and retry in one round trip.
  • The identical payload can fail via WP-CLI ("unknown key" on valid controls) and pass via MCP. If you must use CLI, wp_set_current_user() first (abilities are capability-gated) — but prefer MCP.
  • Direct _elementor_data meta writes skip validation and cache invalidation. Last resort only; then delete _elementor_css + _elementor_element_cache and clear the files manager cache.
  • If the site's REST /wp-json/ 404s (fresh CyberPanel/OpenLiteSpeed installs: the WP rewrite block is missing and OLS caches .htaccess until restart), use the rewrite-free form: /?rest_route=/mcp/novamira.
  • Requests from the hosting box to its own public hostname may 403 through Cloudflare — curl --resolve domain:443:127.0.0.1 to loop back.

Phase 6 — The QA loop (this is the actual work)

Repeat until the screenshots match the reference design:

  1. Sweep (scripts/qa/qa-sweep.js): every page × desktop/tablet/mobile → table of height, image count, broken images, horizontal scroll, logo present. All-zero broken/hscroll is the baseline, not the goal.
  2. Look at full-page screenshots next to the reference. Then capture individual sections (scripts/qa/capture-section.js — crops by heading text, so shots don't drift as the page changes) for anything suspicious. Thumbnails lie: verify "missing" images at full resolution before "fixing" them.
  3. Diagnose in the DOM, not in your head. Puzzling layout → dump the element chain (computed display/flex/width up 4 ancestors). Styling a third-party widget → list its real rendered classes first. Both patterns are in docs/05-qa-playbook.md.
  4. Fix in the generator or the CSS file → re-apply → re-screenshot. Cache-bust with ?cb=<timestamp> — never ?s= (that's WordPress search and you'll QA a search-results page).
  5. Mobile is not an afterthought: check the off-canvas menu open state, sticky elements, tap targets, and that desktop-only chrome (header CTA) is hidden including its wrapper column (an emptied flex column still wraps to a blank row). Beware over-broad :has() — :has(.x) matches every ancestor; you almost always mean :has(> .x).

Phase 7 — Header & footer (theme builder)

With XPro Theme Builder (Elementor-Pro-free path): create xpro-themer posts, apply the trees, then set meta — xpro_theme_builder_template_type = type_header / type_footer (NOT header/footer — the mismatch fails silently and the theme's default header renders), display condition {"rule":["basic-global"]}. Full details + the widget quirks (marquee 120px default, compare widget display:inline collapse, mobile-menu white-on-white, logo canvas trimming) in docs/04-xpro-gotchas.md.

Phase 8 — Polish (do these even if unasked; they're cheap and real)

  • Exactly one H1 per page. If the visible headline is baked into a photo, add a screen-reader-only H1.
  • Contrast audit (scripts/qa/contrast-audit.js): body copy ≥ 4.5:1. Brand-pink-on-black often fails at small sizes; lighten long-form copy, keep brand color for accents — set it in the widgets so the client can still edit it.
  • Staging must be noindex until migration (a staging clone competing with the client's live domain is an SEO incident). Flip at go-live; Rank Math's sitemap intentionally 404s while noindexed.
  • SEO plugin + per-page titles/descriptions + LocalBusiness schema (NAP, hours, geo) for local businesses. Note: Rank Math emits nothing until its setup-wizard flags are set (rank_math_registration_skip, rank_math_wizard_completed).
  • Mobile conversion path: if the header CTA is desktop-only, add a sticky bottom bar (Book/Call) — an html widget in the footer template + CSS is the honest tool here.
  • Caching: match the plugin to the web server (LiteSpeed Cache on LiteSpeed). Leave CSS/JS combine and defer OFF — they break Elementor/XPro widgets; revisit with measurements only.
  • Favicon, descriptive alt text (not filename-derived), and a written migration checklist stored where the next session can find it.

Phase 9 — Migration & handover

Follow docs/06-migration.md. Sequence matters: migrate everything → verify on the client host (re-run the full QA sweep + schema/forms/templates) → then remove the agent-access plugins last (removing them cuts your own access). Search-replace must be serialization-aware (wp search-replace --precise --all-tables) and verified to zero leftovers.

Failure smells (stop and re-check)

  • You are about to write CSS for a class name you haven't seen in the live DOM.
  • You "fixed" something but didn't re-screenshot it.
  • A tree applied but the page height barely changed — the validator probably dropped your keys silently somewhere; read back the stored tree.
  • You are pasting more than ~50 lines of site copy into your own output — that content belongs in the JSON pipeline.
  • Content renders in the source capture but you never checked it on mobile.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.