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.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionhyva-cms-custom-fieldExecute the skills CLI command in your project's root directory to begin installation:
Fetches hyva-cms-custom-field from hyva-themes/hyva-ai-tools and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate hyva-cms-custom-field. Access via /hyva-cms-custom-field in your agent's command palette.
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 environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
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
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
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
0
total installs
0
this week
60
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
60
stars
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:
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.
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.xmlhyva-themes/commerce-module-cms in composer.jsonAdd missing dependencies if needed.
Gather information about the custom field type:
date_range, product_selector, color_picker)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:
Pattern B: Inline Field Handler
For enhanced controls that remain in the field area:
Pattern C: Modal-Based Field Handler
For complex selection interfaces requiring more space:
See references/handler-patterns.md for detailed implementation patterns and code examples for each type.
Create the field template at view/adminhtml/templates/field-types/[field-type-name].phtml.
Required template elements:
field-container-{uid}_{fieldName}{uid}_{fieldName}validation-messages-{uid}_{fieldName}updateWireField() or updateField() call on value change$magewire->errors$block->getData('value') ?? '' (NOT type casting)Use the appropriate template from assets/templates/:
basic-field.phtml.tpl - Basic custom field typeinline-handler.phtml.tpl - Inline enhanced controlmodal-field.phtml.tpl - Modal handler field templateSee references/template-requirements.md for detailed template requirements and patterns.
For modal-based handlers only, create the handler template at view/adminhtml/templates/handlers/[handler-name]-handler.phtml.
Handler modal structure:
<dialog> element with Alpine.js component and open:flex class (NOT static flex)editor-change event on saveUse assets/templates/modal-handler.phtml.tpl as the starting point.
See references/handler-communication.md for event protocols and data exchange patterns.
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>
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.
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": ".*"
}
}
}
}
}
Complete reference for custom field type template requirements:
updateWireField vs updateField)Read this file when implementing the field template to ensure proper integration with the CMS editor.
Implementation patterns for all three custom field types:
Each pattern includes:
Read this file when selecting the implementation pattern and writing the template code.
Event protocols and data exchange for field handlers:
Read this file when implementing handler modals to understand the communication protocol.
Reference for Hyvä CMS built-in field handlers:
Each includes:
Read this file when looking for implementation examples or patterns to copy.
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)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 HTMLField 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 displayHandler 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$filteredAttributes for automatic validationHyva_CmsLiveviewEditor::page/js/ for proven patternsBased on built-in Hyvä CMS handler implementations:
Event Naming Convention: Use toggle-{type}-select pattern
toggle-product-select, toggle-link-select, toggle-category-selecttoggle-product-handler, toggle-link-handlerHandler Function Naming: Use init{Type}Select() pattern
initProductSelect(), initLinkSelect(), initCategorySelect()Field Value Update Methods:
updateWireField (default): Products, Link, Category handlers
updateField (specialized): Image handler, debounced inputs (color, range)
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))"
wire:ignore for Livewire Compatibility: Searchable select uses wire:ignore wrapper
<div wire:ignore>
<div x-data="initSearchableSelect(...)">
<!-- Alpine component -->
</div>
</div>
Separate Handler Files: Even inline handlers may have separate function files
liveview/field-types/searchable_select.phtmlpage/js/searchable-select-handler.phtmlIcons View Model: Use for UI elements
/** @var Icons $icons */
$icons = $viewModels->require(Icons::class);
<?= /** @noEscape */ $icons->trashHtml('', 22, 22) ?>
FieldTypes View Model: Use for attribute filtering
Make data-driven prioritization decisions faster
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
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ 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.
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
ailabs-393/ai-labs-claude-skills
pproenca/dot-skills
mattpocock/skills
hyva-cms-custom-field fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Useful defaults in hyva-cms-custom-field — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
hyva-cms-custom-field has been reliable in day-to-day use. Documentation quality is above average for community skills.
We added hyva-cms-custom-field from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
I recommend hyva-cms-custom-field for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Solid pick for teams standardizing on skills: hyva-cms-custom-field is focused, and the summary matches what you get after install.
hyva-cms-custom-field reduced setup friction for our internal harness; good balance of opinion and flexibility.
I recommend hyva-cms-custom-field for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
hyva-cms-custom-field is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Solid pick for teams standardizing on skills: hyva-cms-custom-field is focused, and the summary matches what you get after install.
showing 1-10 of 29