From ginkgo
Explains the Ginkgo mental model for writing Go tests: tree construction then running, spec independence, and node taxonomy. Use this first when working with Ginkgo.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ginkgo:overviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Ginkgo is an expressive BDD-style testing framework for Go, paired with the [Gomega](https://onsi.github.io/gomega/) matcher library. You build suites out of nested **container** nodes (`Describe`/`Context`/`When`) and **subject** nodes (`It`), with **setup** nodes (`BeforeEach`/`AfterEach`/…) supplying state. You drive it with the `ginkgo` CLI. Strongly prefer `ginkgo` over `go test`.
Ginkgo is an expressive BDD-style testing framework for Go, paired with the Gomega matcher library. You build suites out of nested container nodes (Describe/Context/When) and subject nodes (It), with setup nodes (BeforeEach/AfterEach/…) supplying state. You drive it with the ginkgo CLI. Strongly prefer ginkgo over go test.
Read the canonical narrative docs at https://onsi.github.io/ginkgo/ — they are the source of truth. This skill is the orientation; the other skills go deep.
Ginkgo runs your suite in two distinct phases. Internalizing this explains nearly every Ginkgo gotcha:
Container bodies run at construction time. Setup/subject closures run later, at run time. The consequences you must internalize:
It or BeforeEach.Describe body is set once, shared across every spec, and mutated by whichever spec runs first. Declare in the container, initialize in BeforeEach so every spec gets a pristine copy. → ginkgo:writing-specs.BeforeSuite. → ginkgo:tables-and-dynamic-specs.Ginkgo assumes every spec is independent. This is what lets it randomize order (--randomize-all), run specs in parallel across processes (-p), and run any subset (--focus/labels). The rule that keeps you honest: declare in container, initialize in setup. Deliberate cross-spec dependencies break randomization and parallelism — when you genuinely need ordering, say so explicitly with an Ordered container (→ ginkgo:ordering-and-flakes) rather than relying on definition order.
Ginkgo's parallelism model is process-based: each process runs a subset of the specs, with no shared memory.
Describe, Context, When (identical; pick the one that reads best). Organize the tree.It, Specify (identical). The actual test; contains the assertions.BeforeEach/AfterEach (around every spec), JustBeforeEach/JustAfterEach (split configuration from creation), BeforeAll/AfterAll (once per Ordered container), BeforeSuite/AfterSuite (once per suite), SynchronizedBeforeSuite/SynchronizedAfterSuite (for common setup, then per-process setup when parallel). DeferCleanup registers teardown inline.ReportAfterEach/ReportAfterSuite etc. observe results. → ginkgo:reporting.Serial, Ordered, Label, Focus, FlakeAttempts, SpecTimeout, … → ginkgo:decorators.Failures work by panic: Fail (which Gomega calls for you) panics; Ginkgo recovers it, records the failure, and runs cleanup. A goroutine that might fail needs defer GinkgoRecover() or its panic crashes the suite. → ginkgo:timeouts-and-async.
RunSpecs, the CLI, dot-import alternatives) → ginkgo:setupginkgo:writing-specsDescribeTable, shared behaviors) → ginkgo:tables-and-dynamic-specsginkgo:decoratorsginkgo:filteringginkgo:parallelismginkgo:ordering-and-flakesginkgo:timeouts-and-asyncginkgo:runningginkgo:ciginkgo:reportingginkgo:debugging-failuresnpx claudepluginhub onsi/ginkgo --plugin ginkgoGuides writing Ginkgo specs with container/subject/setup nodes, the 'declare in container, initialize in BeforeEach' rule, and reusable test helpers. Use when writing or reviewing Ginkgo tests.
Explains the Gomega matcher/assertion library for Go: Expect/Ω notation, matchers-as-values, multi-return error idiom, sync vs async assertions, and sub-library overview. Routes to specialized Gomega skills.
Writes and reviews production-ready Go tests: table-driven tests, testify suites, parallel tests, fuzzing, goroutine leak detection, snapshot testing, and integration tests. Use when writing, reviewing, or debugging Go tests.