Show the user how their website gets built. A swarm of AI agents rebuilds the finished site on screen, element by element. Boxes are dragged out and scanned in, text is typed, icons pop and charts are
When you finish building a site, the person sees you build it again, fast and visibly. A swarm of named cursors
(agent-01, agent-02, …) drags out a box for every container, scans each one in, types every heading and paragraph,
pops in the icons and traces the charts. They go screen by screen while the page really scrolls, then sweep back to
the top of the finished page. It is a reveal of the work, and a video people want to share.
Everything is one pure function render(t). The live replay and a frame-by-frame video render are identical, every
frame is deterministic, and the soundtrack can be placed on the build's own events.
scripts/agent-build.js is injected into the live site (same origin) by a small replay page,scripts/replay/index.html. The site runs in a frame with a fixed 1920×1080 viewport, so its layout never depends
on the window it's watched in. The engine lets the page settle (lazy images load, the page is scrolled through once
for reveal-on-scroll content, fonts load, then transitions and CSS animations freeze). It then marks every element
that paints:
It packs the page into screens and plans the swarm: 10 to 48 agents, scaled to the page, with a pace solved to a
target length. A child starts as soon as its parent's scan line has passed it.
public/ for Vite, Next.js, Astro, Remix andCRA, static/ for SvelteKit, or the folder holding index.html for a plain site. A plain site with no dev server is
served with node <skill>/scripts/serve.mjs <dir> [port].
node <skill>/scripts/make-replay.mjs <static-dir> --title "Site name" --wall hills
It writes <static-dir>/__replay/ and prints the path to open, e.g. /__replay/?src=%2F&title=…&wall=hills. Point--src at another route to build that page.
violet (abstract ribbons), alpine (lake at dawn), sage (soft folds), hills (green hills,sky) and dunes (golden-hour desert).
preview_start and navigate to thereplay URL. It can't open file:// pages or a server you start from the shell yourself.
The cover ("the agents are getting ready…") stays up while the page settles, then the swarm plays. Space or R
restarts it.
node <skill>/scripts/stills.mjs "http://localhost:<port>/__replay/?src=%2F&title=…" <out-dir> auto
This headless capture works anywhere. It prints __build (elements, agents, screens, pace) and any page errors,
then writes six stills across the build plus contact.png. Look at the sheet:
If something looks wrong, see "When the automatic marks are wrong" below. Show them the contact sheet or a still
along with the link, so they can see the swarm without opening it.
__replay/ sits in a folder that deploys with the site, so suggest adding it to.gitignore, or delete it when they're done.
When __build.pace reports 0.3, the build is running at its fastest. The page has more to build than the target
allows, so the replay runs over. That's usually fine for a live replay. Don't push the pace further; a frantic swarm
reads worse than a longer one. If length matters, compress it in the video with the renderer's knots (a timelapse,
below). Use maxItems (fewer, grouped boxes) or a later src route only when the page itself is too busy.
make-replay.mjs flags)| Parameter | Default | What it does |
|---|---|---|
| src | / | the route to build (same origin) |
| title | — | the window title, usually the site's name |
| wall | hills | the wallpaper; none for plain dark |
| frame | window | bare drops the window, so the site fills the 16:9 stage |
| target | 18 | seconds the build aims for; it's never faster than 3.3× natural, so long pages run over |
| agents | auto | the number of agents: 10 for a small page, up to 48 for a swarm with smaller cursors |
| ending | top | top sweeps back up to the finished hero; hold stays at the bottom |
| accent | #4B89FF | the colour of boxes, scan lines and labels; use the brand colour when it reads well on the site |
| vw, vh | 1920, 1080 | the site's viewport, e.g. vw=1440&vh=900 for a laptop-sized layout |
| mark | — | 1 loads __replay/mark.js for hand-marking (below) |
Render it when they want something to share, or when you were asked for a video. Plan for about 15–18 s for social.
anything.
assets/sfx/) over a synthesized music bed.# 1. frames → muted MP4 (exactly 60/1, no B-frames); saves <name>.cues.json beside it
node <skill>/scripts/render-video.mjs "http://localhost:3000/__replay/?src=%2F&title=Acme&wall=hills" \
acme-build-18s-silent.mp4 18 60 /tmp/chrome-render '[[0,0],[18,<__LOOP>]]'
# 2. score from the cues, master to −16 LUFS, mux
node <skill>/scripts/mix-audio.mjs acme-build-18s-silent.cues.json <skill>/assets/sfx acme-build-18s.wav \
--knots '[[0,0],[18,<__LOOP>]]' --video acme-build-18s-silent.mp4 --out acme-build-18s.mp4
__LOOP from the page first. Use [[0,0],[L,L]] for real speed. Keep typing-heavy openings closerto real speed with an extra knot.
ffprobe shows r_frame_rate=60/1 and avg_frame_rate=60/1, the length isexact, and there's an audio stream. Look at six frames and check one sound against its frame.
references/video-and-sound.md.Automatic marking classifies by what each element paints, so it works on any stack. If a replay looks off, readreferences/engine.md. The usual fixes:
maxItems, which folds busy subtrees into group boxes,or hand-mark groups.
on an unmarked parent or a fixed overlay. Mark it.
For hand-marking, write __replay/mark.js and open the replay with &mark=1:
window.__agentBuildMark = ({ A, wrap, $, $$, autoMark }) => {
autoMark(); // start from the automatic marks, then adjust…
$$('.hero, .pricing-grid').forEach(e => A(e, 'rect', 'Section'));
A($('.logo'), 'pop'); // A(el, 'rect'|'text'|'pop'|'path', label?) · wrap(el) splits mixed text
};
A canvas is built as one "Scene" box, so the standard replay works on any site. For a 3D world the stronger version
builds the scene itself: objects appear as wireframe, resolve to solid and are placed just ahead of the camera, with
the swarm working on screen-projected boxes. That needs hooks in the site's own engine and a virtual clock. Readreferences/webgl-swarm.md; it has two worked examples (a paper-plane flight and a jewellery film).
If a page already defines window.__render(t) and window.__LOOP (a build study, a motion piece), don't rebuild it.
Wrap it in the window and wallpaper and render it. See references/presenting.md, which also covers the chat-tool
shell, where a prompt is typed and the build plays in a preview pane.
pricing) while the measurements came from the wide one, so the cursors drew boxes over empty space. That's why the
site always runs in a fixed 1920×1080 frame, and nothing is measured against the browser window.
opacity:0 gets no animation frames, so a page waiting onrequestAnimationFrame never loads. The replay covers the frame instead of hiding it.
render-video.mjs encodes with -bf 0 and a 60000 timescale, and mix-audio.mjs keeps the video stream untouched.
file:// frame can't bescripted, and the replay says so on its cover.
(about 0.7 each), so ask first.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.