storybook-startup-benchmark
यह क्या करती है
यह स्किल AI को Storybook के स्टार्टअप समय मापने में मार्गदर्शन देती है, सर्वर शुरू करने से लेकर पहली स्टोरी दिखने तक। यह उन डेवलपर के लिए है जो वर्शन या बदलावों के बीच गति की तुलना करना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप जानना चाहते हैं कि आपके प्रोजेक्ट में Storybook शुरू होने में कितना समय लेता है।
- ✓जब आपको शक है कि कोई नया वर्शन Storybook को धीमा कर गया है।
- ✓जब आप दो वर्शन या सेटिंग्स की तुलना के लिए बार-बार माप चाहते हैं।
Skill का लिंक
https://github.com/storybookjs/storybook/blob/next/.agents/skills/storybook-startup-benchmark/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारा Storybook शुरू होने में कितना समय लेता है, यह मापिए। इसे पाँच बार चलाइए और मुझे औसत दिखाइए।”
हर हफ़्ते 5 नई skills, 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 respondsbrowser: server responds -> first story renderedtotal: process spawn -> first story rendered
Quick Start
When asked to benchmark Storybook startup:
- Confirm the boundary:
- Start timing immediately before spawning
storybook dev - Open Storybook at
/, notiframe.html - Stop timing on first story mount plus one
requestAnimationFrame()
- Start timing immediately before spawning
- Check whether the repo already has a benchmark script. Reuse it if possible.
- 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
- 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.topwhen same-origin - optionally call
performance.mark('sb:first-story-rendered')
Preferred payload:
{
firstStoryRenderedAt: performance.now(),
storyId: id
}
2. Harness behavior
The benchmark script should:
- Fail fast if the target Storybook port is already in use
- Spawn Storybook without opening a browser
- Start timing immediately before spawn
- Wait for HTTP readiness on the Storybook URL
- Launch a controlled browser to
/ - Wait for the preview-side signal
- Print JSON results
- Kill the full spawned process group during cleanup
3. Repeated runs
For --repeat N, print:
- per-run results
- summary stats grouped by
server,browser, andtotal - human-readable durations like
5.2sor2m15s, 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
servergrows, the regression is likely on the server/build side. - If
browsergrows, the regression is likely in manager boot, preview boot, or first-story render. - If averages are close but
p95grows 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.htmlloads 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, andtotal - 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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
handle-pr-comments
91kयह आपके एजेंट को GitHub pull request की समीक्षा टिप्पणियाँ एक-एक करके निपटाने में मदद करती है: फ़िक्स सुझाकर, आपका चुनाव लागू करके, और थ्रेड बंद करके।
principle-encode-lessons-in-structure
91kयह आपके एजेंट को बार-बार होने वाली गलतियों को अपने-आप चलने वाली जाँच में बदलना सिखाती है, जैसे lint नियम या स्क्रिप्ट, वही याद दिलाना दोबारा लिखने के बजाय।
storybook-upgrade
91kयह आपके एजेंट को प्रोजेक्ट के सभी Storybook पैकेज चुने गए वर्शन तक अपग्रेड करना दिखाती है, एक बार में एक मेजर वर्शन।
update-pr-description
91kयह आपके एजेंट को जाँचने में मदद करती है कि pull request का शीर्षक और विवरण अभी भी कोड बदलावों से मेल खाते हैं या नहीं, फिर सटीक अपडेट सुझाते हुए।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।