home / skills / hyva-themes / hyva-ai-tools / hyva-cms-components-dump
This skill helps you list and merge Hyvä CMS components from active modules, enabling debugging and documentation of components.json output.
npx playbooks add skill hyva-themes/hyva-ai-tools --skill hyva-cms-components-dumpReview the files below or copy the command above to add this skill to your agents.
---
name: hyva-cms-components-dump
description: Dump all Hyvä CMS components from active modules. This skill should be used when the user wants to list all CMS components, view available components, debug component configurations, or see the merged components.json output. Trigger phrases include "list cms components", "dump components", "show all components", "view cms components", "components.json dump".
---
# 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:
```bash
php <skill_path>/scripts/dump_cms_components.php
```
Where `<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.json`
- `vendor/{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
```json
{
"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 -->
This skill dumps all Hyvä CMS components declared by active modules and returns a single merged JSON object of component definitions. It helps list available CMS components, detect overrides, and produce a ready-to-consume components.json snapshot for debugging or documentation.
The script reads the Magento module load order from app/etc/config.php and filters for active modules. It locates each module's etc/hyva_cms/components.json (in app/code or vendor packages), maps file locations to module names via etc/module.xml, and merges component JSON objects in the exact module load order so later modules can override earlier definitions. The final output is a formatted JSON object containing all merged components.
Do I need to run this inside the Magento root?
Yes. The script expects to be executed from the Magento project root so relative paths to app/code, vendor, and app/etc/config.php resolve correctly.
Will disabled modules’ components appear in the dump?
No. Only modules marked active in app/etc/config.php (value 1) are included; disabled modules are skipped.