lenis
Skill1 starsChanged 8 days agoMITView on GitHub
Audit how a site uses Lenis, report what is wrong or wasting main-thread time, agree a plan, then fix. Lenis runs on the browser's own scroll and drives a RAF loop every frame, so the classic failure modes are: no RAF driver at all (scroll never smooths), two instances fighting, missing recommended CSS, breaking anchors/nested/modals, and syncing it wrong w/ ScrollTrigger or WebGL. Nothing is edited before the plan is approved. Read the init file plus whatever the leads point…
1 other project uses a version of this.
Adopted by
Most recently taken up by
- raginii4guptaa/claude-skillstheir own version, first seen Oct 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- raginii4guptaa/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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
- magicuiSkill
- motionSkill
- react-moveSkill
- react-springSkill
- 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
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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 15
Run python <skill-dir>/scripts/audit.py <project-root> [--json] — detects how Lenis is initialized and driven (autoRaf vs manual raf/GSAP …
- Distinctive: line 19
Read the init file plus whatever the leads point to.
- Distinctive: line 57
If jank was the complaint: before/after Performance traces.
- Very specific: line 67
Length still costs frames: Every lenis.on('scroll') handler runs per frame.
≈ “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: lenis-optimizer description: Audit and optimize Lenis smooth-scroll setups (lenis, lenis/react, lenis/vue,+lenis/snap) — missing or duplicated RAF loops, the required lenis.css classes, scroll-behavior conflicts, GSAP ScrollTrigger sync, anchor links anchors option, nested scroll (allowNestedScroll vs data-lenis-prevent), stop/lock during modals, respectReducedMotion/a11y, touch and performance settings (naiveDimensions, syncTouch). Report with evidence and a fix plan approved before edits. Use when the user mentions Lenis, smooth scrolling, lenis/react, data-lenis-prevent, ScrollTrigger jank, "scroll feels weird/janky after adding Lenis", or smooth scroll in a Next.js/React/Vue site -- even if they don't say the word "optimize".
Lenis Optimizer
Audit how a site uses Lenis, report what is wrong or wasting main-thread time, agree a plan, then fix. Lenis runs on the browser's own scroll and drives a RAF loop every frame, so the classic failure modes are: no RAF driver at all (scroll never smooths), two instances fighting, missing recommended CSS, breaking anchors/nested/modals, and syncing it wrong w/ ScrollTrigger or WebGL. Nothing is edited before the plan is approved.
Workflow
1. Scope (quick)
- Project root (
package.jsonwithlenisorlenis/react; plain sites with alenis.min.jsscript tag count too). - Run
python <skill-dir>/scripts/audit.py <project-root> [--json]— detects how Lenis is initialized and driven (autoRaf vs manual raf/GSAP ticker), instance count, React lifecycle (effect + destroy cleanup), presence of the required CSS, scroll-behavior conflicts, anchors setup, data-lenis-prevent usage, GSAP/ScrollTrigger sync, and perf/a11y option flags.
2. Audit
Read the init file plus whatever the leads point to. Load only what applies:
| Area | Reference |
| Setup, required CSS, anchor links, scrollTo | references/setup-css-anchors.md |
| React/Vue lifecycle, StrictMode, route changes, multiple instances | references/frameworks-lifecycle.md |
| GSAP ScrollTrigger, WebGL/parallax sync, page transitions | references/integrations-sync.md |
| Reduced motion, scroll locking, nested scroll, touch, limitations | references/a11y-touch.md |
Confirm by reading (the script can't see DOM):
- Which scroll container is wrapped — root (window) vs a
wrapperelement;contentmismatches silently do nothing. - Where
lenis.on('scroll')handlers run — anything heavy in a per-frame handler is the site's new frame budget. - Whether the site needs smooth scroll at all — pages that are mostly form/app UI usually shouldn't smooth; content-heavy marketing pages benefit most.
- Version gulfs: v0.x (
@studio-freight/lenis) vslenisv1.x — renamed imports,autoRaf/anchorsavailability, React adapter placement.
Measure where it matters: if scroll feels janky, capture a Performance trace while scrolling (main-thread budget per frame is Lenis's own raf step + every handler attached to it). Report what you measured; say plainly when you couldn't.
Mark findings Confirmed or Suspected.
3. Report
Fill in assets/report-template.md, save as LENIS_REPORT.md in the project root. Group the lumps: setup correctness, framework lifecycle, integrations, a11y/perf.
4. Plan — stop for approval
- Quick wins — add/repair the RAF driver, import
lenis/dist/lenis.css(or inlined classes), removescroll-behavior: smooth, kill duplicate instances, addanchors: true. - Structural — React/Vue lifecycle fixes (single root provider, destroy on unmount), GSAP ScrollTrigger sync per docs,
data-lenis-preventon modals/menus (orallowNestedScrollconscious choice), scroll locking (stop()/start()around modals). - Heavy/optional —
syncTouch/infinitefeatures, snapping vialenis/snap, swapping wrapper strategy, removing Lenis on app-heavy routes. Per step: files, expected effect, verification, rollback. Let the user drop/reorder.
5. Fix
Approved items only. Lenis behavior changes are user-visible in motion; change one thing at a time and test wheel + keyboard + touch on each. If an approved fix turns out to alter scrolling semantics (e.g. enabling syncTouch), stop and confirm.
6. Verify and wrap up
- Console for errors, wheel scroll, anchor click, open/close modal, nested scroll region, tab navigation,
prefers-reduced-motionemulation (smoothing off, jump scrolls). - If jank was the complaint: before/after Performance traces; report the real difference or say you couldn't measure.
- Deferred items + one suggested next step.
Principles
- One instance, one driver. A single Lenis instance with exactly one RAF source (autoRaf, own raf loop, or GSAP ticker — never two).
- The CSS is not optional. Without the recommended
lenisclasses/styles Lenis fights the browser (and the docs say so); first check in any jank report. - Native scroll stays native. Lenis wraps the browser's own scroll, so position: sticky, anchors and a11y keep working;
data-lenis-preventreserves native scrolling for nested elements instead of fighting them. - Motion preference first.
respectReducedMotionis on by default — turning it off is a deliberate product call the user must approve, not an optimization. - Interop is documented, not improvised: GSAP ScrollTrigger sync, anchors, and stop/lock patterns all have a canonical snippet; don't invent
scrollToshims. - Length still costs frames. Every
lenis.on('scroll')handler runs per frame; the fewer and cheaper the handlers, the smoother the site. - Docs over memory. Lenis moves fast (options get renamed); fetch the current README (
https://github.com/darkroomengineering/lenis) when unsure of an option name before adding it to the plan.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

