imagery
Installation
SKILL.md
Site Imagery
Use this skill whenever a design calls for images — hero/cover backgrounds, feature, gallery, or card images, team photos, product shots — and before every generate_images call.
Workflow
- Plan all imagery first. While planning a page or theme, list every image it needs: filename, subject, placement, aspect ratio. Call
generate_imagesBEFORE writing the markup that references them: it returns each image's path, attachment ID, and URL at once and generates the images in the background, so write the markup right away. - Pick the destination by where the image is shown: the file that holds its markup decides, not what the image depicts.
- Content imagery: every image shown by page or post content, including a page's hero or cover, section images, products, team photos, and galleries. Write to
<site>/wp-content/uploads/<name>.webp. The tool adds every image underwp-content/uploads/to the media library and reports its attachment ID and URL: use the URL as thesrcand the ID in the block attrs (e.g.wp:image {"id":<id>,"sizeSlug":"large"}). - Theme imagery: only images shown by theme files, meaning a template, a template part such as the header or footer, or
style.css. Write to<site>/wp-content/themes/<theme-slug>/assets/images/<name>.webpand reference it in markup as/wp-content/themes/<theme-slug>/assets/images/<name>.webp. It stays in the theme and never goes into the media library. One call can mix both: each image goes where its path says. A one-page site builds its sections in the page content, so its images, hero included, are content imagery.
- Content imagery: every image shown by page or post content, including a page's hero or cover, section images, products, team photos, and galleries. Write to
- Batch aggressively. One
generate_imagescall per page (or per site for small sites) with every image in theimagesarray — generation is concurrent server-side. Never one call per image. The site's set from the design steps below is the first batch: use it before generating anything else. - Write real alt text. Generated images are content: give every
<img>a short, descriptive alt in the markup (what the image shows, for a person who cannot see it). Never leave a spec string or an empty alt on a content image; cover backgrounds keep an empty alt (decorative).
Writing the spec fields
Every image in the images array takes path, subject, pageContext, style, aspectRatio. The call also takes a shared siteContext and imageGrade.