Guide · Workflow

A Claude skill for 3D scroll websites: the complete SKILL.md

By Md Mahafuj Alam · Updated

A Claude skill is a folder with a SKILL.md file: YAML frontmatter with a name and a description, then Markdown instructions. Claude Code reads every skill's description at startup and loads the full instructions only when your request matches. Save the SKILL.md on this page to ~/.claude/skills/scroll-story-site/ (all your projects) or .claude/skills/scroll-story-site/ (one repository) and Claude will follow the same frame pipeline, performance rules, fallbacks and checks every time you build a scroll story.

What a skill is, and why scroll stories need one

Anthropic's Agent Skills overview describes skills as filesystem-based resources: a directory holding instructions, optional scripts and reference files. Claude loads them in stages, which the docs call progressive disclosure:

LevelWhen it loadsWhat it is
MetadataAlways, at startup (about 100 tokens per skill, per the docs)The name and description from the frontmatter
InstructionsWhen the skill is triggeredThe body of SKILL.md
ResourcesOnly when read or runExtra Markdown files, scripts, templates

A scroll story is exactly the kind of work that benefits. The same rules apply on every project (frame tiers, portrait frames, pixel-ratio caps, reduced motion, cleanup), and they are easy to forget halfway through a long session. Without a skill you paste them in each time or discover the gaps on a phone the day before launch. With one, Claude applies them whenever you ask for a scroll-driven page.

This page sits inside a larger workflow: the pillar guide, building a 3D website with Claude, covers the whole process, and setting up Claude Code for a 3D website covers the project setup a skill plugs into.

The SKILL.md format and frontmatter

Every skill needs a SKILL.md with YAML frontmatter between --- markers, followed by Markdown. The platform docs list two required fields, with these rules:

  • name: at most 64 characters, lowercase letters, numbers and hyphens only, no XML tags, and it cannot contain the reserved words "anthropic" or "claude".
  • description: non-empty, at most 1,024 characters, no XML tags. It must say what the skill does and when to use it.

Claude Code is more relaxed. Its skills documentation says all fields are optional and only description is recommended; name defaults to the folder name and becomes the / command. It also accepts extra fields. The ones worth knowing for this skill:

FieldWhat it does in Claude Code
when_to_useExtra trigger phrases, appended to the description in the skill listing
disable-model-invocationtrue stops Claude loading the skill on its own; you run it with /name
pathsGlob patterns: Claude loads the skill automatically only when working with matching files
allowed-toolsTools Claude may use without asking during the turn that invokes the skill
argument-hintAutocomplete hint for arguments after /name

The skill on this page uses only name and description, so it also works if you upload it to claude.ai or the Skills API, which accept only the fields in the open Agent Skills spec.

Where skills live in Claude Code

LocationPathApplies to
Personal~/.claude/skills/<skill-name>/SKILL.mdAll your projects on this machine
Project.claude/skills/<skill-name>/SKILL.mdSessions in this repository; commit it to share with your team
Plugin<plugin>/skills/<skill-name>/SKILL.mdWherever the plugin is enabled, as /plugin-name:skill-name

When two skills share a name, the docs give the order: enterprise over personal, personal over project. Claude Code watches the personal and project skill folders and picks up added, edited or removed skills within the current session, without a restart.

Choose project for this skill if a team builds the site together, so everyone's Claude follows the same rules and the skill is versioned with the code. Choose personal if you build scroll stories for several clients and want the rules everywhere.

How Claude decides to load a skill

Claude sees each skill's description in context and loads the full SKILL.md when your request matches it. The platform overview puts it plainly: the description "is what Claude matches your request against when determining whether to trigger the Skill". You can also run a skill directly by typing /scroll-story-site at the start of a message.

That makes the description the most important line in the file. Three rules from the docs, applied:

  • Say what and when. The description below names the output (cinematic scroll-story websites in Next.js) and the requests that should trigger it (scroll-driven landing page, Apple-style product scroll, video to frames, reduced motion).
  • Put the key use case first. Claude Code truncates the combined description and when_to_use text at 1,536 characters in the skill listing.
  • Keep the body lean. The Claude Code docs advise keeping SKILL.md under 500 lines and moving detailed reference material to separate files, because a loaded skill's content stays in context and every line costs tokens on each turn.

The complete SKILL.md

Download it, or copy it from the block below. It is about 100 lines: short enough to stay cheap in context, specific enough that Claude does not have to guess. The ffmpeg commands in it were run as printed on test clips.

~/.claude/skills/scroll-story-site/SKILL.mdmarkdown
---
name: scroll-story-site
description: Builds cinematic scroll-story websites in Next.js, where scrolling scrubs an image sequence on a canvas or drives a three.js camera. Use when the user asks for a scroll-driven, scroll-scrubbed or 3D landing page, an Apple-style product scroll, turning a video into frames for a website, or fixing the performance, mobile layout or reduced-motion behaviour of one.
---

# Scroll-story websites

A scroll story is a landing page where the visitor's scroll position drives the hero: a canvas scrubs pre-rendered frames, or a three.js camera moves along a path. Scrolling back must rewind exactly. Follow this workflow in order and do not skip the checks.

## Stack

- Next.js (App Router) with TypeScript, deployable as a static export (`output: 'export'`).
- Scroll: GSAP ScrollTrigger for progress and pinning, Lenis for smooth scrolling. Or a plain scroll listener plus a sticky section when the page has one scene.
- Hero: `<canvas>` image sequence (footage) or three.js (live 3D). Use the existing stack if the project already has one.
- Content lives in config files (for example `story.config.ts` for the hero chapters and `site.config.ts` for everything else). Components never hard-code copy.

## 1. Plan before code

Ask for, or propose, a one-page plan and wait for approval:

1. The story in four chapters or fewer, one sentence each: what the camera sees and what the visitor learns.
2. One camera move per shot (push, follow, rise, orbit), with a start and an end.
3. An art direction block (lens, light direction, palette hex values, materials, things to avoid) that will be pasted into every image and video prompt.
4. The hero technique: image sequence (photoreal footage, fixed camera) or three.js (interactive, light, built in code).
5. The page sections below the hero.

## 2. Frame pipeline (image-sequence heroes)

Keyframes first, then one clip per shot generated from its keyframe. Review clips as contact sheets and cut any clip before it drifts:

```bash
ffmpeg -i clip.mp4 -vf "fps=4,scale=320:-2,tile=6x2" -frames:v 1 sheet.png
```

Join the approved clips (same codec, size and frame rate), then extract every tier from the joined file so the frame numbers line up:

```bash
printf "file '%s'\n" clip-1.mp4 clip-2.mp4 clip-3.mp4 > clips.txt
ffmpeg -f concat -safe 0 -i clips.txt -c copy joined.mp4

mkdir -p public/frames/preview public/frames/hd public/frames/portrait
ffmpeg -i joined.mp4 -vf "fps=12,scale=640:-2" -c:v libwebp -quality 60 public/frames/preview/frame_%04d.webp
ffmpeg -i joined.mp4 -vf "fps=12,scale=1920:-2" -c:v libwebp -quality 80 public/frames/hd/frame_%04d.webp
ffmpeg -i joined.mp4 -vf "fps=12,scale=-2:1280,crop=720:1280" -c:v libwebp -quality 80 public/frames/portrait/frame_%04d.webp
```

Rules:

- Every tier has the same frame count. Verify it (see Checks).
- Prefer dedicated 9:16 clips for the portrait tier. A centre crop is the fallback; check the subject stays in frame.
- Budget the weight before generating more footage: total HD bytes are what a desktop visitor downloads. Each decoded frame costs width × height × 4 bytes of memory (1920 × 1080 is about 8.3 MB), so never keep every HD frame decoded at once.

## 3. Canvas player

- Load the preview tier first so the story scrolls within seconds; stream HD frames nearest the current scroll position; release HD frames far from it.
- Draw the nearest loaded frame when the exact one is missing. Never draw a blank canvas.
- Choose the tier by orientation: portrait frames when the viewport is taller than it is wide.
- Size the canvas backing store to its CSS size × `Math.min(devicePixelRatio, 2)` and draw with cover-fit maths.
- Weight scroll length per clip, not per frame, so short fast shots get enough scroll distance.
- Redraw only when the frame index changes.

## 4. three.js scenes

- `renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2))`.
- Lighting: an environment map (HDRI via `HDRLoader`, or `RoomEnvironment` through `PMREMGenerator`) as `scene.environment`, `renderer.toneMapping = THREE.NeutralToneMapping`, one shadow-casting key light with a tight shadow camera.
- Colour textures get `texture.colorSpace = THREE.SRGBColorSpace`; data textures stay linear.
- Drive everything from one scroll progress value (0 to 1) eased with `1 - Math.exp(-dt * k)`, so motion is frame-rate independent and rewinds exactly.
- Run the loop with `renderer.setAnimationLoop` only while the section is on screen (IntersectionObserver); pass `null` when it leaves.
- Compile shaders before the loader hides (`renderer.compile(scene, camera)` or one render), so the first scroll does not hitch.
- On unmount: stop the loop, disconnect observers and listeners, dispose geometries, materials, textures, render targets, the PMREM generator, then `renderer.dispose()` and remove the canvas.

## 5. Reduced motion and fallbacks

- `prefers-reduced-motion: reduce`: show a still poster frame, stack the chapter copy as normal content, turn off Lenis and scrubbing. Do not play the sequence slowly instead.
- No WebGL (the `WebGLRenderer` constructor throws): show the poster image. The page must still read top to bottom.
- Text over footage meets WCAG contrast (4.5:1 normal, 3:1 large) against the brightest frame it sits on. Use calm areas of the shot or a soft scrim.

## 6. Performance rules

- No layout reads inside the animation loop except one `getBoundingClientRect` per frame for progress.
- Scroll listeners are passive. One requestAnimationFrame or `setAnimationLoop` per page, not one per component.
- Lazy-load 3D sections below the hero; render them only on screen.
- Fewer particles, segments and shadow-map pixels on small or low-power screens.
- Self-host fonts. Preload the first preview frame and the poster.

## Checks (run before saying the work is done)

```bash
npx tsc --noEmit
npm run build
for d in public/frames/*/; do echo "$d $(ls "$d" | wc -l)"; done
du -sh public/frames/*
```

Then confirm, and report each item:

- [ ] Every frame tier has the same count.
- [ ] Scrolling back rewinds the hero exactly.
- [ ] Portrait phones get portrait frames or portrait camera framing.
- [ ] Reduced motion shows a still frame and stacked copy; no smooth scrolling.
- [ ] No WebGL shows the poster and a readable page.
- [ ] 3D loops stop when off screen; the pixel ratio is capped; cleanup runs on unmount.
- [ ] All copy is in config files.

Do not start a dev server unless the user asks. Report the frame counts, the total frame weight per tier and anything you could not verify.

Why each part is there

Plan before code

The skill makes Claude stop and agree a four-chapter plan, one camera move per shot and an art direction block before writing anything. Most scroll stories that feel generic skipped this step; planning a scroll story goes deeper.

Frame pipeline and tiers

Extracting every tier from one joined file keeps frame numbers aligned across preview, HD and portrait sets, so the player can swap tiers without a jump. The memory rule is plain arithmetic: a 1920 × 1080 frame decoded to RGBA is 1920 × 1080 × 4 = 8,294,400 bytes, so 400 decoded HD frames would need over 3 GB. That is why the player keeps only frames near the scroll position. The commands match the video to image sequence guide.

Rules that come from shipped templates

The canvas and three.js rules mirror what the Edok Motion templates publish in their feature lists. Kestra loads light previews first, streams 1920 × 1072 HD frames nearest the scroll position, releases far frames from memory and ships separate 9:16 portrait frames. Orbitly weights scroll per clip "so fast shots never rush past". MANJARI and Zelvo render 3D only on screen with a capped pixel ratio, and both fall back when WebGL is missing. Kestra, Orbitly and Zelvo all list reduced-motion support with still frames and no smooth scrolling.

Checks with evidence

The last section turns "done" into commands with output: a type-check, a build, a frame count per tier and the weight of each tier. Asking Claude to report those numbers makes a missing portrait tier or a 90 MB frame folder visible before you deploy.

Install it and use it

Create the folder and move the downloaded file into it. For every project on your machine:

Terminalbash
mkdir -p ~/.claude/skills/scroll-story-site
mv ~/Downloads/SKILL.md ~/.claude/skills/scroll-story-site/SKILL.md

Or for one repository, from its root, then commit it:

Terminalbash
mkdir -p .claude/skills/scroll-story-site
mv ~/Downloads/SKILL.md .claude/skills/scroll-story-site/SKILL.md
git add .claude/skills/scroll-story-site/SKILL.md

Run /skills in Claude Code to confirm it is listed. Then either ask in plain words ("build a scroll-driven hero that scrubs these four clips") and let the description trigger it, or invoke it explicitly:

Claude Codetext
/scroll-story-site Plan a four-chapter scroll story for a coffee subscription app. Footage hero, portrait frames for phones. Wait for my approval before writing code.

Extend it with supporting files

When the skill grows, keep SKILL.md as the overview and move detail into files beside it, referenced from the body so Claude knows when to read them. For example, a prompts.md with your art direction blocks or a scripts/extract-frames.sh that wraps the three ffmpeg commands. Scripts run through bash, so only their output enters Claude's context.

If you would rather start from a finished site and use the skill for changes, every template in the catalogue ships its full source. More background on the format is in Anthropic's engineering post, Equipping agents for the real world with Agent Skills, and example skills are published in the anthropics/skills repository.

FAQ

Questions, answered.

The questions people ask most about this topic.

01Where do I put SKILL.md for Claude Code?

In a folder named after the skill: ~/.claude/skills/scroll-story-site/SKILL.md for all your projects, or .claude/skills/scroll-story-site/SKILL.md inside a repository for that project only. Claude Code picks up new skills in a running session without a restart.

02How does Claude know when to use a skill?

Claude sees every skill's description and loads the full SKILL.md when your request matches it. You can also invoke a skill directly by typing /skill-name at the start of a message.

03Can I call the skill "claude-scroll-story"?

Not if you want it to work outside Claude Code. Anthropic's platform rules say the name cannot contain the reserved words "anthropic" or "claude", and must be lowercase letters, numbers and hyphens, up to 64 characters.

04Does the skill work in claude.ai as well as Claude Code?

The SKILL.md uses only name and description, which claude.ai uploads and the Skills API accept. Custom skills on claude.ai are uploaded separately as a zip in settings; they do not sync from Claude Code's folders.

05How long should a SKILL.md be?

The Claude Code docs recommend keeping it under 500 lines and moving detailed reference material into separate files. The skill on this page is about 100 lines.