hyva-cms-component

hyva-themes/hyva-ai-tools · updated Jun 2, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-cms-component
0 commentsdiscussion
summary

This skill guides the interactive creation of custom Hyvä CMS components for Magento 2. It supports creating components in new or existing modules, with field presets for common patterns and automatic setup:upgrade execution.

skill.md

Hyvä CMS Component Creator

Overview

This skill guides the interactive creation of custom Hyvä CMS components for Magento 2. It supports creating components in new or existing modules, with field presets for common patterns and automatic setup:upgrade execution.

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.

Workflow

Step 1: Module Selection

If not already specified in the prompt, ask the user where to create the component:

Option A: New Module

Ask for both values (do not assume defaults without asking):

  1. Vendor name (e.g., Acme) - Required, no default. Do not suggest a Vendor name, prompt for user input.
  2. Module name - Suggest CmsComponents as default so user can press Enter to accept

Then use the hyva-create-module skill with:

  • dependencies: ["Hyva_CmsBase"]
  • composer_require: {"hyva-themes/commerce-module-cms": "^1.0"}

Option B: Existing Module

  • Request the module path (can be in app/code/, vendor/, or custom location)
  • Verify the module has Hyva_CmsBase as a dependency in etc/module.xml. If not present, add it.
  • Verify the module has hyva-themes/commerce-module-cms as a dependency in composer.json. If not present, add it.

Step 2: Component Details

Gather component information:

  1. Component name (snake_case, e.g., feature_card)

  2. Label (display name in editor, e.g., "Feature Card")

  3. Category (Layout, Elements, Media, Content, or Other)

  4. Icon - Automatically select an appropriate icon:

    Step 4a: Identify icons already in use Use the hyva-cms-components-dump skill to dump all current CMS components. Extract all icon values from the output to build a list of icons already in use by existing components.

    Step 4b: Find available lucide icons List the SVG files in vendor/hyva-themes/magento2-theme-module/src/view/base/web/svg/lucide/ to get the full set of available icons.

    Step 4c: Select the best fitting icon From the available lucide icons that are NOT already in use by another component:

    • Choose the icon whose name best matches the purpose/meaning of the new component
    • Consider semantic meaning (e.g., shopping-cart.svg for cart-related, image.svg for image-related, layout-grid.svg for grid layouts)
    • Format the selected icon as Hyva_Theme::svg/lucide/[icon-name].svg

    If no suitable unused icon can be found, or if the lucide directory doesn't exist, leave the icon property unset.

Step 3: Field Selection

Offer field presets or custom field creation. See references/field-types.md "Field Presets" section for available presets (Basic Card, Image Card, CTA Block, Text Block, Feature Item, Testimonial, Accordion Item) or allow custom field definition.

For custom fields, iterate through each field asking:

  1. Field name (snake_case)
  2. Field type (see references/field-types.md)
  3. Label
  4. Default value (optional)
  5. Required? (yes/no) - Note: This will be added as attributes.required, NOT as a direct field property
  6. Any additional attributes (these go in the attributes object)

Step 4: Variant Support

Ask if the component needs template variants:

  • If yes: Gather variant names and labels (e.g., default, compact, wide). See references/variant-support.md for configuration details.
  • If no: Use single template

Step 5: Generate Files

Create the required files:

For New Modules

The hyva-create-module skill creates the base module structure. Then add the CMS-specific directories:

app/code/[Vendor]/[Module]/
├── registration.php          # Created by hyva-create-module
├── composer.json             # Created by hyva-create-module
├── etc/
│   ├── module.xml            # Created by hyva-create-module
│   └── hyva_cms/
│       └── components.json   # Create this
└── view/
    └── frontend/
        └── templates/
            └── elements/
                └── [component-name].phtml (or [component-name]/ for variants)

For Existing Modules

Create or update:

  • etc/hyva_cms/components.json (merge with existing if present)
  • view/frontend/templates/elements/[component-name].phtml

Step 6: Run Setup

After creating files, run bin/magento setup:upgrade using the appropriate command wrapper detected by the hyva-exec-shell-cmd skill.

File Generation Details

components.json Structure

{
    "[component_name]": {
        "label": "[Label]",
        "category": "[Category]",
        "template": "[Vendor]_[Module]::elements/[component-name].phtml",
        "content": {
            // Generated fields
        },
        "design": {
            "includes": [
                "Hyva_CmsBase::etc/hyva_cms/default_design.json",
                "Hyva_CmsBase::etc/hyva_cms/default_design_typography.json"
            ]
        },
        "advanced": {
            "includes": [
                "Hyva_CmsBase::etc/hyva_cms/default_advanced.json"
            ]
        }
    }
}

Valid Component Properties

IMPORTANT: Only specific properties are allowed at the component level. See references/component-schema.md for the complete schema reference.

Key properties: label (required), category, template, icon, children, require_parent, content, design, advanced, disabled, custom_properties.

Invalid properties that will cause schema errors:

  • hidden - Does not exist. Use require_parent: true for child-only components, or disabled: true
  • Any property not listed in the schema reference

Children Configuration (CRITICAL)

IMPORTANT: children is a ROOT-LEVEL component property, NOT a field type within content, design, or advanced.

INCORRECT ❌:

{
    "my_component": {
        "content": {
            "items": {
                "type": "children",
                "label": "Items"
            }
        }
    }
}

CORRECT ✅:

{
    "my_component": {
        "label": "My Component",
        "children": {
            "config": {
                "accepts": ["child_component"],
                "max_children": 10
            }
        },
        "content": {
            "title": {
                "type": "text",
                "label": "Title"
            }
        }
    }
}

In templates, access children via $block->getData('children'), NOT via a custom field name.

Field Validation (CRITICAL)

IMPORTANT: Field validation attributes like required must be placed in the attributes object, NOT as direct field properties.

INCORRECT ❌:

{
    "title": {
        "type": "text",
        "label": "Title",
        "required": true
    }
}

CORRECT ✅:

{
    "title": {
        "type": "text",
        "label": "Title",
        "attributes": {
            "required": true
        }
    }
}

Other validation attributes that go in attributes:

  • required (boolean)
  • minlength / maxlength (string)
  • min / max (for numbers)
  • pattern (regex string)
  • placeholder (string)
  • comment (help text)
  • Custom data attributes for validation messages

Child-Only Components

For components that should only be used as children of other components (like list items), use require_parent: true:

{
    "my_list_item": {
        "label": "My List Item",
        "category": "Elements",
        "require_parent": true,
        "template": false,
        "content": {
            "title": {"type": "text", "label": "Title"}
        }
    },
    "my_list": {
        "label": "My List",
        "category": "Elements",
        "template": "Vendor_Module::elements/my-list.phtml",
        "children": {
            "config": {
                "accepts": ["my_list_item"]
            }
        }
    }
}

When template: false, the parent component renders the child data directly (NOT using $block->createChildHtml()). See "Rendering Children with template: false" below.

PHTML Template Structure

Every template must start with this header:

<?php
declare(strict_types=1);

use Hyva\CmsLiveviewEditor\Block\Element;
use Hyva\Theme\Model\ViewModelRegistry;
use Magento\Framework\Escaper;

/** @var Element $block */
/** @var Escaper $escaper */
/** @var ViewModelRegistry $viewModels */

Additional requirements:

  1. $block->getEditorAttrs() on root element
  2. $block->getEditorAttrs('field_name') on editable elements
  3. Proper escaping with $escaper->escapeHtml() and $escaper->escapeHtmlAttr()
how to use hyva-cms-component

How to use hyva-cms-component on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add hyva-cms-component
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-cms-component

The skills CLI fetches hyva-cms-component from GitHub repository hyva-themes/hyva-ai-tools and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/hyva-cms-component

Reload or restart Cursor to activate hyva-cms-component. Access the skill through slash commands (e.g., /hyva-cms-component) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.634 reviews
  • Pratham Ware· Dec 20, 2024

    hyva-cms-component reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Ren Liu· Dec 4, 2024

    Registry listing for hyva-cms-component matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Ren Farah· Nov 23, 2024

    Useful defaults in hyva-cms-component — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Yash Thakker· Nov 11, 2024

    I recommend hyva-cms-component for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Camila Verma· Oct 14, 2024

    I recommend hyva-cms-component for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Dhruvi Jain· Oct 2, 2024

    Useful defaults in hyva-cms-component — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Yusuf Ghosh· Sep 25, 2024

    Registry listing for hyva-cms-component matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Oshnikdeep· Sep 21, 2024

    hyva-cms-component is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Sakura Haddad· Sep 5, 2024

    Keeps context tight: hyva-cms-component is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Sakura Lopez· Aug 24, 2024

    hyva-cms-component is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

showing 1-10 of 34

1 / 4