
Hyva Cms Components Dump
- 507 installs
- 78 repo stars
- Updated July 31, 2026
- hyva-themes/hyva-ai-tools
hyva-cms-components-dump is a Hyvä Magento skill that exports CMS block and component definitions so agents can scaffold, audit, or migrate storefront UI for developers working on Hyvä-themed ecommerce frontends.
About
hyva-cms-components-dump is a skill from hyva-themes/hyva-ai-tools that exports Hyvä Magento CMS block and component definitions into machine-readable output. Instead of manually browsing Magento admin theme structure, developers and coding agents pull canonical CMS layouts, blocks, and component metadata for scaffolding new storefront sections, auditing existing Hyvä templates, or planning migrations between theme versions. Reach for hyva-cms-components-dump when automating Hyvä storefront work, onboarding agents to a Magento codebase, or diffing CMS configuration before a theme upgrade. The dump gives structured definitions agents can search, transform, or regenerate into Tailwind-based Hyvä components without spelunking the admin UI.
- Hyvä Magento theme focus
- CMS component structure export
- Agent-readable storefront context
- Ecommerce UI scaffolding aid
- Reduces manual admin inspection
Hyva Cms Components Dump by the numbers
- 507 all-time installs (skills.sh)
- +15 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #619 of 2,245 Frontend Development skills by installs in the Skillselion catalog
- Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-cms-components-dumpAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 507 |
|---|---|
| repo stars | ★ 78 |
| Last updated | July 31, 2026 |
| Repository | hyva-themes/hyva-ai-tools ↗ |
How do you export Hyvä Magento CMS components?
Export Hyvä Magento CMS block and component definitions so agents can scaffold, audit, or migrate storefront UI without manually browsing the admin theme structure.
Who is it for?
Magento developers on Hyvä themes who need exported CMS block and component definitions for agent scaffolding, audits, or migrations.
Skip if: Stores not using Hyvä Magento or teams that only need generic React component exports unrelated to Magento CMS.
When should I use this skill?
A Hyvä Magento storefront task requires CMS block or component definitions without manually browsing admin theme structure.
What you get
Structured dump of Hyvä CMS blocks, component definitions, and theme metadata for agent or developer use.
- CMS block and component definition dump
- Theme structure export for audit or migration
Files
Hyvä CMS Component Dump
Locates all components.json files from Hyvä CMS modules and outputs a merged JSON object containing all component definitions from active modules.
Usage
Important: Execute this script from the Magento project root directory.
Run the dump script:
php <skill_path>/scripts/dump_cms_components.phpWhere <skill_path> is the directory containing this SKILL.md file (e.g., .claude/skills/hyva-cms-components-dump).
Output format: A single JSON object containing all merged CMS component definitions.
How It Works
1. Reads module configuration from app/etc/config.php to get the ordered list of modules 2. Filters active modules - only modules with value 1 are included (disabled modules are skipped) 3. Locates components.json files in:
app/code/{Vendor}/{Module}/etc/hyva_cms/components.jsonvendor/{vendor-name}/{package-name}/*/etc/hyva_cms/components.json
4. Maps paths to module names by reading each module's etc/module.xml 5. Merges JSON objects in module load order as declared in config.php 6. Outputs the result as formatted JSON
Module Load Order
Components are merged in the exact order modules appear in app/etc/config.php. Later modules can override components from earlier modules by using the same component key.
Example Output
{
"text_block": {
"label": "Text Block",
"category": "Content",
"template": "Hyva_CmsBase::elements/text-block.phtml",
...
},
"feature_card": {
"label": "Feature Card",
"category": "Elements",
"template": "Custom_Module::elements/feature-card.phtml",
...
}
}Integration with Other Skills
This skill can be used to:
- Debug which components are available in the CMS editor
- Verify component registration after creating new components
- Check for component name conflicts between modules
- Export component definitions for documentation
<!-- Copyright © Hyvä Themes https://hyva.io. All rights reserved. Licensed under OSL 3.0 -->
#!/usr/bin/env php
<?php
/**
* Dumps all Hyvä CMS components from active modules.
*
* Reads app/etc/config.php to get active modules in load order,
* finds all etc/hyva_cms/components.json files, and merges them.
*
* Usage: php dump_cms_components.php
* Output: Merged JSON of all CMS component definitions
*/
declare(strict_types=1);
/**
* Find Magento root by traversing up from current directory
*/
function findMagentoRoot(): ?string
{
$dir = getcwd();
while ($dir !== '/' && $dir !== '') {
if (file_exists($dir . '/app/etc/config.php')) {
return $dir;
}
$parent = dirname($dir);
if ($parent === $dir) {
break; // Reached filesystem root
}
$dir = $parent;
}
return null;
}
$magentoRoot = findMagentoRoot();
if ($magentoRoot === null) {
fwrite(STDERR, "Error: app/etc/config.php not found. Run from within a Magento project directory.\n");
exit(1);
}
$configPath = $magentoRoot . '/app/etc/config.php';
// Load module configuration
$config = require $configPath;
$modules = $config['modules'] ?? [];
// Filter to only enabled modules (value === 1)
$enabledModules = array_keys(array_filter($modules, fn($status) => $status === 1));
// Build a map of module name -> components.json path
$moduleComponentsMap = [];
// Search in app/code/
$appCodePattern = $magentoRoot . '/app/code/*/*/etc/hyva_cms/components.json';
foreach (glob($appCodePattern) as $componentsFile) {
$moduleName = getModuleNameFromPath($componentsFile, $magentoRoot);
if ($moduleName) {
$moduleComponentsMap[$moduleName] = $componentsFile;
}
}
// Search in vendor/
// Pattern: vendor/{vendor}/{package}/src/etc/hyva_cms/components.json
// or: vendor/{vendor}/{package}/etc/hyva_cms/components.json
$vendorDirs = glob($magentoRoot . '/vendor/*/*', GLOB_ONLYDIR);
foreach ($vendorDirs as $vendorDir) {
// Check various possible locations for components.json
$possiblePaths = [
$vendorDir . '/etc/hyva_cms/components.json',
$vendorDir . '/src/etc/hyva_cms/components.json',
];
// Also check subdirectories (for packages with multiple modules)
$subDirs = glob($vendorDir . '/*/etc/hyva_cms/components.json');
$srcSubDirs = glob($vendorDir . '/src/*/etc/hyva_cms/components.json');
$possiblePaths = array_merge($possiblePaths, $subDirs, $srcSubDirs);
foreach ($possiblePaths as $componentsFile) {
if (file_exists($componentsFile)) {
$moduleName = getModuleNameFromPath($componentsFile, $magentoRoot);
if ($moduleName) {
$moduleComponentsMap[$moduleName] = $componentsFile;
}
}
}
}
// Merge components in module load order
$mergedComponents = [];
foreach ($enabledModules as $moduleName) {
if (isset($moduleComponentsMap[$moduleName])) {
$componentsFile = $moduleComponentsMap[$moduleName];
$content = file_get_contents($componentsFile);
$components = json_decode($content, true);
if (json_last_error() !== JSON_ERROR_NONE) {
fwrite(STDERR, "Warning: Invalid JSON in $componentsFile: " . json_last_error_msg() . "\n");
continue;
}
if (is_array($components)) {
$mergedComponents = array_merge($mergedComponents, $components);
}
}
}
// Output the merged JSON
echo json_encode($mergedComponents, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
echo "\n";
/**
* Extract module name from a components.json file path by reading module.xml
*/
function getModuleNameFromPath(string $componentsFile, string $magentoRoot): ?string
{
// components.json is in etc/hyva_cms/, so module root is 2 levels up
$moduleRoot = dirname($componentsFile, 3);
// For vendor packages with src/ directory, check one level up
if (basename($moduleRoot) === 'src') {
$moduleRoot = dirname($moduleRoot);
}
$moduleXmlPath = $moduleRoot . '/etc/module.xml';
// Try src/etc/module.xml for vendor packages
if (!file_exists($moduleXmlPath)) {
$moduleXmlPath = $moduleRoot . '/src/etc/module.xml';
}
if (!file_exists($moduleXmlPath)) {
// Try to derive from path for app/code modules
// Path format: app/code/Vendor/Module/etc/hyva_cms/components.json
$relativePath = str_replace($magentoRoot . '/', '', $componentsFile);
if (preg_match('#^app/code/([^/]+)/([^/]+)/#', $relativePath, $matches)) {
return $matches[1] . '_' . $matches[2];
}
return null;
}
$xml = @simplexml_load_file($moduleXmlPath);
if ($xml === false) {
return null;
}
$moduleName = (string) ($xml->module['name'] ?? '');
return $moduleName ?: null;
}Related skills
How it compares
Pick hyva-cms-components-dump over generic Magento skills when the storefront uses Hyvä and CMS component dumps are needed for agent-driven theme work.
FAQ
What does hyva-cms-components-dump export?
hyva-cms-components-dump exports Hyvä Magento CMS block and component definitions in structured form. Developers and agents use the dump to scaffold storefront UI, audit theme layouts, or plan migrations without manually navigating Magento admin.
Who should use hyva-cms-components-dump?
hyva-cms-components-dump targets Magento teams on Hyvä themes who automate storefront work with coding agents. It is unnecessary for non-Magento stacks or projects without Hyvä CMS blocks to inspect.