sbshot-visual-diff
यह क्या करती है
यह स्किल AI एजेंट को sbshot टूल से दो git संस्करणों पर Storybook stories कैप्चर करने और उनकी तुलना करने में मार्गदर्शन देती है। यह उन फ़्रंटएंड टीमों के लिए है जिन्हें pull request में क्या बदला, इसका दृश्य प्रमाण चाहिए।
कब इस्तेमाल करें
- ✓जब आपको pull request के लिए UI बदलावों के पहले-और-बाद के स्क्रीनशॉट चाहिए।
- ✓जब आपको यह साबित करना हो कि बदलाव ने उन स्क्रीन को नहीं छुआ जिन्हें नहीं छूना था।
- ✓जब आपको समीक्षकों के लिए साझा करने योग्य दृश्य diff रिपोर्ट चाहिए।
Skill का लिंक
https://github.com/SigNoz/signoz/blob/main/.claude/skills/sbshot-visual-diff/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप इस बदलाव से पहले और बाद के हमारे Storybook stories कैप्चर करके दिखा सकते हैं कि कौन-सी स्क्रीन अलग हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
आपका एजेंट दोनों git refs पर stories कैप्चर करता है, स्क्रीनशॉट को path से मिलाता है, और एक diff बनाता है जिसे समीक्षक खोल सके।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
sbshot visual diffs
npx -y github:SigNoz/sbshot shoots Storybook stories and pixel-diffs two runs. Use it. Do not hand-roll a Playwright screenshot loop or a canvas pixel-compare: sbshot already handles story selection, themes, settling, retries, diffing, tagging, a viewer and a static export, and its runs are the format the rest of the team can open.
sbshot is not installed by any package. It is run through npx, so nothing it knows travels into this repo on its own. This file is where that knowledge lives.
The shape of a run
capture <storybook> --name-run <ref> # once per git ref
diff <baseline> <after> # pairs them by relative path
tag <diff> <tag> <story-id>... # what the reviewer should look at
export <diff> --out <dir> # a static site, hostable
<storybook> is a running dev server (http://localhost:6006), a build directory holding index.json, or a project directory with .storybook/. The frontend has no build-storybook script, only storybook dev -p 6006, so point capture at a dev server.
Cover the change with stories first
A diff can only show what a story renders. A screen, state or variant with no story is invisible to sbshot: it produces no pair, so it reads as "nothing changed" rather than "never looked at". This is the failure mode that makes a clean-looking diff worthless.
Before capturing, list the screens and states the change touches and check each has a story. For anything missing, write it first — the signoz-page-story skill covers how. New states reached only by an interaction need a play function, or the capture shoots the page at rest and the state never appears.
Then confirm it worked: the two runs' story counts should differ by exactly the stories the change adds. A new screen that produced no new story id is a screen nobody is reviewing. Say the count in the summary, so a reader can tell coverage from silence.
Rules that are not optional
One freshly started Storybook per ref. Never start one server and switch git branches under it. Vite's HMR reloads the page, but some modules do not re-initialise, so the shot differs silently from a clean boot and the difference looks like a real change. Settle time does not fix this and is not the variable. Use one worktree and one port per ref, and stop each server before the next.
Capture both themes: --theme dark,light. Without it sbshot shoots the story's own default and everything lands in a single default/ folder, so every regression in the other theme is invisible. Themes double the shot count, so scope with --stories or --title, never by dropping a theme.
Baseline is the merge-base, not origin/main. git merge-base origin/main <branch>. Against a moved main, every commit main gained since the branch's base shows up reversed, as though the branch reverted it.
The percentage sorts the list, it does not tell you what matters. A dialog that dims the page scores high for a one-line change, and a whole new form section can score low. Open the shots and say what changed on each screen. The biggest number is usually the least interesting one.
If you cannot explain a pair, assume the capture is at fault, not the code. Open it, crop both sides and compare them before calling it noise. A pixel count and a good guess are not evidence.
Noise, and the floor that proves it
The same story does not always render identically twice. Pairs often move for reasons that have nothing to do with the change:
- a focus ring left on whatever a
playfunction clicked last - a scrollbar appearing, or its thumb resting a few pixels off
- a toast, tooltip or dialog caught mid-fade
- a text caret blinking, or a selection highlight
- an animation or spinner at a different frame
- relative timestamps ("2 days ago") crossing a boundary
- hover or active styling from where the pointer happened to rest
- a late-loading font or image shifting a line of text
Do not argue about these one at a time. Measure them: shoot the same commit twice and diff those two runs against each other. Anything that moves there moved for no reason, so it is noise.
capture <storybook> --name-run noise-a
capture <storybook> --name-run noise-b # same tree, its own fresh server
diff noise-a noise-b --name-diff noise
diff <baseline> <after> --noise noise # marks the movers flaky
The noise run has to cover the same stories as the real diff. Do not
अक्सर पूछे जाने वाले सवाल
दृश्य diff क्या है?
यह एक ही इंटरफ़ेस के दो संस्करणों के स्क्रीनशॉट की तुलना है, जो पिक्सेल बदलाव उजागर करती है।
मुझे stories क्यों चाहिए?
स्किल कहती है कि जिस स्क्रीन की कोई story नहीं, उसे कैप्चर नहीं किया जा सकता, इसलिए उसकी तुलना नहीं हो सकती।
क्या यह पैकेज से इंस्टॉल होती है?
नहीं। स्किल sbshot को npx से चलाती है, इसलिए ज़रूरत पड़ने पर वह लाया जाता है।
जानकारी
लेखक का मूल विवरण
Shoot Storybook stories with sbshot at two git refs and produce a diff a reviewer can read. Use when asked for a visual diff, before/after screenshots, a screenshot comparison for a PR, or to prove a change did not alter screens it should not have.
repo: SigNoz/signoz
लोकप्रियता
- GitHub स्टार
- 33k
- रैंकिंग में स्थान
- #9145
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।