From WordPress Block Theme Converter
Converts HTML/CSS/JS projects into WordPress Block Themes with Full Site Editing, theme.json, block patterns, and WooCommerce compatibility. Scaffolds themes from scratch or migrates static sites to FSE.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wp-block-theme-converter:wp-block-theme-converterThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Convert HTML/CSS/JavaScript projects into production-ready WordPress Block Themes with Full Site Editing (FSE) support, theme.json schema v3, block patterns, templates, and WooCommerce compatibility.
Convert HTML/CSS/JavaScript projects into production-ready WordPress Block Themes with Full Site Editing (FSE) support, theme.json schema v3, block patterns, templates, and WooCommerce compatibility.
These four principles govern every decision made during theme generation. They are non-negotiable and override any temptation to "just get it done."
Tradeoff: These principles bias toward caution over speed. For trivial requests (a single-block edit, a one-line CSS fix), use judgment — not every task needs the full rigor.
Don't assume. Don't hide confusion. Surface tradeoffs.
Before generating ANY file:
core/cover block (parallax-capable) or a core/group with background image (simpler). Which do you prefer?"Minimum code that solves the problem. Nothing speculative.
ThemeHelper class for one function. Don't create a config.php that's only read once.core/media-text block is better than a custom media+text pattern that reimplements the same thing.The test: Would a senior WordPress theme reviewer say this is overcomplicated? If yes, simplify.
Touch only what you must. Clean up only your own mess.
When the user has an EXISTING theme and wants modifications:
wp_enqueue_script() for something, don't migrate it to Interactivity API unless asked.snake_case for function names, follow suit.style attribute. Want me to fix that too?"When YOUR changes create orphans:
The test: Every changed line should trace directly to the user's request.
Define success criteria. Loop until verified.
For every task, define verifiable success criteria BEFORE writing code:
| Task | Success Criteria |
|---|---|
| Convert landing page to WP theme | Theme activates without errors. Front page renders visually identical to source. All patterns editable in Site Editor. |
| Generate theme.json | JSON validates against v3 schema. Color palette matches source. Typography scale matches source. |
| Create a block pattern | Pattern appears in inserter under correct category. Content is editable. No inline styles. All strings translatable. |
| Add WooCommerce support | Product archive/single/cart/checkout templates render. HPOS compatibility declared. WC blocks load correctly. |
| Fix editor parity | Every frontend CSS rule has a matching rule in editor.css. Visual diff between editor and frontend is zero. |
Transform imperative task descriptions into verifiable goals before starting:
| Instead of... | Transform to... |
|---|---|
| "Make it look right" | "Front page renders visually matching source HTML. No inline styles." |
| "Fix the PHP error" | "WP_DEBUG on, error reproduced, fix applied — debug.log is clean." |
| "Add WooCommerce support" | "Cart, checkout, and product archive render without warnings. HPOS declared." |
| "Make patterns editable" | "All patterns in Site Editor inserter. Every text/image element editable without touching the pattern file." |
For multi-step tasks, state a brief plan with verification at each step:
1. Audit source HTML → verify: component map produced, no ambiguity remaining
2. Generate theme.json → verify: JSON validates, all design tokens mapped
3. Create templates → verify: all pages have corresponding FSE templates
4. Register patterns → verify: patterns appear in inserter, content is editable
5. Enqueue assets → verify: no console errors, styles load correctly
6. Accessibility pass → verify: skip-link works, contrast ratios pass, ARIA attributes present
Strong success criteria let you work independently. Weak criteria ("make it look good") require constant clarification.
Trigger this skill when the user wants to:
| Command | Purpose | Reference File |
|---|---|---|
/convert-to-wp-theme | Full conversion of HTML/CSS/JS project to complete block theme | commands/convert-to-wp-theme.md |
/scaffold-wp-theme | Create empty block theme scaffold (no source conversion) | commands/scaffold-wp-theme.md |
/wp-pattern | Convert single HTML section into a registered block pattern | commands/wp-pattern.md |
/wp-theme-json | Generate theme.json from a design system / CSS custom properties | commands/wp-theme-json.md |
/wp-template | Convert single HTML page into FSE template | commands/wp-template.md |
/wp-block | Scaffold a custom block (block.json, edit.js, save.js/render.php, CSS) | commands/wp-block.md |
/wp-migrate | Migrate existing WP content (Classic Editor, ACF, widgets, CPTs, shortcodes) to block theme | commands/wp-migrate.md |
/wp-plugin-theme | Declare plugin dependencies and generate plugin-specific CSS / compatibility code | commands/wp-plugin-theme.md |
/wp-variation | Generate a style variation (styles/*.json) — dark mode, color palette swap, font swap | commands/wp-variation.md |
/wp-classic-to-fse | Convert an existing WordPress classic theme (PHP templates) to FSE block theme | commands/wp-classic-to-fse.md |
/wp-debug | Systematically debug WordPress block theme issues (white screen, editor errors, style regressions) | commands/wp-debug.md |
When the user types one of these commands, read the corresponding command file in commands/ and execute the workflow defined there.
For ANY conversion request (whether triggered by slash command or natural language):
Gather these inputs (ask only if not provided):
Before proceeding, explicitly state:
core/cover with video or a custom pattern with a <video> tag?")For default values when user is silent, use the table in references/defaults.md.
Before writing any code, produce a Conversion Plan that maps:
references/modern-blocks.md)Also state the success criteria for this specific conversion:
SUCCESS CRITERIA:
1. Theme activates on WordPress [version] without PHP errors or notices
2. [List of pages] render visually matching source HTML
3. All patterns appear in Site Editor inserter under [categories]
4. All interactive components work (list them)
5. No inline styles in block markup
6. All strings translation-ready
7. PHPCS WordPress-Extra passes with zero errors
8. [Any project-specific criteria]
Show this plan to the user. Get confirmation before proceeding to file generation (unless the user explicitly says "just build it").
Follow the phases documented in references/methodology.md. Apply Simplicity First at every phase — generate only what the project needs:
wp_enqueue_script() only for complex libs. Read references/modern-blocks.md FIRST.Simplicity checks during execution:
Use the file structure documented in references/file-structure.md. Output every file with a clear header:
=== FILE: {{theme-slug}}/path/to/file.ext ===
<content>
For large projects (10+ HTML pages or WooCommerce themes), split delivery across 3 turns using references/multi-turn-strategy.md.
Surgical precision for existing themes: If modifying an existing theme, output ONLY the changed files. Include a diff summary showing exactly what changed and why.
Run the automated doctor first. Before providing output to the user, run:
node scripts/doctor.mjs <theme-dir>
This executes all four quality checks (theme.json validation, block markup lint, pattern registration check, i18n coverage). Do not declare success until doctor exits 0. If it exits non-zero, loop back to the relevant phase and fix every reported violation before continuing.
Then provide:
npm install, npm run dev, npm run build)VERIFICATION:
✅ node scripts/doctor.mjs <theme-dir> → exits 0 (all checks pass)
✅ Activate theme → Confirm no PHP errors in debug.log
✅ Visit front page → Confirm visual match with source
✅ Open Site Editor → Confirm all templates listed
✅ Insert block → Confirm all patterns appear under correct categories
✅ Run `npx phpcs --standard=WordPress-Extra .` → Confirm zero errors
✅ Check browser console → Confirm zero JS errors
✅ Run Lighthouse → Confirm accessibility score ≥ 90
If any verification step fails, loop back to the relevant phase and fix it before reporting done. Don't declare success past a failed check.
If the user reports a problem with a generated theme, direct them to /wp-debug. See references/troubleshooting.md for the full symptom → root cause → fix reference.
These rules apply to EVERY file generated. See references/quality-rules.md for full details.
❌ NEVER:
style="" attributes in block markup<style> or <script> tags inside templates/parts/patternsvar(--wp--preset--color--{slug})esc_html, esc_attr, esc_url, wp_kses_post)margin-inline-start not margin-left)✅ ALWAYS:
tagName attribute__(), _e(), esc_html__(), etc.filemtime() for cache-bustingprefers-reduced-motion fallbacks for animationswp_enqueue_block_style() for per-block CSS loadingRead these on-demand based on the task:
| File | When to Read | Priority |
|---|---|---|
references/defaults.md | Every conversion (default values) | Always |
references/methodology.md | Full conversions (10-phase process) | Always |
references/modern-blocks.md | Any JS/interactivity work. Interactivity API, Block Bindings, per-block CSS, Section Styles, dark mode, RTL | Before Phase 6 |
references/file-structure.md | Full conversions (directory layout) | Always |
references/block-conversion-map.md | Converting HTML → block markup | During Phase 3-4 |
references/theme-json-schema.md | Generating theme.json (v3 schema + examples) | During Phase 2 |
references/quality-rules.md | Every task (do's and don'ts) | Always |
references/multi-turn-strategy.md | Large projects (10+ pages) | When needed |
references/woocommerce.md | WooCommerce themes | When needed |
references/validation-checklist.md | Post-generation verification | After all files |
references/custom-blocks.md | Custom block development (block.json schema, edit.js patterns, render.php, deprecations) | When /wp-block is invoked |
references/content-migration.md | Classic-to-block conversion, WP-CLI commands, ACF bindings, CPT templates, page builder migration | When /wp-migrate is invoked |
references/asset-optimization.md | Fonts (subsetting, preload, self-hosting), images (WebP, lazy load, LCP), per-block CSS, JS deferral, Core Web Vitals | During Phase 8 (Performance) |
references/plugin-compatibility.md | Plugin detection, CSS conflict resolution, plugin-specific hooks, caching compat | When /wp-plugin-theme is invoked |
references/interactivity-api-advanced.md | Shared store, server hydration, pagination, optimistic UI, ARIA live regions, focus traps, async actions, testing | When Interactivity API work is complex (shared state, async fetch, focus management) |
references/accessibility.md | Skip links, semantic HTML, color contrast, focus management, ARIA patterns, forms, motion, dark mode, screen reader testing | During Phase 8 (Accessibility) or when a11y question arises |
references/ci-cd.md | GitHub Actions workflows, PHPCS config, ESLint/Stylelint config, Theme Check, accessibility scan, SSH deployment | When user asks about CI/CD, automated testing, or deployment pipelines |
references/backward-compatibility.md | Feature availability by WP version, conditional feature loading, PHP compatibility, version strategy | When Requires at least is below 6.5 or user asks about older WP support |
references/e2e-testing.md | Playwright setup, block render tests, visual regression, a11y scans, CI integration | When user asks about automated browser tests or visual regression |
references/i18n.md | All i18n functions, plural forms, context strings, JS translations, .pot generation, RTL | During Phase 9 (i18n) or when multilingual questions arise |
references/troubleshooting.md | Symptom→cause→fix for all common FSE/block-theme failures; WP-CLI cheat sheet; environment checklist | When user reports a problem with a generated theme; always cross-link from Step 5 |
references/page-builder-migration.md | Elementor, Divi, WPBakery, Beaver Builder migration playbooks; element→block mapping tables; 9-step general workflow | When /wp-migrate detects an active page builder |
Reusable boilerplate files in templates/:
templates/style.css.tpl — Theme header file templatetemplates/theme.json.tpl — Minimal valid theme.json startertemplates/functions.php.tpl — Bootstrap functions.phptemplates/pattern-header.php.tpl — Block pattern PHP file headertemplates/template-skeleton.html.tpl — Empty FSE template skeletontemplates/package.json.tpl — Build tooling package.jsontemplates/vite.config.js.tpl — Vite 6 config for WP integrationtemplates/github-actions-ci.yml.tpl — GitHub Actions CI workflow (PHPCS, ESLint, Stylelint, Vite build)templates/patterns/hero.php.tpl — Hero with CTA patterntemplates/patterns/features-grid.php.tpl — Three-column features grid patterntemplates/patterns/testimonials.php.tpl — Three testimonials patterntemplates/patterns/pricing-table.php.tpl — Three-tier pricing table patterntemplates/patterns/cta-section.php.tpl — Call-to-action section patterntemplates/patterns/faq-accordion.php.tpl — FAQ accordion (native details block) patterntemplates/patterns/team-grid.php.tpl — Four-column team grid patterntemplates/patterns/stats-row.php.tpl — Key statistics/metrics row patterntemplates/patterns/woocommerce-product-card.php.tpl — WooCommerce product card for Query Loop (requires WooCommerce 8.0+)Reference implementations in examples/:
examples/northaven-ecommerce.md — Full filled-in prompt for a multi-aesthetic WooCommerce themeexamples/landing-page-simple.md — Minimal single-page conversion example=== FILE: theme-slug/path === formatphp, json, html, css, js)useRootPaddingAwareAlignments: true — breaks alignment otherwiseadd_theme_support('block-templates') AND have classic theme files — they conflictesc_html__() not esc_html(__())style.css — that file is ONLY the theme header; real styles go in assets/css/style.cssregister_block_pattern_category()screenshot.png note — required for theme directory submissionwp_enqueue_block_style() for per-block CSS (only loads when block is on the page)<link rel="preload"> or the wp_preload_resources filtermargin-inline-start not margin-left) for RTL compatibilitystyles.blocks.{block}.variations for full editor integration (Section Styles, WP 6.6+)editor.css. Per-block CSS files loaded via wp_enqueue_block_style() auto-apply to both.Requires at least to 6.6 — styles.blocks.*.variations is silently ignored on WP < 6.6; Section Styles shipped in WP 6.6These guidelines are working if you see:
npx claudepluginhub siddik-web/wp-block-theme-converter --plugin wp-block-theme-converterConverts React/HTML/Next.js codebases into pixel-perfect, SEO-optimized WordPress themes using phased forensic audits and strict UI lock rules.
Generates WordPress Full Site Editing block themes: theme.json configs, block templates, template parts, patterns, functions.php, and styles.
Generates WordPress block themes from scratch, focusing on home pages with FSE compatibility and theme.json config.