# hyva-render-media-image

Writes responsive <picture> markup for Hyvä Theme templates through the Media view model. Useful when mobile and desktop need different image sources.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1300 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-render-media-image/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/hyva-render-media-image

## What it does

The skill points the agent at `\Hyva\Theme\ViewModel\Media` and builds a `getResponsivePictureHtml()` call from your data. You supply an array of image configs, attributes for the `<img>` tag (alt, class, loading, fetchpriority) and attributes for the `<picture>` wrapper. The agent then picks the right pattern: a single image with literal values, one pulled from a PHP variable, several images from an array, or separate sources behind media queries.

Loading strategy follows the image's role. A hero or any above-the-fold image gets `'loading' => 'eager'` with `'fetchpriority' => 'high'`; everything further down gets `'loading' => 'lazy'`. That split matters for LCP and CLS, so don't ask for lazy loading on the image that fills the first screen.

Have the file path inside `pub/media/` and its pixel dimensions ready before you start — the config can't be assembled without them. When the image comes from a PHP variable, the skill tells you which array shape it expects and points to `references/rendering-images.md`, where the full API reference lives.

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

2. **Manually: put the files in place**
- File: `.cursor/skills/hyva-render-media-image/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-render-media-image
```

2. **Manually: put the files in place**
- File: `.github/skills/hyva-render-media-image/SKILL.md`

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -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-render-media-image/SKILL.md

## When to use it
- build a `<picture>` with separate mobile and desktop sources
- render a hero banner with priority loading
- drop a product image into a Hyvä PHTML template
- switch below-the-fold images to lazy loading
- set alt text and classes on both `<img>` and the `<picture>` wrapper

## Example prompts
- Render a responsive hero from `wysiwyg/hero.jpg`, 1920x800, with a different file for mobile
- Output the product image from `$imageData` in my Hyvä template
- Add a below-the-fold image with lazy loading and alt text

## 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
