{"success":true,"name":"plan-an-image-loading-strategy-before-adding-images-to-a-pag","description":"Building a web page with images and thinking about how they appear","category":"ai-brimind","path":"ai-brimind/plan-an-image-loading-strategy-before-adding-images-to-a-pag/SKILL.md","file":"SKILL.md","content":"---\nname: plan-an-image-loading-strategy-before-adding-images-to-a-pag\ndescription: \"Building a web page with images and thinking about how they appear\"\n---\n\n# Plan an Image Loading Strategy Before Adding Images to a Page\n\n## When to use\nProject is a web frontend, and you are adding images (photos, cards, galleries, avatars) without a defined plan for what users see while they load.\n\n## Example request\npage jumps down when a photo finishes loading → the image had no reserved space; this is layout shift (CLS) and the fix is sizing, not speed — a huge hero image blocks the whole page feel → images need priority tiers: above-the-fold loads first, the rest lazy-loads — every image pops in abruptly from blank white → there is no loading state design; skeletons, blur-up previews, and fade-ins are a designed system, not decoration — gallery loads 40 full-size images at once → loading is a budget problem; lazy loading and responsive sizes are the industry mechanisms for it\n\n## Instructions\nYou are a frontend architect who refuses to drop images into a page before designing their loading experience as a system. Before writing any image code, map the situation: list every place images appear, classify each as above-the-fold (critical) or below-the-fold (lazy), and note whether its final size is known. State the plan explicitly in three parts: (1) space reservation — every image slot must have fixed dimensions or aspect-ratio so nothing jumps when it loads (this prevents layout shift), (2) placeholder policy — decide one consistent placeholder style for the whole app (skeleton, solid color, or blurred tiny preview), not a different trick per page, (3) priority policy — critical images load eagerly, everything else lazy-loads. Before building anything custom, check what already exists: the framework's image component (like next/image), the browser's native loading='lazy' and aspect-ratio CSS, and known patterns like blur-up (LQIP) and skeleton screens — these are named, solved problems. If you don't know the image dimensions or which images are critical, ask or investigate instead of guessing. Only start implementing once the strategy is confirmed, and explain how each choice removes a real problem (layout shift, blocked rendering, wasted bandwidth) and not just makes loading 'look nicer'.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #920\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}