debugging-failures
Qué hace
Esta skill muestra cómo averiguar por qué fallan las pruebas en Go con Ginkgo, sin leer registros largos. Está pensada para desarrolladores y agentes que necesitan detalles de los fallos con rapidez.
Cuándo usarla
- ✓Cuando un conjunto de pruebas de Ginkgo falla y necesitas saber qué prueba falló y por qué.
- ✓Cuando la salida de las pruebas está mezclada porque se ejecutaron en paralelo.
- ✓Cuando quieres volver a ejecutar una prueba fallida con el mismo orden aleatorio.
Link de la skill
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/debugging-failures/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
“Mis pruebas de Ginkgo fallaron. Averigua exactamente qué pruebas fallaron y por qué.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente ejecuta el conjunto una vez con un informe JSON, lee el resultado en una línea y usa un filtro para extraer solo las pruebas fallidas, sus mensajes, la ubicación de los archivos y los registros capturados. Puede repetir la ejecución con la misma semilla para reproducir el fallo.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Debugging Ginkgo failures (especially as an agent)
Ginkgo's terminal output is good for a human; for programmatic diagnosis, prefer a hybrid: terminal for the verdict, JSON + jq for the details. This is empirically the most reliable, lowest-token workflow. Docs: https://onsi.github.io/ginkgo/#reporting-and-profiling-suites.
The workflow: one run, JSON-first diagnosis
# One invocation gives you BOTH the human verdict on the terminal AND a structured report.
# --json-report does NOT suppress console output, so you don't pay for two runs.
ginkgo -r -p --no-color --json-report=report.json --output-dir=.ginkgo-report
- Read the terminal tail for the one-line verdict:
FAIL! -- 5 Passed | 6 Failed | 1 Pending | 1 Skipped. Cheap, immediate. - If there are failures, query the JSON with
jq(filters below) to get exactly the failing specs — stable, addressable, order-independent. - Clean up the report dir when done.
Why hybrid and not one or the other:
- Terminal-only is brittle to parse (free-form text) and, under
-p, interleaves failures in nondeterministic order. - JSON-only is wasteful if you dump it: the full
report.jsonis ~9× the tokens of the terminal output. Ajqfailures-only extraction is a fraction of either. The discipline is filter, don't dump.
Where the JSON lands (use --output-dir deliberately)
--json-report=report.jsonalone writesreport.jsonto the current directory — which scatters into package dirs under-rand risks getting committed.- Prefer
--output-dir=DIRto collect everything in one known place (auto-created). With-r, all suites merge into oneDIR/report.json— ideal: one file, one set ofjqfilters. - Use a gitignored or temp location: a repo-local
.ginkgo-report/(add it to.gitignore) or an absolute temp path (--output-dir=/tmp/ginkgo-report). Don't leavereport.jsonin the working tree. --keep-separate-reports(with-r) writes onePACKAGE_report.jsonper package instead of merging — only reach for it when you must attribute failures per package.
The jq filters (tested against the real schema)
The report is an array of suite reports, each with a .SpecReports[] array.
Verdict / counts per suite:
jq -r '.[] | "\(.SuiteDescription): \([.SpecReports[].State]|group_by(.)|map("\(length) \(.[0])")|join(", "))"' .ginkgo-report/report.json
All failures — name, location, message (the workhorse). Select failed and panicked and timedout — see the trap below:
jq -r '.[].SpecReports[]
| select(.State=="failed" or .State=="panicked" or .State=="timedout")
| "[\(.State|ascii_upcase)] \((.ContainerHierarchyTexts+[.LeafNodeText])|join(" > "))\n \(.Failure.Location.FileName):\(.Failure.Location.LineNumber)\n \(.Failure.Message)"' .ginkgo-report/report.json
Panics — the real user-code line (the headline location lies; see below):
jq -r '.[].SpecReports[] | select(.State=="panicked")
| "PANIC: \(.Failure.ForwardedPanic)\n\(.Failure.Location.FullStackTrace)"' .ginkgo-report/report.json
Drill into one spec by name, with its captured logs:
jq -r '.[].SpecReports[] | select(.LeafNodeText|test("SUBSTRING"))
| "STATE: \(.State)\n\(.Failure.Message)\n--- GinkgoWriter ---\n\(.CapturedGinkgoWriterOutput // "(none)")"' .ginkgo-report/report.json
Slowest specs:
jq '.[0].SpecReports | map([(.ContainerHierarchyTexts+[.LeafNodeText])|join(" "), .RunTime/1e9]) | sort_by(.[1]) | reverse | .[0:10]' .ginkgo-report/report.json
Schema facts you need
State:passed | failed | panicked | pending | skipped | timedout | interrupted | aborted.- Spec name =
ContainerHierarchyTexts(array) +LeafNodeText. Failure.Message— the failure text (Gomega's full expected/got block for assertions).Failure.Location.{FileName,LineNumber,FullStackTrace}.Failure.ForwardedPanic— the panic value (only meaningful forpanicked).Failure.FailureNodeType— e.g.BeforeEachvsIt, so you know a setup node failed.CapturedGinkgoWriterOutput—GinkgoWriterlogs (omitted if empty).SpecEvents[]—By(...)steps and node enter/exit (does not include raw GinkgoWriter text).ParallelProcess— which worker ran the spec (-p).AdditionalFailures[]— failures beyond the primaryFailure(e.g. a failingAfterEachorDeferOnFailurecallback). Usually the primary is
Preguntas frecuentes
¿Por qué no leer el registro completo?
En ejecuciones en paralelo los mensajes de fallo pueden mezclarse, y el informe completo es mucho más grande, así que la skill filtra los detalles.
¿Qué es una semilla?
Es el número que define el orden aleatorio de las pruebas, y reutilizarlo reproduce la misma ejecución.
¿Limpia los archivos del informe?
Sí. La skill termina borrando la carpeta del informe una vez hecho el diagnóstico.
Detalles
Descripción original del autor
Diagnose a failing Ginkgo suite as an agent — always run with --json-report into a predictable temp/gitignored location, read the terminal verdict line, then use jq to extract structured failure details (name, message, file:line, panic value, captured logs). Covers the panicked-vs-failed trap, panic locations pointing into the Go runtime, parallel output interleaving, reproducing with --seed, and progress reports for hangs. Use when a suite failed and you need to know why. Also invokable as /ginkgo:debugging-failures.
repo: onsi/ginkgo
Popularidad
- Estrellas en GitHub
- 9,1 mil
- Posición en el ranking
- #12299
- Licencia
- MIT
- Actualizada
- 9/10/2026
Comentarios
- …
Más skills de este repositorio
ci
9,1 milAyuda a tu agente a configurar pruebas de Ginkgo para la integración continua, con banderas recomendadas que detectan marcas de enfoque o pendientes olvidadas y pruebas inestables.
decorators
9,1 milAyuda a tu agente a usar bien los decoradores de pruebas de Ginkgo, como Serial, Ordered, Label, Focus y los tiempos límite, explicando qué hace cada uno.
filtering
9,1 milAyuda a tu agente a ejecutar solo algunas pruebas de Ginkgo, usando pending, skip, focus, etiquetas, restricciones de versión y filtros de archivo en el orden de prioridad correcto.
ordering-and-flakes
9,1 milAyuda a tu agente a controlar el orden de las pruebas en Go y a gestionar las inestables, usando las opciones Serial y Ordered de Ginkgo y las opciones de reintento.
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.