storybook-startup-benchmark
Qué hace
Esta skill guía a la IA para medir el tiempo de arranque de Storybook, desde iniciar el servidor hasta mostrar la primera historia. Es para desarrolladores que quieren comparar la velocidad entre versiones o cambios.
Cuándo usarla
- ✓Cuando quieres saber cuánto tarda Storybook en arrancar en tu proyecto.
- ✓Cuando sospechas que una versión nueva hizo que Storybook arrancara más despacio.
- ✓Cuando quieres mediciones repetidas para comparar dos versiones o dos ajustes.
Link de la skill
https://github.com/storybookjs/storybook/blob/next/.agents/skills/storybook-startup-benchmark/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Mide cuánto tarda en arrancar nuestro Storybook, ejecútalo cinco veces y enséñame la media.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La IA inicia Storybook sin abrir un navegador, espera hasta que el servidor responde y después abre una página y mide cuánto tarda en aparecer la primera historia. Puede repetir la ejecución y resumir los resultados.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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
Preguntas frecuentes
¿Qué se mide?
Tres partes: el arranque del servidor, el tiempo del navegador hasta la primera historia y el total.
¿Abre una ventana del navegador?
La skill dice que Storybook no debe abrir una automáticamente, y que un arnés externo lanza el navegador.
¿Puede comparar versiones?
Sí. La skill dice que puede comparar versiones de Storybook o indicadores de funcionalidad con ejecuciones repetidas.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 91 mil
- Posición en el ranking
- #1321
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
handle-pr-comments
91 milAyuda a tu agente a trabajar los comentarios de revisión de un pull request de GitHub uno a uno, sugiriendo un arreglo, aplicando tu elección y resolviendo el hilo.
principle-encode-lessons-in-structure
91 milEnseña a tu agente a convertir los errores repetidos en comprobaciones automáticas, como una regla de lint o un script, en lugar de escribir otra vez el mismo recordatorio.
storybook-upgrade
91 milMuestra a tu agente cómo actualizar todos los paquetes de Storybook de un proyecto a la versión elegida, una versión mayor cada vez.
update-pr-description
91 milAyuda a tu agente a comprobar si el título y la descripción de un pull request siguen coincidiendo con los cambios de código, y después sugerir actualizaciones precisas.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.