/ginkgo:debugging-failuresfrom ginkgo
Diagnoses failing Ginkgo test suites by combining terminal verdict with structured JSON report analysis. Covers panic vs failure detection, parallel output interleaving, seed-based reproduction, and hang debugging.
Ships in ginkgo. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
# 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
FAIL! -- 5 Passed | 6 Failed | 1 Pending | 1 Skipped. Cheap, immediate.jq (filters below) to get exactly the failing specs — stable, addressable, order-independent.Why hybrid and not one or the other:
-p, interleaves failures in nondeterministic order.report.json is ~9× the tokens of the terminal output. A jq failures-only extraction is a fraction of either. The discipline is filter, don't dump.--json-report=report.json alone writes report.json to the current directory — which scatters into package dirs under -r and risks getting committed.--output-dir=DIR to collect everything in one known place (auto-created). With -r, all suites merge into one DIR/report.json — ideal: one file, one set of jq filters..ginkgo-report/ (add it to .gitignore) or an absolute temp path (--output-dir=/tmp/ginkgo-report). Don't leave report.json in the working tree.--keep-separate-reports (with -r) writes one PACKAGE_report.json per package instead of merging — only reach for it when you must attribute failures per package.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
State: passed | failed | panicked | pending | skipped | timedout | interrupted | aborted.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 for panicked).Failure.FailureNodeType — e.g. BeforeEach vs It, so you know a setup node failed.CapturedGinkgoWriterOutput — GinkgoWriter logs (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 primary Failure (e.g. a failing AfterEach or DeferOnFailure callback). Usually the primary is the first failure; an AbortSuite takes over as primary and the earlier failure moves here.panicked is not failed. select(.State=="failed") silently misses panics. Always include "panicked" (and "timedout").Location.FileName points into the Go runtime, not your code (e.g. runtime_faststr.go). The real line is in Failure.ForwardedPanic + Failure.Location.FullStackTrace.--fail-fast truncates the report to whatever ran before the stop. For a full failure picture, don't use it — Ginkgo keeps going within a suite by default; use --keep-going with -r so one failing package doesn't stop the others.ginkgo --seed=N.--focus="<regex over the full name>" or --focus-file=file:line (→ ginkgo:filtering). Avoid committing FIt.-v (or -vv --trace) for the full inline timeline — By steps, GinkgoWriter output, and the failure point in execution order. Reserve this verbosity for a specific elusive spec; it's noise across a whole suite.DeferOnFailure callback runs before teardown, only on failure; what it records lands in the spec's JSON (ReportEntries, CapturedGinkgoWriterOutput). → ginkgo:writing-specs.--sleep-on-failure=30m (serial only) holds the failed spec before teardown until the timer or ^C. Not for agents or CI.A stuck spec emits no failure. Get a snapshot of what's running without stopping the suite: send SIGINFO (Ctrl+\ is SIGQUIT; macOS Ctrl+T = SIGINFO) or SIGUSR1 on Linux — Ginkgo prints the current node, goroutine stacks, and the last GinkgoWriter lines (a progress report). Make stuck specs auto-report with --poll-progress-after=120s --poll-progress-interval=30s (or per-node PollProgressAfter). Progress reports also appear in the JSON. → ginkgo:timeouts-and-async for making specs interrupt cleanly.
--junit-report / --teamcity-report / --gojson-report exist but lose Ginkgo metadata — use them only to feed an external CI system. For diagnosis, the native --json-report is richer. → ginkgo:reporting.
What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/ciConfigure Ginkgo for continuous integration — the recommended CLI flag set and the rationale for each flag (-r -p --randomize-all --randomize-suites --fail-on-pending --fail-on-empty --keep-going --cover --race --trace --json-report --timeout --poll-progress-after/-interval), invoking via go run to pin the CLI to go.mod, the exit-code safeguards that catch committed Focus/Pending and empty filters, collecting report and coverage artifacts with --output-dir, CI-friendly output (--github-output/--force-newlines/--no-color), and the fixed per-suite cost --race adds (GORACE=atexit_sleep_ms=0). Use when setting up or hardening a CI pipeline for a Ginkgo suite./decoratorsOne-line reference for every Ginkgo decorator, grouped by what it does, with the node types each can decorate — Serial, Ordered, ContinueOnFailure, OncePerOrdered, Label, Focus, Pending, FlakeAttempts, MustPassRepeatedly, NodeTimeout, SpecTimeout, GracePeriod, PollProgressAfter/Interval, SuppressProgressReporting, SpecPriority, SemVerConstraint, AroundNode, Offset/CodeLocation, EntryDescription. Use to look up a decorator's exact name, semantics, and where it's legal./filteringRun a subset of a Ginkgo suite — Pending/PIt/XIt, runtime Skip, programmatic Focus/FIt (and ginkgo unfocus), Label with the --label-filter query language and label sets, suite-level labels, SemVerConstraint/--sem-ver-filter, --focus/--skip and --focus-file/--skip-file, the filtering precedence rules, and --fail-on-pending/--fail-on-empty. Use when you want to run, skip, focus, label, or version-gate specs, or debug why specs were or weren't selected.npx claudepluginhub onsi/ginkgo --plugin ginkgoOther plugins' skills for the same job