본문으로 건너뛰기
Skillpedia
테스트91k · #1321

storybook-startup-benchmark

하는 일

이 스킬은 서버 시작부터 첫 스토리 표시까지 Storybook의 시작 시간을 측정하도록 AI를 안내합니다. 버전이나 변경 사이의 속도를 비교하려는 개발자를 위한 것입니다.

사용하는 경우

  • ✓프로젝트에서 Storybook이 시작되는 데 얼마나 걸리는지 알고 싶을 때.
  • ✓새 버전이 Storybook을 더 느리게 만들었다고 의심될 때.
  • ✓두 버전이나 설정을 비교하기 위해 반복 측정을 원할 때.

스킬 링크

https://github.com/storybookjs/storybook/blob/next/.agents/skills/storybook-startup-benchmark/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/storybookjs/storybook/blob/next/.agents/skills/storybook-startup-benchmark/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분.

작동 방식

AI는 브라우저를 열지 않고 Storybook을 시작한 뒤, 서버가 응답할 때까지 기다리고, 페이지를 열어 첫 스토리가 나타나는 시간을 잽니다. 실행을 반복해 결과를 요약할 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Storybook Startup Benchmark

Purpose

Use this skill to build or explain a repeatable benchmark for Storybook startup:

  • server: process spawn -> Storybook server responds
  • browser: server responds -> first story rendered
  • total: process spawn -> first story rendered

Quick Start

When asked to benchmark Storybook startup:

  1. Confirm the boundary:
    • Start timing immediately before spawning storybook dev
    • Open Storybook at /, not iframe.html
    • Stop timing on first story mount plus one requestAnimationFrame()
  2. Check whether the repo already has a benchmark script. Reuse it if possible.
  3. If not, create a Node script that:
    • starts Storybook without opening a browser
    • waits for the server to respond
    • launches a browser it controls
    • waits for a preview-side render signal
    • prints JSON results
  4. Add --repeat <count> support with grouped summary stats.

Measurement Rules

Use these defaults unless the user asks otherwise:

  • Start URL: /
  • Browser path: normal manager page, let Storybook load the preview iframe itself
  • Render signal: first preview story mount + one requestAnimationFrame()
  • Browser launch: external harness launches the browser, not Storybook
  • Auto-open: keep Storybook from opening a browser. Storybook 11 opens one only with --open; Storybook 10 and older need --no-open

Do not measure only CLI output. Server listening is not the same as first story rendered.

Recommended Implementation

1. Preview-side signal

Add a small global preview decorator or component that runs once on the first story mount:

  • wait one requestAnimationFrame()
  • set a global value like window.__sbStartupBenchmark
  • also mirror that value to window.top when same-origin
  • optionally call performance.mark('sb:first-story-rendered')

Preferred payload:

{
  firstStoryRenderedAt: performance.now(),
  storyId: id
}

2. Harness behavior

The benchmark script should:

  1. Fail fast if the target Storybook port is already in use
  2. Spawn Storybook without opening a browser
  3. Start timing immediately before spawn
  4. Wait for HTTP readiness on the Storybook URL
  5. Launch a controlled browser to /
  6. Wait for the preview-side signal
  7. Print JSON results
  8. Kill the full spawned process group during cleanup

3. Repeated runs

For --repeat N, print:

  • per-run results
  • summary stats grouped by server, browser, and total
  • human-readable durations like 5.2s or 2m15s, not raw millisecond field names

Recommended summary fields:

{
  "server": {
    "average": "5.2s",
    "min": "4.8s",
    "max": "6.1s",
    "p95": "6.0s"
  },
  "browser": {
    "average": "1.9s",
    "min": "1.6s",
    "max": "2.4s",
    "p95": "2.3s"
  },
  "total": {
    "average": "7.1s",
    "min": "6.6s",
    "max": "8.2s",
    "p95": "8.1s"
  }
}

Interpretation Guidance

Use these heuristics when explaining results:

  • If server grows, the regression is likely on the server/build side.
  • If browser grows, the regression is likely in manager boot, preview boot, or first-story render.
  • If averages are close but p95 grows a lot, the feature likely increases variability or tail latency.
  • If newer Storybook without a feature is much faster than older Storybook, but enabling the feature returns timings to older levels, the feature likely erases the newer startup gains.

Common Pitfalls

  • Existing Storybook already running on the benchmark port
  • Storybook auto-opening a separate browser window
  • Measuring direct iframe.html loads instead of normal /
  • Leaving child Storybook processes alive between runs
  • Treating warm repeated runs as cold-start data

If a repeated benchmark reports unrealistically low server.average, first check for a stale Storybook server on the same port.

Tooling Notes

  • Prefer a plain Node script for portability.
  • For Chrome-family browsers, remote debugging is a practical control path.
  • If Storybook CLI flags or behavior are in question, fetch current Storybook docs first.

Output Style

When reporting results:

  • clearly separate server, browser, and total
  • call out averages and p95 first, with min/max as supporting bounds
  • highlight whether the regression affects common-case latency, tail latency, or both
  • avoid claiming root cause unless the benchmark isolates server vs render behavior

Example Triggers

Use this skill when the user says things like:

  • "How can I test Storybook
자주 묻는 질문

무엇을 측정하나요?

세 부분입니다. 서버 시작, 첫 스토리까지의 브라우저 시간, 그리고 전체 시간입니다.

브라우저 창을 여나요?

스킬은 Storybook이 자동으로 창을 열지 않아야 하며, 외부 하네스가 브라우저를 실행한다고 말합니다.

버전을 비교할 수 있나요?

네. 스킬은 반복 실행을 사용해 Storybook 버전이나 기능 플래그를 비교할 수 있다고 말합니다.

상세 정보

작성자의 원본 설명

Measure Storybook startup time from spawning `storybook dev` until the first story renders in the browser. Use when the user asks about Storybook boot time, server-ready timing, first story render timing, startup regressions, benchmarking with repeat runs, or comparing Storybook versions or feature flags.

repo: storybookjs/storybook

인기도

GitHub 스타
91k
순위
#1321
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬