This skill creates a complete Hyva child theme with proper structure and Tailwind setup for Magento 2 projects.
npx playbooks add skill hyva-themes/hyva-ai-tools --skill hyva-child-theme
This skill creates a complete Hyvä child theme with the proper directory structure, configuration files, and Tailwind CSS build setup.
Command execution: For commands that need to run inside the development environment (e.g., bin/magento), use the hyva-exec-shell-cmd skill to detect the environment and determine the appropriate command wrapper.
Skill deps (read via <skill_path>/../{name}/SKILL.md, where <skill_path> is the directory containing this SKILL.md file): hyva-exec-shell-cmd, hyva-theme-list, hyva-compile-tailwind-css
Use the vendor name and theme name from the request if they were given. Otherwise prompt the user to provide them. If the user cannot be asked (subagent or non-interactive run), stop and report that a vendor name and a theme name are required.
Vendor Name: The vendor/company namespace (e.g., "Acme", "MyCompany")
Theme Name: The name of the theme (e.g., "customTheme", "StoreTheme")
If the user has specified a parent theme, use that. The parent can be:
Hyva/default-csp or Hyva/default{Vendor}/{ThemeName} from app/design/frontend/If the user has NOT specified a parent theme, discover available options by invoking the hyva-theme-list skill to find all Hyvä themes in the project.
Present the user with options to select a parent theme:
Hyva/default-csp (if installed) or Hyva/default{Vendor}/{ThemeName}If the user cannot be asked (subagent or non-interactive run), use Hyva/default-csp if it is installed, otherwise Hyva/default, and state the chosen parent in the final report.
Parent theme paths for later steps:
vendor/hyva-themes/magento2-default-theme-csp or vendor/hyva-themes/magento2-default-themeapp/design/frontend/{Vendor}/{ThemeName}Create the theme directory at app/design/frontend/<Vendor>/<themeName>/ with:
app/design/frontend/<Vendor>/<themeName>/
├── registration.php
├── theme.xml
├── composer.json
└── web/
└── tailwind/
└── (copied from parent theme)
<?php
declare(strict_types=1);
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register( ComponentRegistrar::THEME, 'frontend/<Vendor>/<themeName>', __DIR__);
<?xml version="1.0"?>
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Example Store Theme</title>
<parent>Hyva/default-csp</parent>
</theme>
Title formatting: Split PascalCase theme names into separate words (e.g., StoreTheme → Store Theme). The title should read as <Vendor> <Theme Name Words> (e.g., Example/StoreTheme → Example Store Theme).
Adjust <parent> to match the selected parent theme:
Hyva/default-csp or Hyva/default for Hyvä default themes{ParentVendor}/{ParentThemeName} for child theme parents (e.g., Example/baseTheme){
"name": "<vendor-lowercase>/<package-name>",
"description": "Example Store Theme based on Hyvä",
"type": "magento2-theme",
"license": "proprietary",
"require": {
"hyva-themes/magento2-default-theme-csp": "*"
},
"autoload": {
"files": [
"registration.php"
]
}
}
Package name rules:
<ThemeName> to kebab-case (e.g., StoreTheme → store-theme)-theme suffix only if the theme name doesn't already end with "theme"StoreTheme → store-theme (already ends with "theme", no suffix added)CustomStore → custom-store-theme (suffix added)myTheme → my-theme (already ends with "theme", no suffix added)Adjust the require dependency to match the parent theme:
hyva-themes/magento2-default-theme-csp or hyva-themes/magento2-default-themecomposer.json), or omit if the parent theme is not a composer packageCreate the web directory and copy the tailwind folder from the parent theme, excluding node_modules (copied node_modules contain broken symlinks and must be installed fresh):
mkdir -p app/design/frontend/<Vendor>/<ThemeName>/web
rsync -a --exclude='node_modules' <parent_theme_path>/web/tailwind app/design/frontend/<Vendor>/<ThemeName>/web/
Where <parent_theme_path> is:
vendor/hyva-themes/magento2-default-theme-csp for Hyvä default-cspvendor/hyva-themes/magento2-default-theme for Hyvä defaultapp/design/frontend/{ParentVendor}/{ParentTheme} for child theme parentsUpdate web/tailwind/hyva.config.json to include the parent theme path(s) in Tailwind content scanning.
For Hyvä default theme parent:
{
"tailwind": {
"include": [
{ "src": "vendor/hyva-themes/magento2-default-theme-csp" }
]
}
}
For child theme parent: Include both the immediate parent AND the root Hyvä theme to ensure all template classes are scanned:
{
"tailwind": {
"include": [
{ "src": "app/design/frontend/{ParentVendor}/{ParentTheme}" },
{ "src": "vendor/hyva-themes/magento2-default-theme-csp" }
]
}
}
If the child theme parent already has additional includes in its hyva.config.json, copy those to maintain the full inheritance chain.
Use the hyva-compile-tailwind-css skill to install dependencies and build CSS for the newly created theme at app/design/frontend/<Vendor>/<ThemeName>/.
Inform the user they can enable the theme via:
bin/magento config:set design/theme/theme_id <theme_id>Run setup upgrade to register the theme:
bin/magento setup:upgrade
bin/magento cache:flush
Cause: Hyvä theme packages not installed in the project.
Solution: Install Hyvä themes via Composer: composer require hyva-themes/magento2-default-theme or hyva-themes/magento2-default-theme-csp.
Cause: The selected parent theme directory is missing or path is incorrect.
Solution: Verify the parent theme exists before running rsync. Check that Composer packages are properly installed with composer install.
Cause: The parent theme doesn't have a web/tailwind directory (possible with very old or custom themes).
Solution: Fall back to copying the tailwind folder from vendor/hyva-themes/magento2-default-theme-csp/web/tailwind instead.
Cause: Node version mismatch, network issues, or corrupted package-lock.json.
Solution:
node --versionnode_modules and package-lock.json, then retry npm installCause: Invalid paths in hyva.config.json or missing purge targets.
Solution:
hyva.config.json exist in the projectAfter successful creation, provide a summary:
app/design/frontend/<Vendor>/<ThemeName>/Hyva/default-csp, Hyva/default, or {Vendor}/{ThemeName})web/tailwind/tailwind-source.cssnpm run watch for developmentnpm run build before deployment<!-- Copyright © Hyvä Themes https://hyva.io. All rights reserved. Licensed under OSL 3.0 -->
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.