ReduxやReact Contextに集まった状態を用途別に分類し、APIデータ・URLで共有する条件・画面内の状態それぞれに合う管理方法へ移すスキル。
- ReduxやReact Contextから移行したいとき
- APIデータの二重管理を解消したいとき
- 検索条件やページ番号をURLで共有
Storybookの画面をGitの変更前後で撮影し、明暗両テーマの見た目を比較します。撮影時の揺れも確認し、レビュー用の注釈付き差分ページにまとめます。
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.
Storybookの画面をGitの2つの時点で撮影し、見た目の差分をレビュー用にまとめます。sbshotで明暗両テーマを比較し、重要な変更にタグと注釈を付け、共有用の静的ページを書き出します。変更・新規・完全一致・撮影が不安定な画面の件数も報告します。
UIを変更したPRで、どの画面がどう変わったかを伝えたいときに向いています。変更対象の画面や状態にストーリーがあるかも確認するため、比較対象からの漏れを点検できます。同じコミットを2回撮影し、アニメーションやフォーカスによる揺れを調べる手順も含みます。
npxで実行するsbshotと、撮影対象のStorybookが必要です。ストーリーのない画面や状態は比較できません。各時点でStorybookを新しく起動し、基準には分岐元の共通コミットを使います。共有には書き出したページの公開先が必要です。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
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.
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.
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.
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.
The same story does not always render identically twice. Pairs often move for reasons that have nothing to do with the change:
play function clicked lastDo 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 scope it
down to the few pairs that moved, however tempting that is. --noise marks a
pair flaky when the noise diff does not show it as unchanged, so every story the
noise run leaves out is marked flaky too, including the new screens the reviewer
is there to look at. Shooting two narrow runs and diffing those against each
other has the same problem. Either shoot the full set twice, or skip --noise
and explain the few movers by hand.
That is the trade: a second full capture costs about as long as the first, so on
a small diff it is often quicker to crop the two or three movers and say what
each one is. Use --noise when the diff is large, or when wiring --fail-over
into CI, where something has to decide without a person looking.
If a pair is flaky every run and the state it captures matters, fix the story
rather than living with it: blur what the play clicked, freeze the clock, or
assert the state instead of shooting it.
A reviewer cannot open localhost, so sbshot ui is for you, not for them.
tag the pairs that matter, with --note saying why. The viewer filters by
tag, so the reviewer lands on the real changes instead of scrolling past
noise that scored higher.export <diff> --out <dir>. It writes a static site carrying only the pairs
that are not identical, converted to WebP, so a large diff stays small.index.html is reserved for the artifact's own page, so
publish sbshot's entry as viewer.html and link to
viewer.html#/job/diff/<diff>.Say the numbers plainly: how many screens changed, how many are new, how many are pixel-identical, how many are flaky. The count of unchanged screens is often the most useful claim in the diff, because it is the one a reviewer cannot check by eye.
--title "Pages/Alerts" or
--stories "a,b,c" (substring match on id or Title/Name, repeatable).i18n-translations-hash.json is
gitignored and generated. Run node ./i18-generate-hash.cjs in
<worktree>/frontend, and symlink node_modules from the main checkout.pnpm test:storybook starts its own server on 6006 and hangs silently if
something already holds that port. Free it first.--mode green-parallel fails
with unable to read font `' . Map Helvetica to a real file in
~/.config/ImageMagick/type.xml.sbshot link <dir> <name> adds a run from elsewhere into the workspace, but it
symlinks. Keep the source directory alive until you have exported.page.goto: Timeout from resource starvation. Scope it; CI is the real signal.--theme dark,light on every captureまだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
ReduxやReact Contextに集まった状態を用途別に分類し、APIデータ・URLで共有する条件・画面内の状態それぞれに合う管理方法へ移すスキル。
新しいページやコンポーネントのひな形をコマンドで生成し、関連ファイルを機能ごとにまとめます。タブ付き画面の構成とページのルート登録も扱うスキル。
SigNozのページが使うAPIや表示状態を調べ、読み込み中・エラー・権限差などを操作パネルから再現できるStorybookのストーリーを作るスキル。