.agents/skills/storybook-startup-benchmark/SKILL.md
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 renderedWhen asked to benchmark Storybook startup:
storybook dev/, not iframe.htmlrequestAnimationFrame()--no-open--repeat <count> support with grouped summary stats.Use these defaults unless the user asks otherwise:
/requestAnimationFrame()storybook dev --no-openDo not measure only CLI output. Server listening is not the same as first story rendered.
Add a small global preview decorator or component that runs once on the first story mount:
requestAnimationFrame()window.__sbStartupBenchmarkwindow.top when same-originperformance.mark('sb:first-story-rendered')Preferred payload:
{
firstStoryRenderedAt: performance.now(),
storyId: id
}
The benchmark script should:
--no-open/For --repeat N, print:
server, browser, and total5.2s or 2m15s, not raw millisecond field namesRecommended 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"
}
}
Use these heuristics when explaining results:
server grows, the regression is likely on the server/build side.browser grows, the regression is likely in manager boot, preview boot, or first-story render.p95 grows a lot, the feature likely increases variability or tail latency.iframe.html loads instead of normal /If a repeated benchmark reports unrealistically low server.average, first check for a stale Storybook server on the same port.
When reporting results:
server, browser, and totalUse this skill when the user says things like:
storybook dev to first story render"