agentleFS
tkc310tkc310/8341-ui/.claude/skills/ds-storybook-preview/SKILL.md

ds-storybook-preview

Skill1 starsChanged 23 days agoMITView on GitHub

コンポーネントやトークンの見た目が変わる変更を PR にするとき・PR に追加で push したときに使う。ローカルで Storybook をビルドして GitHub Pages に公開し、変わったストーリーへのリンク(ライト / ダーク)を PR 本文に添える。

  • Reads credentials

The file

Files
SKILL.md

PR に Storybook のプレビューを添える

レビューする人が、手元でビルドしなくても変更後の見た目をブラウザで確かめられるようにする。 ビルドと公開は、開発しているエージェントがローカルで行う(CI ではビルドしない)。 プレビューは https://tkc310.github.io/8341-ui/pr-preview/pr-<番号>/(gh-pages ブランチ。ADR-0011)に置かれ、PR を閉じると CI が消す。

いつ使うか

次のどれかを変えて、PR を作るとき、または PR に追加で push したとき。

  • packages/ui/src/(コンポーネント・スタイル)、packages/tokens/src/(トークンの値)
  • apps/storybook/src/、apps/storybook/.storybook/(ストーリー・テーマ切り替え)
  • 上のどれでもないが見た目に影響するもの(Tailwind・Base UI など依存の更新、ビルド設定)

見た目が変わらない変更(文書だけ、スクリプトだけ)には使わない。

手順

  1. コミットして push し、PR を作る(プレビューは PR の番号ごとに置くので、先に PR が要る)。本文は .github/pull_request_template.md を使い、<!-- storybook-preview:start --> 〜 <!-- storybook-preview:end --> の印は消さない
  2. ビルドして公開する: リポジトリのルートで make storybook-preview(PR 番号が見つからないときは PR=<番号>)。最後に URL が出る。Pages への反映に 1〜2 分かかる。ビルドが失敗したら直してから公開する
  3. 変わったストーリーを特定し、PR 本文の「Storybook プレビュー」節を書き換える: pr-body.md を読む(ストーリー ID の引き方、リンクの形、本文の更新方法、書く内容の例)
  4. 自分でも開いて確かめる: ブラウザを使える環境なら、リンクを開いてライト・ダーク・フォーカス表示(Tab キー)と a11y パネルを見る。開けない環境なら、PR 本文に「エージェントは描画を確認していない」と書き、人間に確認を頼む
  5. push するたびに 2〜3 をやり直す(URL は変わらない。本文の「〜時点」のコミットを更新する)

公開に失敗する・Pages に出ないときは、リポジトリの設定を setup.md で確かめる。

やってはいけないこと

  • プレビューの URL だけを貼って、どのストーリーを見ればよいか書かない
  • gh-pages ブランチを手で編集する・強制 push する(main の Storybook や他の PR のプレビューが消える)
  • 他の PR のプレビュー(pr-preview/pr-<別の番号>/)を上書き・削除する
  • 秘密の値(.env など)が入る状態でビルドして公開する。公開リポジトリの Pages は誰でも見られる

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.