selfie
3.1.1indexedSnapshot testing and memoization tool for efficient API call management, featuring zero-config setup, inline or disk snapshots, and automatic garbage collection. Supports multiple facets for comprehensive testing.
Snapshot testing and memoization tool for efficient API call management, featuring zero-config setup, inline or disk snapshots, and automatic garbage collection. Supports multiple facets for comprehensive testing.
Visual screenshot testing is an excellent control surface for directing coding agents. Using renders inside the coding loop can increase render counts by 100x to 1000x, which is wildly unaffordable with existing centralized render services such as Chromatic.
Selfie is a visual review gate built for that loop. It runs on your machine beside your agent, in CI, and on GitHub, and it's piloting with StorybookJS. PRs to support other testing models are welcome.
Go to selfie.dev to follow development after the hackathon.
You can also look around the hosted review pages without signing in: here's Selfie reviewing itself.
Paste this into your coding agent, in your project:
Set up Selfie in this repository. If you don't have a checkout of it, clone
https://github.com/diffplug/selfie outside this repository, and run
pnpm install there. Then run this, and follow what it prints:
node --disable-warning=ExperimentalWarning <checkout>/cli/src/main.ts skill quickstart
It works out how your Storybook builds, writes selfie.config.json, proves that a story really renders, warns you about anything in your way, such as uncommitted changes, and offers to set up commit statuses on GitHub. It won't commit anything without asking. You'll get a URL to open, and what to do next.
You'll need Node 26 or later, pnpm, and Docker. Selfie isn't on npm yet, which is why this starts from a checkout.
An agent's loop: selfie review, then look at the diff images it names, then selfie approve <batch> --all, commit, and selfie review again, which has nothing left to ask.
A person's loop is the same, with selfie ui for the looking and deciding.
To work together, a person leaves notes on any story in selfie ui, and either copies them into any agent, or presses Send while the agent runs selfie agent-await-feedback. The agent acts on them, runs selfie render, and answers each with selfie reply. The person flips against the image they commented on, and resolves the note or answers back.
In the cloud, a GitHub Action renders every pushed branch and uploads its batch. Each commit gets a selfie status: red if a story failed or a person rejected a change, yellow if a change is undecided, and green if everything matches what's approved.
A project needs a selfie.config.json at its Git top level, which says where its built Storybook is and how to build it, and may also set its environment, init script, and how close changed hunks join.
From a checkout, pnpm selfie <command> runs these.
The local loop, CI, and commit statuses are all built and in use on this repository.
The cloud service at app.selfie.dev is deployed for a few public repositories. Anyone can view them, and for now only one person can sign in, through GitHub, to approve or upload.
Not built yet:
We previously launched Selfie, a snapshot testing library focused on data rather than screenshots with no cloud or agent integrations. We are backgrounding it to focus on this completely new and unrelated service, which shares the same general theme and name but none of its code. Everything in this repo was built from November 1, 2026 onward for the Meta Global AI Developer Hackathon. The one exception is branding/: the logo and mascot are reused from the earlier library.
Selfie stores data in two places:
~/.config/selfie/<git-origin-slugified>/, in SQLite and image files. Locally generated renders live here, along with what's mirrored from the cloud.app.selfie.dev, with render metadata in a per-project D1 database and image bytes in R2. Signing in goes through GitHub, with pgstencil keeping its sessions in Postgres. Built Storybooks are served from selfieusercontent.com, a site of their own.The landing page at selfie.dev is plain HTML in site/, on Cloudflare Pages. OPERATIONS.md says how each is deployed.
Implementation details:
The full reference is in docs/specs/. Start with the glossary.
The two videos are built in demo-video/ and product-demo/ with HyperFrames (Apache-2.0), GSAP (standard license), and the Bagel Fat One and Jost fonts (OFL-1.1), with voiceover from ElevenLabs.
FSL-1.1-MIT — Copyright 2026 DiffPlug LLC

![]() |
| From Storybook to Chromatic to Selfie: why snapshot testing has to change for coding agents. | The real app: a two-line CSS change touches all 124 stories, and a person and an agent work through it together. |
selfie review prints one JSON document naming the diff images, with an exit code that says whether anything blocks.selfie flakes finds any that still vary between renders.selfie status that links to its review.| Command | Does |
|---|
render | Always renders the Storybook, and records a batch |
review | Shows a batch's diff against what its history has approved, as one JSON document whose exit code says whether anything blocks. With no batch, it uses the one for this exact built Storybook, and records one only if there's none yet. --baseline compares with what a commit's history approved, or with another batch |
approve, reject | Decides on what a batch changed, added, or removed, on any branch, on a dirty tree if you like |
ui | Serves a local review page, to look at a batch's images, approve, and reject. It renders only when you ask it to on the page |
selfie, with no command | Opens every story of a built Storybook, running, to write notes on, which renders what they're on |
notes, agent-await-feedback, reply | How a person's notes on the images reach a coding agent, and how it answers |
push, pull | Sends a batch and its decisions to the cloud, and takes what a commit's history approved, and the default branch's batch it started from, from it |
flakes | Renders a built Storybook several times, and says what wasn't the same each time. selfie skill fix-flakes is a guide for a coding agent to fix what it finds |
skill | Prints a guide for a coding agent: quickstart to set Selfie up in a repository, and fix-flakes to make every story render the same way |
Surfaced from shared tags and platforms — no rankings paid for.