본문으로 건너뛰기
Skillpedia
테스트33k · #9145

sbshot-visual-diff

하는 일

이 스킬은 sbshot 도구로 두 git 버전에서 Storybook 스토리를 캡처해 비교하도록 AI 에이전트를 안내합니다. 풀 리퀘스트가 무엇을 바꿨는지 시각적으로 보여 주려는 프론트엔드 팀을 위한 스킬입니다.

사용하는 경우

  • ✓풀 리퀘스트를 위해 UI 변경의 변경 전후 스크린샷이 필요할 때.
  • ✓건드리지 말아야 할 화면이 바뀌지 않았음을 증명해야 할 때.
  • ✓리뷰어를 위해 공유할 수 있는 시각적 차이 보고서가 필요할 때.

스킬 링크

https://github.com/SigNoz/signoz/blob/main/.claude/skills/sbshot-visual-diff/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/SigNoz/signoz/blob/main/.claude/skills/sbshot-visual-diff/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 변경 전후의 Storybook 스토리를 캡처해서 어떤 화면이 다른지 보여 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 두 git 기준점에서 스토리를 캡처하고, 경로별로 스크린샷을 짝지은 뒤, 리뷰어가 열어 볼 수 있는 차이 결과를 만듭니다.

기술 내용 (원본 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 play function 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

자주 묻는 질문

시각적 차이란 무엇인가요?

같은 화면의 두 버전 스크린샷을 비교해 픽셀 변화를 강조하는 것입니다.

왜 스토리가 필요한가요?

스토리가 없는 화면은 캡처되지 않아 비교할 수 없다고 스킬은 말합니다.

패키지로 설치하나요?

아닙니다. 스킬은 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
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬