Token导航 LogoToken导航

Agent Skill · 研究检索

hyva-cms-custom-field(海沃 CMS 自定义字段)

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

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

总安装 6,977周安装 285GitHub Stars 65下载 2,257核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

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

这个 Skill 是做什么的

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

hyva-cms-custom-field 用于查找、检索和筛选相关信息,支持基于关键词的任务场景定位。适用于自定义字段配置、数据模型扩展和表单设计相关查询。可在 Codex、Claude、Cursor、Gemini CLI 中快速获取候选结果。需确认权限范围和维护状态,避免触发联网或文件读写操作。

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

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

上手步骤

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-cus…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

hyva-cms-custom-field 怎么安装?

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

hyva-cms-custom-field 支持哪些 AI 工具?

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

hyva-cms-custom-field 需要什么权限?

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

hyva-cms-custom-field 是免费的吗?

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

hyva-cms-custom-field 用的人多吗?

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

hyva-cms-custom-field 安全吗?

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

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

值得选的地方

  • 同时适配 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-custom-field

海沃 CMS 自定义字段 · 本页

6,97765执行命令未明确通过

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

SKILL.md 原文

Hyvä CMS Custom Field Type Creator

Overview

This skill guides the creation of custom field types and field handlers for Hyvä CMS components. Custom field types extend the built-in field types (text, textarea, select, etc.) with specialized input controls for the CMS editor interface.

Two types of custom fields:

  1. Basic Custom Field Type: Custom input control with direct data entry (e.g., date range, color picker, custom validation)
  2. Field Handler: Enhanced UI with complex interactions (e.g., product selector with images, searchable dropdown, link configuration modal)

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, determine where to create the custom field type:

Option A: New Module

Use the hyva-create-module skill with:

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

Option B: Existing Module

Verify the module has required dependencies:

  • Hyva_CmsBase and Hyva_CmsLiveviewEditor in etc/module.xml
  • hyva-themes/commerce-module-cms in composer.json

Add missing dependencies if needed.

Step 2: Field Type Details

Gather information about the custom field type:

  1. Field type name (lowercase identifier, e.g., date_range, product_selector, color_picker)
  2. Purpose (what data does it collect?)
  3. UI pattern:

- Basic field: Simple input with validation (date picker, pattern input, enhanced text field) - Inline handler: Enhanced control in field area (searchable dropdown, color picker) - Modal handler: Separate dialog for complex selection (product selector, link builder, media gallery)

  1. Data structure (simple string, JSON object, array?)
  2. Validation requirements (pattern, required, custom rules?)

Step 3: Implementation Pattern Selection

Based on the UI pattern identified in Step 2:

Pattern A: Basic Custom Field Type

For simple inputs with custom HTML5 validation or specialized input controls:

  • Single template file for the field
  • No separate handler modal
  • Example: Date range selector, custom pattern validation, slider input

Pattern B: Inline Field Handler

For enhanced controls that remain in the field area:

  • Single template file with Alpine.js component
  • No separate handler modal
  • Example: Searchable select dropdown, color picker with swatches

Pattern C: Modal-Based Field Handler

For complex selection interfaces requiring more space:

  • Field template (displays selection + trigger button)
  • Handler modal template (separate dialog with full UI)
  • Layout XML registration for the handler
  • Example: Product selector, link configuration, media gallery

See references/handler-patterns.md for detailed implementation patterns and code examples for each type.

Step 4: Generate Field Template

Create the field template at view/adminhtml/templates/field-types/[field-type-name].phtml.

Required template elements:

  1. Field container with proper ID: field-container-{uid}_{fieldName}
  2. Input element(s) with name: {uid}_{fieldName}
  3. Validation messages container: validation-messages-{uid}_{fieldName}
  4. updateWireField() or updateField() call on value change
  5. Error state handling via $magewire->errors
  6. IMPORTANT: Use null coalescing for field value: $block->getData('value')?? '' (NOT type casting)

Use the appropriate template from assets/templates/:

  • basic-field.phtml.tpl - Basic custom field type
  • inline-handler.phtml.tpl - Inline enhanced control
  • modal-field.phtml.tpl - Modal handler field template

See references/template-requirements.md for detailed template requirements and patterns.

Step 5: Generate Handler Modal (if needed)

For modal-based handlers only, create the handler template at view/adminhtml/templates/handlers/[handler-name]-handler.phtml.

Handler modal structure:

  1. <dialog> element with Alpine.js component and open:flex class (NOT static flex)
  2. Listen for initialization event from field template
  3. Implement selection UI (search, filters, grid, etc.)
  4. Dispatch editor-change event on save

Use assets/templates/modal-handler.phtml.tpl as the starting point.

See references/handler-communication.md for event protocols and data exchange patterns.

Step 6: Register Field Type

Add registration to etc/adminhtml/di.xml:

<type name="Hyva\CmsLiveviewEditor\Model\CustomField">
    <arguments>
        <argument name="customTypes" xsi:type="array">
            <item name="[field_type_name]" xsi:type="string">
                [Vendor]_[Module]::field-types/[field-type-name].phtml
            </item>
        </argument>
    </arguments>
</type>

Step 7: Register Handler Modal (if needed)

For modal-based handlers only, create or update view/adminhtml/layout/liveview_editor.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="before.body.end">
            <block name="[handler_name]_handler"
                   template="[Vendor]_[Module]::handlers/[handler-name]-handler.phtml"/>
        </referenceContainer>
    </body>
</page>

Note: Inline handlers do NOT require layout XML registration.

Step 8: Usage Example

Provide an example of using the custom field type in components.json:

{
    "my_component": {
        "label": "My Component",
        "content": {
            "[field_name]": {
                "type": "custom_type",
                "custom_type": "[field_type_name]",
                "label": "Field Label",
                "attributes": {
                    "required": true,
                    "pattern": ".*"
                }
            }
        }
    }
}

Resources

references/template-requirements.md

Complete reference for custom field type template requirements:

  • Required markup patterns and element IDs
  • Field container structure
  • Validation message containers
  • Field value update methods (updateWireField vs updateField)
  • HTML5 validation attributes
  • Error state handling

Read this file when implementing the field template to ensure proper integration with the CMS editor.

references/handler-patterns.md

Implementation patterns for all three custom field types:

  • Basic custom field type (simple input)
  • Inline field handler (enhanced control)
  • Modal-based field handler (dialog selection)

Each pattern includes:

  • Complete code examples
  • When to use each pattern
  • Alpine.js component structure
  • Data flow and state management

Read this file when selecting the implementation pattern and writing the template code.

references/handler-communication.md

Event protocols and data exchange for field handlers:

  • Initialization event structure
  • Save event structure
  • Field value encoding/decoding
  • Error handling patterns
  • Common pitfalls and solutions

Read this file when implementing handler modals to understand the communication protocol.

references/built-in-handlers.md

Reference for Hyvä CMS built-in field handlers:

  • Product Handler (modal-based, image grid selection)
  • Link Handler (modal-based, multi-type link config)
  • Searchable Select (inline enhanced dropdown)

Each includes:

  • Location in Hyvä CMS module
  • Key features and patterns
  • Usage examples
  • Code to examine for patterns

Read this file when looking for implementation examples or patterns to copy.

assets/templates/basic-field.phtml.tpl

Template for basic custom field types with custom validation or input controls.

Placeholders:

  • {{FIELD_TYPE_NAME}} - Custom field type identifier
  • {{FIELD_INPUTS}} - Input element(s) HTML
  • {{VALIDATION_LOGIC}} - Custom validation JavaScript (optional)

assets/templates/inline-handler.phtml.tpl

Template for inline enhanced controls (searchable dropdown, color picker, etc.).

Placeholders:

  • {{HANDLER_NAME}} - Alpine.js component name
  • {{HANDLER_LOGIC}} - Alpine.js component implementation
  • {{HANDLER_UI}} - Enhanced control HTML

assets/templates/modal-field.phtml.tpl

Field template for modal-based handlers (trigger button + hidden input).

Placeholders:

  • {{EVENT_NAME}} - Custom event name to dispatch
  • {{BUTTON_LABEL}} - Button text
  • {{DISPLAY_VALUE}} - Current selection display

assets/templates/modal-handler.phtml.tpl

Handler modal template for modal-based selection interfaces.

Placeholders:

  • {{HANDLER_NAME}} - Alpine.js component name
  • {{MODAL_TITLE}} - Dialog header text
  • {{SELECTION_UI}} - Selection interface HTML
  • {{SAVE_LOGIC}} - Save button logic

Important Guidelines

Core Requirements

  1. Template Requirements: All custom field types must follow required markup patterns (container ID, input name, validation messages)
  2. Handler Registration: Modal handlers need layout XML registration; inline handlers do not
  3. Validation: Apply HTML5 validation attributes via $filteredAttributes for automatic validation
  4. Alpine Components: If using custom Alpine components, keep input fields outside the component and update via vanilla JS
  5. Built-In Examples: Reference built-in handlers in Hyva_CmsLiveviewEditor::page/js/ for proven patterns

Accurate Patterns from Codebase

Based on built-in Hyvä CMS handler implementations:

  1. Event Naming Convention: Use toggle-{type}-select pattern

- ✅ Correct: toggle-product-select, toggle-link-select, toggle-category-select - ❌ Incorrect: toggle-product-handler, toggle-link-handler

  1. Handler Function Naming: Use init{Type}Select() pattern

- ✅ Examples: initProductSelect(), initLinkSelect(), initCategorySelect()

  1. Field Value Update Methods:

- Use updateWireField (default): Products, Link, Category handlers - Triggers immediate server-side validation via Magewire - Keeps component state synchronized - Use updateField (specialized): Image handler, debounced inputs (color, range) - Updates preview without server round-trip - Defers validation until save

  1. JSON Encoding Pattern: All complex data (arrays, objects) must be JSON-encoded // Field template value="<?= $escaper->escapeHtmlAttr(json_encode($fieldValue))?>" // Handler initialization const data = JSON.parse(fieldValue); // @change handler @change="updateWireField(..., JSON.parse($event.target.value))"
  2. wire:ignore for Livewire Compatibility: Searchable select uses wire:ignore wrapper <div wire:ignore> <div x-data="initSearchableSelect(...)"> <!-- Alpine component --> </div> </div>
  3. Separate Handler Files: Even inline handlers may have separate function files

- Field template: liveview/field-types/searchable_select.phtml - Handler function: page/js/searchable-select-handler.phtml

  1. Icons View Model: Use for UI elements /** @var Icons $icons */ $icons = $viewModels->require(Icons::class); <?= /** @noEscape */ $icons->trashHtml('', 22, 22)?>
  2. FieldTypes View Model: Use for attribute filtering /** @var FieldTypes $fieldTypes */ $fieldTypes = $viewModels->require(FieldTypes::class); $filteredAttributes = $fieldTypes->getDefinedFieldAttributes($attributes); // Or for specific attributes: $filteredAttributes = $fieldTypes->getAttributesByKeys($attributes, ['required', 'data-required']);
  3. CRITICAL: Layout XML referenceContainer: Handler modals MUST use before.body.end container

- ✅ Correct: <referenceContainer name="before.body.end"> - ❌ Incorrect: <referenceContainer name="content"> - The before.body.end container ensures the handler modal is loaded at the end of the page body, which is required for proper Alpine.js initialization and modal functionality

  1. CRITICAL: Field Value Type Handling: NEVER use type casting for field values, always use null coalescing operator
  • ✅ Correct: $fieldValue = $block->getData('value')?? '';
  • ❌ Incorrect: $fieldValue = (string) $block->getData('value');
  • Type casting (string) will fail when value is null, causing PHP errors
  • Use ?? '' for string values, ?? [] for array values, or appropriate default for your data type
  • Reference: See built-in field types like category.phtml which use ?? [] pattern
  1. CRITICAL: Dialog Modal Classes: Handler modals must use open:flex not static flex class
  • ✅ Correct: <dialog class="... open:flex flex-col">
  • ❌ Incorrect: <dialog class="... flex flex-col"> (modal always visible)
  • The open: prefix applies styles only when dialog is open (native HTML dialog state)
  • Reference: See built-in handlers like category-handler.phtml which use open:flex flex-col
  1. CRITICAL: Complex Data Type Handling: For fields storing JSON/array data, handle BOTH array and string types
  • Field values may be returned as already-decoded arrays OR as JSON strings (depends on storage/context)
  • ✅ Correct pattern: $data = ['default' => 'structure']; if ($fieldValue) {if (is_array($fieldValue)) {$data = $fieldValue; // Already decoded} elseif (is_string($fieldValue)) {$decoded = json_decode($fieldValue, true); if (is_array($decoded)) {$data = $decoded;}}} // When outputting to hidden input, ALWAYS ensure it's a JSON string $fieldValueJson = is_array($fieldValue)? json_encode($fieldValue): $fieldValue;
  • ❌ Incorrect: json_decode($fieldValue) without type checking (fails if value is already an array)
  • ❌ Incorrect: Using array directly in value attribute without JSON-encoding first

平台分布

Codex

38.68%
按下载量换算873

Claude

29.61%
按下载量换算668

Cursor

19.86%
按下载量换算448

Gemini CLI

8.52%
按下载量换算192

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

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

安装前确认

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

继续浏览同类 Skills