hyva-render-media-image — Claude Code skill: responsive Hyvä images
Writes responsive <picture> markup for Hyvä Theme templates through the Media view model. Useful when mobile and desktop need different image sources.
npx skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -a claude-codeWhat hyva-render-media-image 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.
What it helps with
- 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 for the agent
- Render a responsive hero from
wysiwyg/hero.jpg, 1920x800, with a different file for mobile - Output the product image from
$imageDatain my Hyvä template - Add a below-the-fold image with lazy loading and alt text
How to install hyva-render-media-image
1Skills CLI (Vercel)
npx skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -a claude-code2Manually: put the files in place
~/.claude/skills/hyva-render-media-image/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/hyva-render-media-image/
1Skills CLI (Vercel)
npx skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -a codex2Manually: put the files in place
.agents/skills/hyva-render-media-image/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -a cursor2Manually: put the files in place
.cursor/skills/hyva-render-media-image/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hyva-themes/hyva-ai-tools hyva-render-media-image2Manually: put the files in place
.github/skills/hyva-render-media-image/SKILL.md1Skills CLI (Vercel)
npx skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -a gemini-cli2Platform CLI
gemini skills install https://github.com/hyva-themes/hyva-ai-tools --path skills/hyva-render-media-imageManually: put the files in place
.devin/skills/hyva-render-media-image/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about hyva-render-media-image
How do I install hyva-render-media-image in Claude Code?
Run npx skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -a claude-code. The skill lands at ~/.claude/skills/hyva-render-media-image/SKILL.md.
What does hyva-render-media-image do?
It generates responsive <picture> code for Hyvä Theme templates using the \Hyva\Theme\ViewModel\Media view model. The agent calls getResponsivePictureHtml() with your image configs and attributes.
What do I need before using the skill?
The image path inside pub/media/ and its width and height in pixels. If the image comes from a PHP variable, you also need the array structure — its format is documented in references/rendering-images.md.