--- name: web-sprinkles description: Build static multipage websites enhanced with small, self-contained ES modules — progressive enhancement, where every page is complete and usable with zero JavaScript and scripts only add behavior to markup that already exists. Composes with `web-static` (CSS-only patterns, structure, verification loop), `web-conventions` (HTML/CSS/Baseline), and `javascript-conventions` (language rules); owns the enhancement contract, the CSS-versus-script cut line, and a no-JavaScript verification pass. Use when a static site needs a theme toggle, a copy button, a client-side filter, `Intl` formatting, or a small `fetch`. Triggers on "sprinkles of JavaScript", "a bit of JavaScript", "small amount of JS", "progressive enhancement", "static site with JavaScript", "vanilla JS page", "enhance this static page", "no framework, just a script". Not for pure HTML/CSS sites — use `web-static`; not for applications with client-side state, routing, or templating — use `web-components`. argument-hint: "[description of the page and the behavior it needs]" --- Build or maintain a static site with JavaScript enhancements using $ARGUMENTS. Apply all rules below strictly. ## Composition This skill is `/web-static` plus a bounded amount of JavaScript. Everything in `/web-static` applies unchanged — CSS-only interactive patterns, CSS reset, page transitions, performance rules, project structure, and the verification loop — except its no-JavaScript hard constraint, which this skill replaces with the Enhancement Contract below. - `/web-conventions` — semantic HTML, accessibility, modern CSS, design tokens, Baseline policy - `/javascript-conventions` — modules, syntax, collections, asynchrony, errors, JSDoc types, and the Baseline lookup for JavaScript features - `/web-static` — everything above the JavaScript line - `/web-latest` may be composed on top for experiments and PoCs Rules in this skill override all of them. ## Enhancement Contract - every page is **complete and usable with zero JavaScript** — content readable, navigation traversable, forms submittable and validated by the browser - JavaScript only **adds behavior to markup that already exists**; it never produces the content that is the page's purpose - links keep real `href`s and forms keep `action`/`method` — navigation and submission never depend on a script - a module that fails — throws, 404s, hits an unsupported API — degrades the page to its no-script baseline, never to a broken page - enhancements are independent: one module failing must not disable the others - nothing renders late — no content flashes in, moves, or is replaced after load ## The Cut Line If HTML or CSS can express it, a script is a defect, not a choice. Before writing one, ask what the page looks like with it removed; if the answer is "broken", the design is wrong, not the script. | Behavior | Verdict | |---|---| | Accordion, disclosure | `
`/`` — no script | | Tabs, hamburger, dropdown | `:checked` + siblings, `:focus-within` — no script | | Modal | `:target` — no script; `` plus a script only when focus trapping and `Esc` matter | | Form validation | input types and constraint attributes — a script only for rules markup cannot express | | Page transitions, smooth scroll, carousels | `@view-transition`, `scroll-behavior`, scroll snap — no script | | Theme toggle that persists | script — CSS cannot read `localStorage` | | Clipboard | script — `navigator.clipboard` | | Filter, sort, or search over content already in the DOM | script | | Locale or relative time formatting | script — `Intl` over a `