react-spring
Skill1 starsChanged 8 days agoMITView on GitHub
Audit how a codebase uses react-spring, report what misbehaves or wastes work, agree a plan, then fix. react-spring's failure modes are different from duration-based libraries: the common bugs are springs bound to React state every render (velocity lost, springs restart), ref-driven springs that are never started (nothing animates), easing configs without duration (silently ignored), and event-driven api.start wired through state instead of direct calls. Report first, plan approved, then edit. - Project root (package.json — which target: @react-spring/web vs the…
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architecture-optimizerSkill
- csharp-optimizerSkill
- cpp-optimizerSkill
- c-optimizerSkill
- go-optimizerSkill
- node-service-optimizerSkill
- ruby-optimizerSkill
- rust-optimizerSkill
- docker-optimizerSkill
- kubernetes-optimizerSkill
- terraform-optimizerSkill
- animate-cssSkill
- animejsSkill
- auto-animateSkill
- gsapSkill
- lenisSkill
- magicuiSkill
- motionSkill
- react-moveSkill
- react-three-fiberSkill
- theatrejsSkill
- threejsSkill
- optimizer-routerSkill
- bootstrap-optimizerSkill
- pandacss-optimizerSkill
- sass-scss-optimizerSkill
- stylex-optimizerSkill
- tailwindcss-optimizerSkill
- twind-optimizerSkill
- unocss-optimizerSkill
- vanilla-extract-optimizerSkill
- angular-optimizerSkill
- astro-optimizerSkill
- ui-components-optimizerSkill
- nextjsSkill
- node-optimizerSkill
- nuxt-optimizerSkill
- react-optimizerSkill
- remix-optimizerSkill
- solid-optimizerSkill
- svelte-optimizerSkill
- tanstack-start-optimizerSkill
- vue-optimizerSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Run python <skill-dir>/scripts/audit.py <project-root> [--json] — inventories hook usage …
- Distinctive: line 27
Read what the script flagged.
≈ “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
name: react-spring-optimizer description: Audit and optimize @react-spring/web usage — import targets (@react-spring/web vs old react-spring v8 vs @react-spring/core), springs bound to changing state every render (should be api.start-driven), orphaned useSpringRef (no api.start/useChain — nothing animates), easing without duration (easings only work with duration), useTransition list config (keys, trail, exitBeforeEnter), useChain orchestration (timesteps/timeframe), loop/Infinity springs, config presets (gentle/wobbly/stiff/slow/molasses), and reduced motion via useReducedMotion / Globals.skipAnimation / immediate. Report with evidence and a plan approved before edits. Use when the user mentions react-spring, @react-spring/web, useSpring, useTrail, useTransition, useChain, or spring animations in React/Next.js -- even if they don't say "optimize".
React Spring (@react-spring/web) Optimizer
Audit how a codebase uses react-spring, report what misbehaves or wastes work, agree a plan, then fix.
react-spring's failure modes are different from duration-based libraries: the common bugs are springs
bound to React state every render (velocity lost, springs restart), ref-driven springs that are
never started (nothing animates), easing configs without duration (silently ignored), and
event-driven api.start wired through state instead of direct calls. Report first, plan approved,
then edit.
Workflow
1. Scope (quick)
- Project root (
package.json— which target:@react-spring/webvs the oldreact-spring(v8) vs direct@react-spring/core; note React major and Next.js presence). - Run
python <skill-dir>/scripts/audit.py <project-root> [--json]— inventories hook usage (useSpring/useSprings/useTrail/useTransition/useChain), ref-orphaned springs, state-driven configs, easing/duration mismatches, loops, reduced-motion coverage.
2. Audit
Read what the script flagged. Load references as fit:
| Area | Reference |
| Hook API & config: useSpring/useSprings/useTrail, presets, api calls | references/hooks-api.md |
| Lists & orchestration: useTransition keys/trail, useChain | references/lists-transitions.md |
| State-driven spring smell, loops, reduced motion | references/perf-a11y.md |
Runtime checks you do by hand: interactive controls that drag/flick (does velocity survive
re-renders?), dialogs/notifications entering and exiting (does leave run?), chained sequences
(order correct, nothing double-runs).
Mark findings Confirmed or Suspected.
3. Report
Fill in assets/report-template.md, save as REACT_SPRING_REPORT.md in the project root. Group:
imports, spring wiring, lists/orchestration, a11y.
4. Plan — stop for approval
- Quick wins — rename old
react-spring/core imports to@react-spring/web; adddurationnext to anyeasing; start orphaned refs (api.startoruseChain); addimmediate/useReducedMotiongates on loops. - Structural — convert state-driven
useSpring({ to: { x: state } })to effect-drivenapi.startper event; consolidate per-itemuseSpringintouseSpringswhere lists scale; fixuseTransitionkey functions; re-orderuseChaintimesteps. - Optional — replacing simple springs with CSS transitions where no interruption/drag physics is wanted. Per step: files, expected effect, verification, rollback. Let the user drop or reorder.
5. Fix
Approved items only. Spring behavior changes are visible — verify each group by exercising the animations: hover/click start, mid-flight interruption (retarget mid-spring — the point of springs), enter/exit on lists, chained sequences.
6. Verify and wrap up
- Reduced-motion emulation (DevTools rendering panel) for any loop; confirm immediate-jump lands on the goal value.
- React Profiler on the components that previously re-rendered per frame.
- Deferred items + next step.
Principles
- Springs are event-driven. The
api.start()call carries intent; a config bound to state makes every re-render fight the spring's internal state. - A
refwithout a start is a dead spring.ref:-configured springs only run when something callsapi.start(an event, oruseChain). easingneedsduration. Easings are ignored otherwise; springs interpolate their own way.- Right hook for the job. Repeated similar items →
useSprings; one value chasing an event →useSpring+ api; enter/exit lists →useTransition; sequencing →useChain. - Defaults are tuned, presets exist. Reach for
config.gentle/wobbly/stiff/slow/molassesbefore hand-tweaking; verify the feel, don't cargo-cult numbers. - Reduced motion via the provided utility.
useReducedMotionsetsGlobals.skipAnimationglobally — jump to goal values instead of animating. - Docs over memory. Fetch current docs (react-spring.dev) before quoting option names in a plan.
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.

