# hyva-cms-component

Walks you through building a custom Hyvä CMS component for Magento 2: module, fields, PHTML template and setup:upgrade.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 762 installs · ★ 85
- Author: hyva-themes
- License: OSL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hyva-themes/hyva-ai-tools/tree/HEAD/skills/hyva-cms-component/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/hyva-cms-component

## What it does

The skill covers the whole path from picking a module to writing files. You name the component, give it a label and category, choose fields, and it produces `components.json` plus a PHTML template. Both new and existing modules are supported. For an existing one it checks that `etc/module.xml` lists `Hyva_CmsBase` and that `composer.json` requires `hyva-themes/commerce-module-cms`, adding either if missing.

Field types come from the project itself when possible: the skill runs `bin/magento hyva:cms:list-fields` through the `hyva-exec-shell-cmd` wrapper and only falls back to `references/field-types.md` when that command is not there. Icons are picked from the lucide set, skipping any already taken by another component — the skill dumps current components first to know which ones those are. Presets cover Basic Card, Image Card, CTA Block, Text Block, Feature Item, Testimonial and Accordion Item.

Watch the `children` property. It belongs at the component level, not inside `content` as a field type; put it in the wrong place and the schema rejects the file. Child-only components use `require_parent: true` instead. Four companion skills do the heavy lifting — `hyva-exec-shell-cmd`, `hyva-create-module`, `hyva-cms-components-dump` and `hyva-render-media-image` — so the environment and icon steps depend on them being installed.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-cms-component -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/hyva-cms-component/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/hyva-cms-component/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-cms-component -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/hyva-cms-component/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-cms-component -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/hyva-cms-component/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install hyva-themes/hyva-ai-tools hyva-cms-component
```

2. **Manually: put the files in place**
- File: `.github/skills/hyva-cms-component/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-cms-component -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/hyva-themes/hyva-ai-tools --path skills/hyva-cms-component
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/hyva-cms-component/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-cms-component -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hyva-themes/hyva-ai-tools/tree/HEAD/skills/hyva-cms-component/SKILL.md

## When to use it
- scaffold a Hyvä CMS component inside a new Magento 2 module
- add a CMS component to a module you already have
- define component fields in `components.json` without schema errors
- find a lucide icon no other component uses
- set up template variants and child components

## Example prompts
- Create a Hyvä CMS component `feature_card` with fields for a heading and an image
- Add a new CMS component to the `Acme_CmsComponents` module
- Build a custom Hyvä CMS element with default and compact variants

## Similar
- [frontend-design](https://affpapa.org/en/nevibecode/skills/frontend-design.md) — skill · 1025790 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs
- [prototype](https://affpapa.org/en/nevibecode/skills/prototype.md) — skill · 986201 installs
- [hyperframes](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes.md) — skill · 1200000 installs
- [hyperframes-cli](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes-cli.md) — skill · 1300000 installs
- [webapp-testing](https://affpapa.org/en/nevibecode/skills/webapp-testing.md) — skill · 186758 installs

From the same set: [hyva-themes/hyva-ai-tools](https://affpapa.org/en/nevibecode/by/hyva-themes/hyva-ai-tools.md) — 12 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
