plugins/astro-expert/skills/astro-assets/SKILL.md
Image and asset optimization in Astro 7 — <Image />, <Picture />, getImage(), remote images, @astrojs/sharp, Fonts API, OG image generation with Satori, Cloudinary/Imgix. Use for any image optimization or asset handling task.
npx skillsauth add fusengine/agents astro-assetsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Production-ready image optimization and asset management with astro:assets in Astro 7.
Before ANY implementation, use TeamCreate to spawn 3 agents:
After implementation, run fuse-ai-pilot:sniper for validation.
| Module | Exports |
|--------|---------|
| astro:assets | <Image />, <Picture />, getImage() |
| @astrojs/sharp | Default image processing service |
| Fonts API (stable, Astro 6.0+) | Built-in fonts config |
<Image /> automatically optimizes local and remote images. Always provide alt. Use priority for above-the-fold images. Defaults to WebP output.
<Picture /> generates <source> elements for multiple formats. Use formats={['avif', 'webp']} for best compression with fallback.
For server-side image generation (API routes, CSS background images). Returns { src, attributes } object.
Built-in font optimization via the top-level fonts config in astro.config.mjs (stable since Astro 6.0 — no experimental flag). Zero layout shift, automatic preloading, supports Google Fonts and local fonts.
| Topic | Reference | When to Consult | |-------|-----------|-----------------| | Image Component | image-component.md | Local/remote image display | | Responsive Images | picture-responsive.md | Multi-format, srcset, sizes | | Remote Images | remote-images.md | External URLs, inferSize | | Fonts API | fonts-api.md | Zero-CLS font loading | | OG with Satori | og-satori.md | Dynamic OG image generation | | CDN Integration | cdn-integration.md | Cloudinary, Imgix setup |
| Template | When to Use | |----------|-------------| | image-setup.md | Full image optimization setup | | og-image-route.md | Dynamic OG image API route |
alt - Required for accessibility and SEOpriority for LCP - Above-the-fold images load eagerlyinferSize for remote - Avoids layout shift without known dimensionstesting
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.