responsive-image-delivery
Skill0 starsChanged 4 months agoISCView on GitHub
Audit and optimize adopted web image assets without changing art direction. Use after mockup-to-code or another visual implementation has selected final imagery, especially when pages risk multi-megabyte images, missing intrinsic dimensions, weak LCP delivery, invalid or misleading srcset/sizes, upscaled variants, or absent HTML integration evidence.
In this repository11 other files it gives its agents.
- mockup-to-codeSkill
- design-copy-structureSkill
- design-motion-sequencingSkill
- design-whitespaceSkill
- lp-interaction-qaSkill
- photo-art-directionSkill
- raster-texture-reconstructionSkill
- seamless-section-wavesSkill
- typographySkill
- visual-device-inventorySkill
- visual-qa-pixel-polishSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
After a pass, emit the parent manifest receipt from the mockup work root and store it at specialistReports.mediaDelivery:
- Very specific: line 63
Write derivatives only beneath the explicit --output-dir.
- Distinctive: line 65
Treat AVIF/WebP as capability-dependent.
- Distinctive: line 68
Do not change focal point, crop, overlays, lettering, or other art direction.
- Distinctive: line 74
Run focused tests with:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Responsive Image Delivery
Turn approved raster assets into measured responsive delivery. Preserve composition, crop, aspect ratio, color profile, and source files.
Workflow
- Identify the actual page image set and explicitly name every likely LCP asset. Do not guess LCP from filename alone.
Record codec support before choosing formats:
SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}" "$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" \ "$SKILL_ROOT/responsive-image-delivery/scripts/media_delivery.py" capabilitiesGenerate derivatives only with an explicit output directory. Keep originals outside that directory and never overwrite them:
SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}" "$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" \ "$SKILL_ROOT/responsive-image-delivery/scripts/media_delivery.py" optimize \ --input public/images/hero.jpg \ --output-dir public/images/generated \ --widths 480,768,1024,1440,1920 \ --formats auto \ --report work/media-delivery-optimize.json- Integrate generated files into
<picture>/<img>. Derivesizesfrom the implemented layout at each breakpoint; never use100vwas an unverified placeholder. Keepwidthandheightattributes at the correct aspect ratio. For LCP images, usefetchpriority="high"and do not useloading="lazy". Audit the real HTML and delivery directory. A pass requires resolved
srcsetwidth candidates, a non-emptysizes, intrinsic-ratio evidence, declared LCP behavior, budget compliance, and no upscaling:SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}" "$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" \ "$SKILL_ROOT/responsive-image-delivery/scripts/media_delivery.py" audit \ --input public/images/hero.jpg \ --variant-dir public/images/generated \ --html out/index.html \ --lcp public/images/hero.jpg \ --report work/media-delivery-report.json- Validate the report against media-delivery-report-v1.schema.json. If inspection or generation cannot run, copy media-delivery-report.blocked.json, fill its blocker, and do not claim pass.
After a pass, emit the parent manifest receipt from the mockup work root and store it at
specialistReports.mediaDelivery:SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}" "$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" \ "$SKILL_ROOT/responsive-image-delivery/scripts/media_delivery.py" receipt \ --report work/media-delivery-report.json --root .Non-passing reports cannot emit
{contract,path,sha256}.
Hard rules
- Preserve every original byte-for-byte. The optimizer hashes each source before and after generation.
- Write derivatives only beneath the explicit
--output-dir; refuse conflicting existing files unless--overwriteis passed. - Resize proportionally with no crop and never emit or declare a candidate wider or taller than its source.
- Treat AVIF/WebP as capability-dependent. Report read/write support and fall back to JPEG for opaque images or PNG for alpha; never relabel bytes with a different extension.
- Apply file-size and dimension budgets to files actually delivered by HTML. Apply the stricter LCP byte budget to every declared LCP candidate.
- Require width descriptors (
320w), resolvable candidate files, and truthful descriptor-to-intrinsic-width equality. Do not accept density descriptors as responsive-width evidence. - Do not change focal point, crop, overlays, lettering, or other art direction. Escalate those changes back to visual design.
Tool contract
scripts/media_delivery.py uses Pillow plus the standard library. Run --help for budget, quality, format, and input options. It emits deterministic, sorted JSON with top-level schemaVersion: media-delivery-report/v1; reports omit timestamps. auto always includes a source-compatible fallback and adds writable AVIF/WebP encoders. Unsupported explicitly requested codecs become blockers while supported outputs remain inspectable.
Run focused tests with:
SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}"
"$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" -m unittest discover \
-s "$SKILL_ROOT/responsive-image-delivery/tests" -p 'test_*.py'Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

