Skip to the usage guide
gsap-utilsby GreenSock

GSAP Utils Skill.

A Claude Code and Codex skill for motion and video: gsap.utils helpers: clamp, mapRange, interpolate, snap, wrap, pipe.

  • Motion & Video
  • UI code
greensock/gsap-skills · skills/gsap-utils/SKILL.mdSKILL.md
--- name: gsap-utils description: Official GSAP skill for gsap.utils — clamp, mapRange, normalize, interpolate, random, snap, toArray, wrap, pipe. Use when the user asks about gsap.utils, clamp, mapRange, random, snap, toArray, wrap, or helper utilities in GSAP. --- ## When to Use This Skill ## Clamping and Ranges ## Random and Snap ## Units and Parsing ## Arrays and Collections ## Best practices
Front matter and section headings read from the upstream file on 2026-09-14 · 12,051 characters in full

01 What it does

What the gsap-utils Skill Does in Claude Code and Codex

Summary, workflow and outputs, all read from the skill's SKILL.md.

From the SKILL.mdRead 2026-09-14 · not a recorded run

In the Skill's Own Terms

gsap.utils is GSAP's set of pure helper functions for math, ranges, units, colors, and collections, and it needs no registration. The skill documents clamp, mapRange, normalize, interpolate, random, snap, shuffle, distribute, getUnit, unitize, splitColor, selector, toArray, pipe, wrap, and wrapYoyo with their signatures, defaults, and worked outputs.

It is for developers writing or reviewing GSAP code that must map scroll to a value, normalize inputs, snap to a grid, or scope selectors in a component. One pattern runs through the file: omit the trailing value to get a reusable function, except random(), which takes true.

What it produces

  • The transformed value, returned directly when you pass the value argument
  • A reusable function that clamps, maps, normalizes or snaps values you hand it later
  • A new array with the same elements in random order
  • A scoped selector function that only finds elements inside the given element or ref
See the example prompt ↗

How It Works

  1. 01
    Helpers Live on gsap.utils

    The utils are pure helpers that need no registration and can be called anywhere JS drives GSAP: tween vars, ScrollTrigger or Observer callbacks.

  2. 02
    Pass the Value Last, Get the Result Now

    Most utils take their config first and the value to transform as the final argument, returning the transformed result immediately.

  3. 03
    Leave It Off for a Function Form

    Omit that final value and the util hands back a function you call later with the value, so one config can serve many values.

  4. 04
    Remember Random() Flips the Pattern

    random() does not use omission for its reusable form; you pass true as the last argument and get a function returning a fresh value each call.

  5. 05
    Snap Can Be Set in the Tween Itself

    For grid or step-based motion you can pass snap directly in tween vars rather than calling the util first.

  6. 06
    Chain Transforms with Pipe

    pipe composes functions left to right, so normalize then snap can be applied as a single function inside a tween or callback.

02 Find your fit

When to Use the gsap-utils Skill

Use the gsap-utils skill in Claude Code or Codex when the job is motion and video of this kind. Fit and limits below are taken from the skill's own file.

Good Fit

  • Converting scroll position, a 0-1 progress value or another input range into an animation range
  • Animating on a grid or in fixed steps inside a tween
  • Infinite scroll or other cyclic value handling with wrap and wrapYoyo
  • Spreading values like scale, opacity, x or delay across many elements at once
  • Randomizing the order of elements before staggering them

Know the Boundaries

  • Easing utilities such as CustomEase, which the file places in gsap-plugins rather than gsap.utils
  • Overriding utils or leaning on undocumented behavior
  • Building the animation itself, which the file pairs with gsap-core, gsap-timeline and gsap-scrolltrigger

What to Provide

  • The value you want transformedPass it as the final argument to get a result straight away; omit it and supply the value later to the function you got back.
  • A scope element or ref for selector()Pass a DOM element or a framework ref so the returned selector function only matches descendants of it.
  • A color string for splitColorrgb(), rgba(), hsl(), hsla(), hex and named colors all work; pass true as the second argument to get HSL components instead.
  • A distribute config, all keys optionalSupply the spread settings such as base, amount or each, from, grid, axis and ease, or leave it empty for defaults.

03 Inside the skill

Rules the gsap-utils Skill Gives Claude Code and Codex

6 concrete instructions, defaults and limits the SKILL.md sets for the agent — the part of the file that changes the result.

  1. Omit the Value When a Range Repeats

    Where the same range or config is reused, such as a scroll handler or tween callback, keep the returned function instead of rebuilding the config per call.

  2. Use the Random String Form in Tween Vars

    Write "random(-100, 100)", "random(-100, 100, 5)" or "random([0, 100, 200])" as a property value; GSAP evaluates the string per target.

  3. Snap the Grids, toArray the Rest

    Reach for snap on grid-aligned or step-based values, and use toArray whenever GSAP or your own code needs a true array out of a selector or NodeList.

  4. Scope Selectors Inside Components

    Call gsap.utils.selector(scope) so a selector like ".box" matches only descendants of that container or ref rather than the whole document.

  5. Amount or Each, Never Both

    In a distribute config, amount splits a total across all targets (amount 1 over 100 targets is 0.01 apart) while each sets a fixed step per target such as 0, 1, 2, 3.

  6. mapRange and Normalize Are number-only

    Do not expect them to handle units; when units matter, reach for getUnit or unitize instead.

04 Put it to work

Install gsap-utils in Claude Code or Codex

One npx skills add command, then a first task in your agent and a checklist for the result.

Add gsap-utils to Claude Code, Codex or Your Agent

Run in your project; the installer asks which agent to add it to.

Terminal
npx skills add https://github.com/greensock/gsap-skills --skill gsap-utils

Generic skills CLI form for skills/gsap-utils/SKILL.md; the repository may document its own path.

Give the Skill a First Motion and Video Task

Written in the skill's own terms; replace the bracketed parts with your material.

Starter prompt
Use gsap.utils to drive a [scroll-linked effect] in [my component]: map the ScrollTrigger progress from 0-1 to 0-360 and snap the result to the nearest 5, then set the starting x of each [card] with the string form "random(-100, 100, 5)". Scope the selectors to the [container] ref with gsap.utils.selector so they do not match the whole document.

Source: written from the SKILL.md in the skill's own terms.

Check the First Result

What the SKILL.md itself says a correct result looks like:

  • Compare a sample call against the documented result, such as mapRange(0, 100, 0, 500, 50) giving 250
  • Test wrap at both ends of the range to confirm the cyclic result
  • Pass a container as the second toArray argument to confirm the result is scoped
  • Check that an RGBA color returns four elements rather than three
  • Confirm getUnit returns the unit string, and an empty string for unitless numbers

In OpenDesign gsap-utils is bundled: Plugins → Skills, pick it in the top bar.

05 Open source, traceable

Source, License and Verification

Where this page's facts come from, and when they were last checked.

Author
GreenSock
Repository
github.com/greensock/gsap-skills Branch main
Skill file
skills/gsap-utils/SKILL.md Content checksum recorded at verification; commit aed9cfd
License
MIT From LICENSE; SKILL.md says “MIT”.
Repository stars
15,248 GitHub snapshot taken 2026-09-14 for the whole greensock/gsap-skills repository, which contains 8 skills in this catalog. Not a rating or usage count for gsap-utils.
Verified by OpenDesign
2026-09-14 Source file, path, license text and star count were checked. Bundled in OpenDesign main (checked 2026-08-28); a live run has not been recorded on this page.
The Skill's Own Description
“Official GSAP skill for gsap.utils — clamp, mapRange, normalize, interpolate, random, snap, toArray, wrap, pipe. Use when the user asks about gsap.utils, clamp, mapRange, random, snap, toArray, wrap, or helper utilities in GSAP.”

Front-matter description from SKILL.md. The full file is about 12,051 characters. Read the full file on GitHub.

GSAP Utils

Run gsap-utils on a Real Motion and Video Task.

The gsap-utils skill ships inside OpenDesign. Download the app, pick the skill in Plugins → Skills, paste the prompt above, and read the plan before the result.

Terminal
npx skills add https://github.com/greensock/gsap-skills --skill gsap-utils