/harness-claude:next-image-optimizationfrom harness-claude
Optimizes images in Next.js apps using next/image for automatic sizing, format conversion, and lazy loading to improve Core Web Vitals.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:next-image-optimization still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Serve optimized, correctly sized images automatically with next/image
Image from next/image instead of the HTML <img> tag for all content images.width and height props for images with known dimensions to prevent layout shift (CLS).fill prop with a positioned parent (position: relative) for images that should fill their container — omit width and height when using fill.priority to the first image visible in the viewport (the LCP element) to disable lazy loading and preload it.sizes prop to tell the browser how wide the image will be at each breakpoint — this enables accurate srcset selection.images.remotePatterns in next.config.ts before using external image URLs.placeholder="blur" with blurDataURL for a low-quality preview while the image loads.blurDataURL automatically — import logo from './logo.png' and pass the imported object.// next.config.ts
const config = {
images: {
remotePatterns: [
{ protocol: 'https', hostname: 'cdn.example.com', pathname: '/images/**' },
],
},
};
// app/products/[id]/page.tsx
import Image from 'next/image';
import heroImage from '@/public/hero.jpg'; // static import — dimensions known
export default function ProductPage() {
return (
<div>
{/* Static import — auto blur placeholder, auto width/height */}
<Image src={heroImage} alt="Hero" priority placeholder="blur" />
{/* Remote image — fill mode for responsive container */}
<div className="relative h-64 w-full">
<Image
src="https://cdn.example.com/images/product.jpg"
alt="Product"
fill
sizes="(max-width: 768px) 100vw, 50vw"
className="object-cover"
/>
</div>
</div>
);
}
next/image wraps the HTML <img> element with automatic size optimization, format conversion, and lazy loading. The optimization pipeline runs server-side: Next.js resizes and converts images to WebP or AVIF on first request and caches the result.
sizes attribute importance: Without sizes, the browser assumes the image is 100vw wide and downloads a larger source than necessary. Providing accurate sizes (e.g., "(max-width: 640px) 100vw, 640px") reduces bandwidth significantly.
fill mode: Use fill when the image dimensions are unknown or when the image should fill a CSS-controlled container. The parent must have position: relative (or absolute/fixed). Use className="object-cover" or className="object-contain" on the Image to control aspect ratio.
priority vs lazy: All images are lazy-loaded by default (loaded when they enter the viewport). The priority prop disables lazy loading and adds a <link rel="preload"> — use it for the LCP image only. Adding priority to multiple images defeats its purpose.
Layout shift (CLS): Providing width and height lets the browser reserve space before the image loads, preventing layout shift. The fill prop avoids this by letting CSS control the container dimensions.
Remote patterns: The remotePatterns config (replacing the deprecated domains) supports wildcards and pathnames. Misconfigured patterns cause 400 errors on image optimization requests.
https://nextjs.org/docs/app/api-reference/components/image
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job