Agent Skills
The repository ships two universal agent skills - instructions that teach an AI coding agent how to set up and use srcset. They are compatible with Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Cline and other agents that support the skills format.
They carry the parts of this documentation an agent gets wrong on its own: the rule model, the format specific advice and the pitfalls.
setup-srcset
Section titled “setup-srcset”The setup-srcset skill adds responsive images to a project end to end. Rather than pasting a template, it guides the agent to:
- Pick the integration from the repository -
vite.config.*,webpack.config.*,rspack.config.*and thepackage.jsonscripts decide between the Vite plugin, the loader, cli baking and the proxy adapters. Telling it which one to use works too. - Write the rules, not just copy them - the first match wins, a rule without
matchis the catch-all and goes last, a width of 1 or less is a multiplier, the first format is the fallback when the source format is not in the list, and png, gif and svg need rules of their own. - Wire the ambient types - the
clientreference the chosen integration ships, kept next to thevite/clientone a Vite project already has. - Render the variants - the
PictureandImagecomponents for React, Preact or Svelte, orgetImagePropsandgetSourcePropswhen the project has no component package. - Finish with the four checks - the emitted assets, the length of
srcSet, the rendered markup, and a type-check.
pnpx skills add TrigenSoftware/srcset --skill setup-srcsetyarn dlx skills add TrigenSoftware/srcset --skill setup-srcsetnpx skills add TrigenSoftware/srcset --skill setup-srcsetsrcset
Section titled “srcset”The srcset skill is for writing the code: the setup exists, and now something has to display an image. It teaches the agent:
- The image module - what the import gives back, and that a bundler integration and a baked module produce exactly the same exports.
- Rendering -
srcSetandsizeson both components whilesrcgoes toImagealone, the per-framework differences in refs and prop casing, and whatgetSourcePropsandgetImagePropsreturn without a framework. sizesand retina - that awdescriptor is a file width rather than a screen, so one list of widths covers both densities and there is no@2xrule to write.- Rules - the first match wins, an array in
matchis anand, png, gif and svg need rules of their own. - The command line - the full option table, arguments that replace the config
rulesrather than merging into it, where the files land, and the four--moduleformats with what the project still has to provide. - The pitfalls -
srcSetgiven only toPicture, a missingsizes, a placeholder that never resets, quoting the globs, and a re-run that never cleans the destination.
pnpx skills add TrigenSoftware/srcset --skill srcsetyarn dlx skills add TrigenSoftware/srcset --skill srcsetnpx skills add TrigenSoftware/srcset --skill srcset