⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
sakuga-vfx
Build, change or wire in a UI control that reacts like anime (squash and overshoot on springs, drawn smoke, impact bursts, slashes and splashes, manga sound-effect lettering), using the Sakuga VFX core. Use when asked to add one of the sakuga-* components to an app, to change how one reacts, to re-theme them, or to make a new control in the same style. Covers the core's effects, the rules the set follows, and the frame-by-frame look that has to happen before calling it done.
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
Sakuga VFX
Ordinary UI controls that react like anime. At rest they are plain. Use one and it squashes and overshoots on springs, and throws drawn effects around itself: smoke puffs, impact bursts, crystal chips, slashes, splashes and smoke rings, with manga sound-effect lettering (ドン!, カチッ, ズザッ). No characters, just the way a key animator would sell a hit.
Every effect is drawn in code on one canvas over the page. The lettering was painted with GPT Image and traced to paths, and the toggle is 43 painted frames; both live inside the component files, so there is nothing else to fetch. No dependencies, no build step for you, MIT licensed.
The twelve
| element | what happens | |
|---|---|---|
| Button | <sakuga-button> | Press and it squashes flat. Let go and it inverts for one frame, a burst goes off behind it, clouds roll off the corners and ドン! lands. done() puts a check on it. The secondary variant is a small squash and three wedges. |
| Toggle | <sakuga-toggle> | A drawn animation: the knob smears across, slams into the end and throws up a splash, and the track floods and settles. |
| Slider | <sakuga-slider> | The thumb stretches into a teardrop and lags on a spring. Drag fast and cumulus rolls up behind it; let go and a crescent flies on ahead. |
| Checkbox | <sakuga-checkbox> | Two crescents swing round the box, crystals fly, the tick draws itself, ズザッ in dotted letters. |
| Radio | <sakuga-radio> | The dot springs in, a fan of wedges, two puffs and a hollow ポン. |
| Input | <sakuga-input> | Every key kicks up dust where the caret is. |
| Tabs | <sakuga-tabs> | The raised tab slides, stretching, and lands with wedges and a puff. |
| Progress | <sakuga-progress> | A storm cloud rides the leading edge, pebbles lift off the ground, ゴゴゴゴ; at the end a burst, ドン! and a check. |
| Rating | <sakuga-rating> | Stars pop in one after another; five gets a burst. |
| Toast | <sakuga-toast> | Streaks in as a smear, lands in dust with ズザッ, leaves by shrinking. |
| Tooltip | <sakuga-tooltip> | The hint springs out like a speech bubble with puffs and カチッ. |
The look
White paper, two-tone effects (white, lavender and a violet line), pink accents, and an impact burst on every confirm. The controls' colours are --sk-* CSS variables (--sk-ink, --sk-card, --sk-pri, --sk-acc and so on), and a page's own :root { --sk-acc: ... } wins over the defaults.
Try them
Live: https://sakuga-vfx.vercel.app
Or run it yourself:
python3 -m http.server 8000 # from this folder
# open http://localhost:8000/
That opens the gallery, with all twelve live.
Use one
Each is a single file that defines an element. Install it with the shadcn CLI, which puts the file in public/sakuga-vfx/:
npx shadcn add finktheartist/sakuga-vfx/button
npx shadcn add finktheartist/sakuga-vfx/toggle
npx shadcn add finktheartist/sakuga-vfx/slider
# ...checkbox, radio, input, tabs, progress, rating, toast, tooltip
Or copy the file into your project by hand. Then load it with a plain script tag and use its element:
<script src="button.js"></script>
<sakuga-button>Confirm</sakuga-button>
<script src="toggle.js"></script>
<sakuga-toggle label="Notifications"></sakuga-toggle>
<script src="progress.js"></script>
<sakuga-progress label="Uploading"></sakuga-progress> <!-- then el.set(0.4) -->
Each folder's README lists the attributes, properties and events. The value controls (toggle, slider, checkbox, radio, input, rating) work inside a <form> like the native ones.
How the files share. Each file carries its own copy of the core (springs, the effects layer, the lettering, about 40 KB). The first one loaded sets window.SakugaFX and the others reuse it, so any mix of them on a page shares one canvas and one animation loop. The toggle is about 500 KB because its frames are inside it.
For agents, llms.txt lists every file and what it is. In the gallery each control has its install line and a "Copy a prompt for your agent" button; the prompt points a coding agent at the real file and tells it to wire it in, not redraw it.
Make your own
skills/sakuga-vfx/ is the workflow these were made by, written as a skill for a coding agent. Install it with:
npx skills add finktheartist/sakuga-vfx
Or copy the folder into your agent's skills folder by hand (for Claude Code, ~/.claude/skills/). It has four files:
SKILL.mdis the workflow and the rules.core.jsis the core every component is built on.starter.htmlis the smallest whole example, a like button.look.mjsstops the clock, steps a reaction to chosen moments and saves the frames side by side.
An agent with the skill gets a reasonable first pass. These took many rounds of looking at frames and fixing them, and yours will too.
Working on this repo
core.jsis the source of the shared core. After editing it, runnode tools/build.mjs, which copies it into every component file (between the// >>> sakuga coremarkers) and into the skill.node tools/build.mjs --checkexits 1 if any file is out of date.art/words/holds the six painted sound-effect words.tools/trace.pytraces them into paths and writes them intocore.js(uv run --with potracer --with pillow --with numpy python tools/trace.py).toggle/frames.webpis the toggle's sprite sheet (43 frames, 8 across, 300 by 325 each). The build writes it intotoggle.js.node tools/test.mjs http://localhost:8000/gallery/drives every control with real touch and key events at phone width, checks form values and sideways scroll, and exits 1 on a failure.node tools/shot.mjs URL OUT W H SCALEtakes a full-page screenshot. Both need Chrome or Chromium (CHROME=...if it is somewhere unusual).
Limits
- Checked in headless Chromium, with real touch and key events and frame-by-frame sheets. Not yet tried in Safari or Firefox, on a real phone, or with a screen reader.
- The effects canvas sits on top of everything, at the highest z-index, and ignores the pointer. Effects can fly over a modal or a sticky header.
- Effects behind a control are drawn inside it (the button's and the progress bar's bursts, the five-star burst) and are cut off by a parent with
overflow: hidden. - Reduced motion turns every effect off; the springs and the state changes stay.
License
MIT. See LICENSE. The sound-effect lettering and the toggle frames were generated with GPT Image (through Higgsfield) for this project.
// HOW IT'S BUILT
// FILES
5 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.
skills/sakuga-vfx/SKILL.md6.8 KBd5cb805e9717upstream ↗
--- name: sakuga-vfx description: Build, change or wire in a UI control that reacts like anime (squash and overshoot on springs, drawn smoke, impact bursts, slashes and splashes, manga sound-effect lettering), using the Sakuga VFX core. Use when asked to add one of the sakuga-* components to an app, to change how one reacts, to re-theme them, or to make a new control in the same style. Covers the core's effects, the rules the set follows, and the frame-by-frame look that has to happen before calling it done. --- # Sakuga VFX A Sakuga control is an ordinary control (a button, a switch, a slider) that is plain at rest and reacts like an anime cut when you use it. The control itself moves on springs; the effects are drawn on one canvas over the page, so they can fly outside the control. This skill is the workflow the set was made by. It comes with three files: - `core.js` — the shared core: `Spring`, the effects layer and every effect, the lettering, the palette, and `Base`, a custom-element base class with one shared clock. - `starter.html` — the smallest whole example, a like button. Copy it to start a new one. - `look.mjs` — stops the clock, steps a reaction to chosen moments and saves the frames side by side, so you can read them. If the job is only to put an existing component into an app, skip to **Wire it in** and **Check it**. ## 1. Decide four things before animating 1. **The control.** It must still be that control with every effect switched off: a real `<button>`, `<input>` or `role="switch"` inside, with keys and focus. 2. **The beats.** Write the reaction as beats, the way a key animator would: anticipation (the press), the hit (the frame where it happens), the follow-through (what drifts off), and the settle. Each beat gets one effect or two, not five. 3. **The word.** At most one sound-effect word per reaction, on the hit. The six are ドン (impact), カチッ (click), シュッ (swish), ポン (pop), ズザッ (skid) and ゴゴゴゴ (rumble). 4. **What is real and what is drawn.** State changes happen at once; effects only decorate them. Nothing the user needs to read may depend on an effect. ## 2. The core Load `core.js` and everything is on `window.SakugaFX`: - **Motion:** `new Spring(x, stiffness, damping)`, then set `.to` and call `.step(dt)` every frame. `squashy(button, { low, wide })` gives a press that squashes while held and overshoots on release; call its `step(dt)` in `frame()`. - **Effects,** all in page coordinates (use `at(el, fx, fy)` to get a point on an element): `burst` (the impact star), `puff` (a smoke puff), `donut` (a smoke ring), `shards` (crystal chips), `slash` (a crescent), `lines` (speed lines), `ticks` (accent wedges), `ring`, `splash`, `kira` (a glint), `wob` (wobble marks), and `sfx(word, x, y, { size })`; pass `...hollow()` or `...dotted()` to `sfx` for the two lettering styles. - **Timing:** `later(ms, fn)` runs on the shared clock, not on `setTimeout`, so `look.mjs` can step it. Use it for every delay. - **The base class:** extend `Base`, give it `static css`, `render()` (the shadow HTML), `setup()` (listeners, springs) and `frame(dt)`. `backLayer()` gives a canvas inside the element, behind the control, for an effect that must sit behind it (pass `{ layer }` to `burst`). `static formAssociated = true` gets `this.internals` for forms. - **Colours:** `P` is the effects palette. In CSS use the `--sk-*` variables (`--sk-ink`, `--sk-card`, `--sk-pri`, `--sk-acc`, `--sk-sh`, ...). ## 3. The rules These are the corrections that came up most. - **Two tones and a line.** Every drawn shape is a flat light tone, one flat shadow tone and an outline. No gradients, no blur. - **Things leave by shrinking or thinning, not by fading.** An effect's opacity never changes. - **Squash keeps volume.** When something squashes to `y` high it gets wider; when it stretches it gets thinner. - **Springs, not easings,** for anything the hand moves. Stretch comes from the spring's speed, so a fast drag smears and a slow one does not. - **Effects follow speed.** A slow drag is quiet. Fire the big stuff on the release, the landing, or the moment of change. - **Pink is for accents.** Wedges, needles and the check are the accent colour; everything else is ink and paper. - **The control is plain at rest.** No idle animation, and nothing drawn around it until it is used. - **To match a drawn reference, generate frames from it.** The toggle is 43 frames painted with an image model from a sheet of keyframes, aligned on the housing and played at 30 a second. Simulating a morphing liquid in code did not get close; drawing it did. - **Reduced motion.** The core already drops every effect when `prefers-reduced-motion` is set. Make sure the state still changes. ## 4. Look before you say it is done A component that runs without errors has told you nothing about how it reacts. 1. Serve the folder and run `look.mjs` on the page, with `--act` to press, click or drag at the right moment: ```sh node look.mjs "http://localhost:8000/starter.html" --select like-button --act "0:document.querySelector('like-button').shadowRoot.querySelector('button').click()" --times 0,0.05,0.12,0.25,0.45,0.8 ``` 2. Open the sheet and read each frame: is the hit frame clear, does anything cover the label, does each effect leave by shrinking, is there a frame where nothing is happening that should be. 3. Fix what you see and look again. Expect several rounds. ## 5. Wire it in - **One file per component.** Each component file carries a copy of the core between its `// >>> sakuga core` markers, so it works on its own; the first one loaded sets `window.SakugaFX`, the rest reuse it. When you change the core, run `node tools/build.mjs` in the repo to stamp it into every file. - **Load it with a plain script tag,** not as a module, and do not split or rewrite it. - **Attributes and properties for state, events for what happened:** `change` for value controls (they also work in forms), `click` for buttons, `sakuga:done` for progress. - **Do not edit the effects to restyle someone else's component.** Set the `--sk-*` variables, or say what needs to look different. ## 6. Check it Use it the way a person would, in a real browser, and report each separately. - **Pointer and touch:** real presses and drags sent through the DevTools protocol (`Input.dispatchTouchEvent`, `Input.dispatchMouseEvent`), not calls into the code. `tools/test.mjs` in the repo does this for every component. - **Keyboard:** Tab to it, then the keys that should work it. - **Two widths:** a desktop width and 390 pixels, with no sideways scroll. - **Forms:** if it has a value, `new FormData(form)` should contain it. ## 7. Say what is true - **What it does now.** - **What you checked, and how.** "Stepped frame by frame with look.mjs" is not "watched it at real speed". Say which. - **What is still weak.** Name the frames or beats that do not read.skills/sakuga-vfx/core.js40 KB0d13688c2d25upstream ↗
Contents are not inlined in the catalog. Open the upstream file.
skills/sakuga-vfx/look.mjs6.5 KBb1668e01ef74upstream ↗
#!/usr/bin/env node // look.mjs: see a reaction the way a reviewer should, as frames you can read one at a time. // // node look.mjs "http://localhost:8000/checkbox/" --select "sakuga-checkbox" --act "0:document.querySelector('sakuga-checkbox').shadowRoot.querySelector('input').click()" --times 0,0.1,0.2,0.35,0.6,0.9 // // Opens the page in headless Chrome, stops the Sakuga clock (SakugaFX.paused), steps it to each time with SakugaFX.advance, and photographs // the element with room around it (the effects fly outside it). Saves one sheet with every frame side by side. Then open the sheet and look. // Node 22 or later and Chrome. No installs. Options: // --times 0,0.1,0.3 moments to capture, in seconds from the start (after --do) // --select css what to frame. "host >>> inner" reaches into a shadow root. Default: the first sakuga-* element // --pad 140 pixels of room around it // --do "js" run once after the page loads, before the first frame // --act "0.2:js" run js when the clock reaches 0.2 s, so one sheet can show a press and its release. Repeat it for more. // --zoom, --cols, --width, --height, and --out for the sheet's file name. Set CHROME if Chrome is somewhere unusual. import { spawn } from 'node:child_process'; import { existsSync, mkdtempSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; const args = process.argv.slice(2), url = args.find((a) => !a.startsWith('--') && !args[args.indexOf(a) - 1]?.startsWith('--')); const opt = (name, fallback) => { const i = args.indexOf('--' + name); return i >= 0 ? args[i + 1] : fallback; }; if (!url) { console.error('usage: node look.mjs URL --times 0,0.1,0.3 [--select css] [--act "0:js"] [--out sheet.png]'); process.exit(2); } const acts = args.flatMap((a, i) => (a === '--act' ? [args[i + 1]] : [])).map((v) => [parseFloat(v), v.slice(v.indexOf(':') + 1)]).sort((a, b) => a[0] - b[0]); const times = opt('times', '0,0.1,0.2,0.4').split(',').map(Number), out = opt('out', 'sheet.png'), pad = +opt('pad', 140), zoom = +opt('zoom', 1); const cols = +opt('cols', Math.min(4, times.length)), width = +opt('width', 900), height = +opt('height', 800), after = opt('do', ''), select = opt('select', ''); const CHROME = process.env.CHROME || ['/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '/usr/bin/google-chrome', '/usr/bin/chromium', '/usr/bin/chromium-browser', 'C:/Program Files/Google/Chrome/Application/chrome.exe'].find(existsSync); if (!CHROME) { console.error('Chrome not found. Set CHROME to its path.'); process.exit(2); } const port = 9400 + Math.floor(Math.random() * 400); const chrome = spawn(CHROME, ['--headless=new', `--remote-debugging-port=${port}`, `--user-data-dir=${mkdtempSync(join(tmpdir(), 'look-'))}`, '--no-first-run', '--hide-scrollbars', 'about:blank'], { stdio: 'ignore' }); const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); let targets; for (let i = 0; i < 60 && !targets?.some?.((t) => t.type === 'page'); i++) { try { targets = await (await fetch(`http://127.0.0.1:${port}/json`)).json(); } catch {} await sleep(200); } const ws = new WebSocket(targets.find((t) => t.type === 'page').webSocketDebuggerUrl); await new Promise((r) => ws.addEventListener('open', r, { once: true })); let id = 0; const pending = new Map(), errors = []; ws.addEventListener('message', (e) => { const m = JSON.parse(e.data); if (m.id && pending.has(m.id)) { pending.get(m.id)(m); pending.delete(m.id); } if (m.method === 'Runtime.exceptionThrown') errors.push(m.params.exceptionDetails.exception?.description || m.params.exceptionDetails.text); }); const send = (method, params = {}) => new Promise((res) => { const i = ++id; pending.set(i, (m) => res(m.result)); ws.send(JSON.stringify({ id: i, method, params })); }); const run = async (expression) => (await send('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true })).result?.value; await send('Runtime.enable'); await send('Page.enable'); await send('Emulation.setDeviceMetricsOverride', { width, height, deviceScaleFactor: 1, mobile: false }); await send('Page.navigate', { url }); await sleep(1500); if (!(await run('!!window.SakugaFX'))) { console.error('No SakugaFX on that page.'); process.exit(1); } const pick = select ? JSON.stringify(select) : 'null'; const box = JSON.parse(await run(`(() => { const s = ${pick}; const el = s ? s.split(' >>> ').reduce((r, q, i) => (i ? r.shadowRoot : r).querySelector(q), document) : [...document.querySelectorAll('*')].find((e) => e.localName.startsWith('sakuga-')); if (!el) throw new Error('nothing to frame'); el.scrollIntoView({ block: 'center' }); const b = el.getBoundingClientRect(); return JSON.stringify({ x: b.left, y: b.top, w: b.width, h: b.height }); })()`)); const clip = { x: Math.max(0, box.x - pad), y: Math.max(0, box.y - pad), width: box.w + pad * 2, height: box.h + pad * 2, scale: 1 }; await run('SakugaFX.paused = true'); if (after) await run(after); let clock = 0; const shots = []; const go = async (t) => { await run(`(() => { let n = Math.round(${(t - clock) * 60}); while (n-- > 0) SakugaFX.advance(1 / 60); })()`); clock = t; }; for (const t of times) { while (acts.length && acts[0][0] <= t) { const [at, js] = acts.shift(); await go(at); await run(js); } await go(t); await sleep(60); shots.push([t, (await send('Page.captureScreenshot', { format: 'png', clip })).data]); } // the frames go onto one sheet inside the page, so nothing but Chrome is needed to put them side by side const data = await run(`(async () => { const s = ${JSON.stringify(shots)}; const imgs = await Promise.all(s.map(([, d]) => new Promise((r) => { const i = new Image(); i.onload = () => r(i); i.src = 'data:image/png;base64,' + d; }))); const w = imgs[0].width * ${zoom}, h = imgs[0].height * ${zoom}, cols = ${cols}, rows = Math.ceil(imgs.length / cols), o = document.createElement('canvas'); o.width = (w + 8) * cols + 8; o.height = (h + 26) * rows + 8; const x = o.getContext('2d'); x.fillStyle = '#2b2b30'; x.fillRect(0, 0, o.width, o.height); x.font = '13px monospace'; imgs.forEach((im, i) => { const px = 8 + (i % cols) * (w + 8), py = 8 + Math.floor(i / cols) * (h + 26); x.drawImage(im, px, py + 18, w, h); x.fillStyle = '#d0d0d8'; x.fillText(s[i][0].toFixed(2) + ' s', px, py + 12); }); return o.toDataURL('image/png'); })()`); writeFileSync(out, Buffer.from(data.split(',')[1], 'base64')); console.log(`${times.length} frames, saved ${out}`); console.log(errors.length ? 'script errors:\n ' + errors.join('\n ') : 'no script errors'); ws.close(); chrome.kill(); process.exit(errors.length ? 1 : 0);skills/sakuga-vfx/starter.html2.9 KBc3c72fababc1upstream ↗
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Starter: a like button</title> <style> body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: #fff; font: 15px/1.45 -apple-system, "Helvetica Neue", "Segoe UI", sans-serif; } </style> </head> <body> <like-button></like-button> <script src="core.js"></script> <script> // The smallest whole example: a like button built on the Sakuga core. // It shows the four things every component does: a real control in a shadow root, a spring for its own motion, // effects thrown at the page in page coordinates, and one frame() that the shared clock calls. (() => { const fx = window.SakugaFX, { Spring, at, squashy, burst, ticks, puff, sfx, hollow, later } = fx; class LikeButton extends fx.Base { static delegates = true; // focus goes to the button inside static css = ` button { width: 64px; height: 64px; border: var(--sk-bw) solid var(--sk-ink); border-radius: 50%; background: var(--sk-card); box-shadow: var(--sk-sh); cursor: pointer; } svg { width: 30px; height: 30px; fill: var(--sk-card); stroke: var(--sk-ink); stroke-width: 2.4; stroke-linejoin: round; transform: scale(var(--s, 1)); } button[aria-pressed=true] svg { fill: var(--sk-acc); }`; render() { return '<button type="button" aria-pressed="false" aria-label="Like"><svg viewBox="0 0 24 24"><path d="M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z"/></svg></button>'; } setup() { const b = this.b = this.$('button'); this.press = squashy(b, { low: 0.7, wide: 0.3 }); // squash while held, overshoot on release this.heart = new Spring(1, 520, 11); // the heart's own pop this.back = this.backLayer(); // a canvas inside the element, behind the button b.addEventListener('click', () => { const on = b.getAttribute('aria-pressed') !== 'true'; b.setAttribute('aria-pressed', String(on)); if (!on) { const c = at(b); puff(c.x, c.y, { size: 8, n: 3, life: 0.4 }); return; } // undoing is quiet this.heart.x = 0.3; const c = at(b); // effects are placed in page coordinates burst(c.x, c.y, { r: 44, life: 0.36, layer: this.back }); // the impact goes off behind the button, not over it ticks(c.x, c.y, { dir: -Math.PI / 2, n: 7, r: 34, len: 16, fan: 0.5, life: 0.5 }); later(120, () => puff(c.x + 40, c.y - 30, { size: 8, n: 3, vx: 16, vy: -14 })); // later() runs on the shared clock, so a film can step it sfx('pon', c.x + 30, c.y - 70, { size: 96, ...hollow() }); this.dispatchEvent(new Event('change', { bubbles: true })); }); } frame(dt) { this.press.step(dt); this.b.style.setProperty('--s', Math.max(0, this.heart.step(dt)).toFixed(3)); } } fx.define('like-button', LikeButton); })(); </script> </body> </html>README.mdupstream ↗
Contents are not inlined in the catalog. Open the upstream file.
Plain-text copy, no login: /skill-bundles/finktheartist-sakuga-vfx-skills-sakuga-vfx.md