/wp-block-theme-converter:wp-block-theme-converterfrom WordPress Block Theme Converter
Converts HTML/CSS/JS projects into WordPress block themes with Full Site Editing, theme.json v3, FSE templates, block patterns, Interactivity API, Block Bindings, and WooCommerce support.
Ships in WordPress Block Theme Converter. 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.
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 | ${CLAUDE_PLUGIN_ROOT}/commands/convert-to-wp-theme.md |
/scaffold-wp-theme | Create empty block theme scaffold (no source conversion) | ${CLAUDE_PLUGIN_ROOT}/commands/scaffold-wp-theme.md |
/wp-pattern | Convert single HTML section into a registered block pattern | ${CLAUDE_PLUGIN_ROOT}/commands/wp-pattern.md |
/wp-theme-json | Generate theme.json from a design system / CSS custom properties | ${CLAUDE_PLUGIN_ROOT}/commands/wp-theme-json.md |
/wp-template | Convert single HTML page into FSE template | ${CLAUDE_PLUGIN_ROOT}/commands/wp-template.md |
/wp-block | Scaffold a custom block (block.json, edit.js, save.js/render.php, CSS) | ${CLAUDE_PLUGIN_ROOT}/commands/wp-block.md |
/wp-migrate | Migrate existing WP content (Classic Editor, ACF, widgets, CPTs, shortcodes) to block theme | ${CLAUDE_PLUGIN_ROOT}/commands/wp-migrate.md |
/wp-plugin-theme | Declare plugin dependencies and generate plugin-specific CSS / compatibility code | ${CLAUDE_PLUGIN_ROOT}/commands/wp-plugin-theme.md |
/wp-variation | Generate a style variation (styles/*.json) — dark mode, color palette swap, font swap | ${CLAUDE_PLUGIN_ROOT}/commands/wp-variation.md |
/wp-classic-to-fse | Convert an existing WordPress classic theme (PHP templates) to FSE block theme | ${CLAUDE_PLUGIN_ROOT}/commands/wp-classic-to-fse.md |
/wp-debug | Systematically debug WordPress block theme issues (white screen, editor errors, style regressions) | ${CLAUDE_PLUGIN_ROOT}/commands/wp-debug.md |
When the user types one of these commands, read the corresponding command file in ${CLAUDE_PLUGIN_ROOT}/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 ${CLAUDE_PLUGIN_ROOT}/references/defaults.md.
Before writing any code, produce a Conversion Plan that maps:
${CLAUDE_PLUGIN_ROOT}/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 ${CLAUDE_PLUGIN_ROOT}/references/methodology.md. Apply Simplicity First at every phase — generate only what the project needs:
wp_enqueue_script() only for complex libs. Read ${CLAUDE_PLUGIN_ROOT}/references/modern-blocks.md FIRST.Simplicity checks during execution:
Use the file structure documented in ${CLAUDE_PLUGIN_ROOT}/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 ${CLAUDE_PLUGIN_ROOT}/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 "${CLAUDE_PLUGIN_ROOT}/scripts/doctor.mjs" <theme-dir>
This executes all five quality checks (theme structure, 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 "${CLAUDE_PLUGIN_ROOT}/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 ${CLAUDE_PLUGIN_ROOT}/references/troubleshooting.md for the full symptom → root cause → fix reference.
These rules apply to EVERY file generated. See ${CLAUDE_PLUGIN_ROOT}/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 |
|---|---|---|
${CLAUDE_PLUGIN_ROOT}/references/defaults.md | Every conversion (default values) | Always |
${CLAUDE_PLUGIN_ROOT}/references/methodology.md | Full conversions (10-phase process) | Always |
${CLAUDE_PLUGIN_ROOT}/references/modern-blocks.md | Any JS/interactivity work. Interactivity API, Block Bindings, per-block CSS, Section Styles, dark mode, RTL | Before Phase 6 |
${CLAUDE_PLUGIN_ROOT}/references/file-structure.md | Full conversions (directory layout) | Always |
${CLAUDE_PLUGIN_ROOT}/references/block-conversion-map.md | Converting HTML → block markup | During Phase 3-4 |
${CLAUDE_PLUGIN_ROOT}/references/theme-json-schema.md | Generating theme.json (v3 schema + examples) | During Phase 2 |
${CLAUDE_PLUGIN_ROOT}/references/quality-rules.md | Every task (do's and don'ts) | Always |
${CLAUDE_PLUGIN_ROOT}/references/multi-turn-strategy.md | Large projects (10+ pages) | When needed |
${CLAUDE_PLUGIN_ROOT}/references/woocommerce.md | WooCommerce themes | When needed |
${CLAUDE_PLUGIN_ROOT}/references/validation-checklist.md | Post-generation verification | After all files |
${CLAUDE_PLUGIN_ROOT}/references/custom-blocks.md | Custom block development (block.json schema, edit.js patterns, render.php, deprecations) | When /wp-block is invoked |
${CLAUDE_PLUGIN_ROOT}/references/content-migration.md | Classic-to-block conversion, WP-CLI commands, ACF bindings, CPT templates, page builder migration | When /wp-migrate is invoked |
${CLAUDE_PLUGIN_ROOT}/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) |
${CLAUDE_PLUGIN_ROOT}/references/plugin-compatibility.md | Plugin detection, CSS conflict resolution, plugin-specific hooks, caching compat | When /wp-plugin-theme is invoked |
${CLAUDE_PLUGIN_ROOT}/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) |
${CLAUDE_PLUGIN_ROOT}/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 |
${CLAUDE_PLUGIN_ROOT}/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 |
${CLAUDE_PLUGIN_ROOT}/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 |
${CLAUDE_PLUGIN_ROOT}/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 |
${CLAUDE_PLUGIN_ROOT}/references/i18n.md | All i18n functions, plural forms, context strings, JS translations, .pot generation, RTL | During Phase 9 (i18n) or when multilingual questions arise |
${CLAUDE_PLUGIN_ROOT}/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 |
${CLAUDE_PLUGIN_ROOT}/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 ${CLAUDE_PLUGIN_ROOT}/templates/:
${CLAUDE_PLUGIN_ROOT}/templates/style.css.tpl — Theme header file template${CLAUDE_PLUGIN_ROOT}/templates/theme.json.tpl — Minimal valid theme.json starter${CLAUDE_PLUGIN_ROOT}/templates/functions.php.tpl — Bootstrap functions.php${CLAUDE_PLUGIN_ROOT}/templates/pattern-header.php.tpl — Block pattern PHP file header${CLAUDE_PLUGIN_ROOT}/templates/template-skeleton.html.tpl — Empty FSE template skeleton${CLAUDE_PLUGIN_ROOT}/templates/package.json.tpl — Build tooling package.json${CLAUDE_PLUGIN_ROOT}/templates/vite.config.js.tpl — Vite 6 config for WP integration${CLAUDE_PLUGIN_ROOT}/templates/github-actions-ci.yml.tpl — GitHub Actions CI workflow (PHPCS, ESLint, Stylelint, Vite build)${CLAUDE_PLUGIN_ROOT}/templates/patterns/hero.php.tpl — Hero with CTA pattern${CLAUDE_PLUGIN_ROOT}/templates/patterns/features-grid.php.tpl — Three-column features grid pattern${CLAUDE_PLUGIN_ROOT}/templates/patterns/testimonials.php.tpl — Three testimonials pattern${CLAUDE_PLUGIN_ROOT}/templates/patterns/pricing-table.php.tpl — Three-tier pricing table pattern${CLAUDE_PLUGIN_ROOT}/templates/patterns/cta-section.php.tpl — Call-to-action section pattern${CLAUDE_PLUGIN_ROOT}/templates/patterns/faq-accordion.php.tpl — FAQ accordion (native details block) pattern${CLAUDE_PLUGIN_ROOT}/templates/patterns/team-grid.php.tpl — Four-column team grid pattern${CLAUDE_PLUGIN_ROOT}/templates/patterns/stats-row.php.tpl — Key statistics/metrics row pattern${CLAUDE_PLUGIN_ROOT}/templates/patterns/woocommerce-product-card.php.tpl — WooCommerce product card for Query Loop (requires WooCommerce 8.0+)Reference implementations in ${CLAUDE_PLUGIN_ROOT}/examples/:
${CLAUDE_PLUGIN_ROOT}/examples/northaven-ecommerce.md — Full filled-in prompt for a multi-aesthetic WooCommerce theme${CLAUDE_PLUGIN_ROOT}/examples/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:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
PHP, CSS, JavaScript, HTML
wordpress, block-theme, full-site-editing, theme-json, gutenberg, fse
npx claudepluginhub siddik-web/wp-block-theme-converter --plugin wp-block-theme-converterOther plugins' skills for the same job