Token导航 LogoToken导航

Agent Skill · 研究检索

hyva-cms-component(海沃 CMS 组件)

hyva-cms-component 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

hyva-cms-component 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 16,509。

总安装 7,148周安装 292GitHub Stars 64下载 2,289核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:hyva-cms-component(海沃 CMS 组件)
来源仓库:https://github.com/hyva-themes/hyva-ai-tools
仓库路径:skills/hyva-cms-component
安装命令:
npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-cms-component
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

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

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

hyva-cms-component 用于查找、检索和筛选相关信息,支持基于关键词的任务场景定位。适用于 CMS 组件配置、功能模块集成和系统扩展相关查询。可在 Codex、Claude、Cursor、Gemini CLI 中快速获取候选结果。需确认权限范围和维护状态,避免触发联网或文件读写操作。

建议结合来源仓库和原始 README 继续核验具体用法。

来源仓库内路径:skills/hyva-cms-component

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-cms-com…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

hyva-cms-component 怎么安装?

在终端执行 npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-cms-component。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

hyva-cms-component 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

hyva-cms-component 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-cms-component 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

hyva-cms-component 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

hyva-cms-component 用的人多吗?

公开数据是累计安装 7,148 次,近一周安装 292 次,下载 2,289 次,GitHub 64 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

hyva-cms-component 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
hyva-cms-component

海沃 CMS 组件 · 本页

7,14864执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

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: If no suitable unused icon can be found, or if the lucide directory doesn't exist, leave the icon property unset.

- 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

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()

Template Patterns by Field Type

Text fields:

$title = $block->getData('title');
// In template:
<?php if ($title): ?>
    <h2 <?= /** @noEscape */ $block->getEditorAttrs('title') ?>>
        <?= $escaper->escapeHtml($title) ?>
    </h2>
<?php endif; ?>

Richtext/HTML fields:

$content = $block->getData('content');
// In template (no escaping for richtext):
<?php if ($content): ?>
    <div <?= /** @noEscape */ $block->getEditorAttrs('content') ?>>
        <?= /** @noEscape */ $content ?>
    </div>
<?php endif; ?>

Image fields:

Use the hyva-render-media-image skill for rendering images. It provides the complete API reference and code patterns for the \Hyva\Theme\ViewModel\Media view model.

Add these imports when rendering images:

// Additional imports for templates with images:
use Hyva\Theme\ViewModel\Media;

/** @var Media $mediaViewModel */
$mediaViewModel = $viewModels->require(Media::class);

The data from $block->getData('image') can be passed directly to getResponsivePictureHtml():

$image = $block->getData('image');

// In template:
<?php if ($image): ?>
    <?= /** @noEscape */ $mediaViewModel->getResponsivePictureHtml(
        $image,
        ['class' => 'w-full h-auto', 'loading' => 'lazy']
    ) ?>
<?php endif; ?>

For responsive images with separate desktop and mobile sources, see the hyva-render-media-image skill.

Link fields:

$link = $block->getData('link');
$linkData = $link ? $block->getLinkData($link) : null;
// In template:
<?php if ($linkData): ?>
    <a href="<?= $escaper->escapeUrl($linkData['url']) ?>"
       <?php if (!empty($linkData['target'])): ?>target="<?= $escaper->escapeHtmlAttr($linkData['target']) ?>"<?php endif; ?>>
        <?= $escaper->escapeHtml($linkData['title'] ?: 'Read more') ?>
    </a>
<?php endif; ?>

Boolean fields:

$showTitle = (bool) $block->getData('show_title');
// In template:
<?php if ($showTitle && $title): ?>
    <!-- title markup -->
<?php endif; ?>

Select fields:

$style = $block->getData('style') ?: 'default';
$styleClasses = match($style) {
    'primary' => 'bg-blue-600 text-white',
    'secondary' => 'bg-gray-200 text-gray-800',
    default => 'bg-white text-gray-600'
};

Children fields (with their own templates):

When child components have their own templates (default behavior), use $block->createChildHtml():

$children = $block->getData('children') ?: [];
// In template:
<?php foreach ($children as $index => $child): ?>
    <?= /** @noEscape */ $block->createChildHtml($child, 'child-' . $index) ?>
<?php endforeach; ?>

Rendering Children with template: false:

When child components have "template": false, the parent component renders them directly. Child data is flat - field values are directly on the child array, NOT nested under a content key.

$children = $block->getData('children') ?: [];

// In template - iterate and access child data directly:
<?php foreach ($children as $elementData): ?>
    <?php
    // Access fields directly on $elementData (NOT $elementData['content']['field'])
    $image = $elementData['image'] ?? null;
    $title = $elementData['title'] ?? '';
    $description = $elementData['description'] ?? '';

    // Each child has a 'uid' for editor attributes
    $childUid = $elementData['uid'];
    ?>
    <div <?= /** @noEscape */ $block->getEditorAttrs('', $childUid) ?>>
        <?php if (!empty($image['src'])): ?>
            <?php // For image rendering patterns, see the hyva-render-media-image skill ?>
            <?= /** @noEscape */ $mediaViewModel->getResponsivePictureHtml(
                [$block->getResponsiveImageData($image)],
                ['alt' => $image['alt'] ?? '', 'class' => 'w-full h-auto', 'loading' => 'lazy']
            ) ?>
        <?php endif; ?>
        <p <?= /** @noEscape */ $block->getEditorAttrs('title', $childUid) ?>>
            <?= $escaper->escapeHtml($title) ?>
        </p>
    </div>
<?php endforeach; ?>

Key points for template: false children:

  • Child field data is flat: use $elementData['field_name'], NOT $elementData['content']['field_name']
  • Each child has a uid property for editor attributes
  • Use $block->getEditorAttrs('field_name', $childUid) to enable live editing of child fields
  • Use $block->getEditorAttrs('', $childUid) on the child's root element
  • For images, check !empty($image['src']) and use $block->getResponsiveImageData($image) to process the image data
  • For advanced image rendering patterns (responsive breakpoints, etc.), see the hyva-render-media-image skill

Resources

references/critical-patterns.md

READ THIS FIRST - Essential patterns and common mistakes including:

  • Correct children configuration (root-level vs field type)
  • Proper field validation with attributes
  • Default value syntax
  • Quick checklist before generating components

Read this file before generating any component to avoid common errors.

references/example-component.md

Complete end-to-end example showing a Feature Card component with:

  • Full components.json definition
  • Matching PHTML template with all field types
  • Supporting module files (registration.php, module.xml, composer.json)
  • Directory structure overview

Read this file when you need a reference for how all the pieces fit together.

references/component-schema.md

Complete schema reference for component declarations, auto-generated from the Hyvä CMS JSON schema. Includes:

  • Valid component-level properties
  • Field declaration properties
  • All field types
  • Validation attributes

Read this file when validating component structure or when encountering schema validation errors.

Run scripts/update_component_schema.php after Hyvä CMS updates to regenerate.

references/field-types.md

Complete reference for all supported field types including:

  • Field configuration syntax
  • All available field types with examples
  • Validation attributes
  • Conditional visibility (show_if/hide_if)
  • Field presets for common patterns

Read this file when generating field configurations.

references/variant-support.md

Guide for implementing template variants including:

  • Directory structure for variant templates
  • Variant field configuration in components.json
  • Template implementation patterns
  • Common variant patterns and best practices

Read this file when the user wants multiple layout options for a component.

references/troubleshooting.md

Solutions for common issues including:

  • Schema validation errors
  • Component not visible in editor
  • Template not rendering
  • Live editor not working
  • Image display issues
  • Fallbacks when dependent skills are unavailable

Read this file when encountering errors during component creation or testing.

scripts/update_component_schema.php

PHP script that reads the Hyvä CMS JSON schema files and regenerates references/component-schema.md. Run after upgrading hyva-themes/commerce-module-cms to ensure documentation stays current.

assets/templates/component/template.phtml.tpl

Base PHTML structure for CMS components.

Placeholders:

  • {{CONTENT_FIELDS}} - PHP variable declarations
  • {{TEMPLATE_BODY}} - HTML template content

Important Guidelines

  1. Always use getEditorAttrs() on the root element and on each editable field element
  2. Never use <script> tags in templates - use Alpine.js via alpine:init event
  3. Escape all user content with appropriate escaper methods
  4. Use meaningful default values for better merchant experience
  5. Include design/advanced sections via includes for consistency
  6. Validate component names are snake_case with only lowercase letters, numbers, and underscores
  7. CRITICAL: Use default_value key, NOT default - The correct JSON key for default values is default_value (with underscore), not default. Example: "default_value": "My Title" ✅, NOT "default": "My Title" ❌
  8. CRITICAL: children is a root-level property, NOT a field type - Never use "type": "children" in content/design/advanced. Declare children at component root level. Access via $block->getData('children') in templates.
  9. CRITICAL: Validation goes in attributes, NOT as direct properties - Use "attributes": {"required": true} ✅, NOT "required": true ❌. All HTML5 validation attributes (required, minlength, maxlength, pattern, min, max) must be inside the attributes object.

平台分布

Codex

35.93%
按下载量换算822

Claude

33.69%
按下载量换算771

Cursor

18.8%
按下载量换算430

Gemini CLI

9.46%
按下载量换算217

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-cms-component 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills