decorators
What it does
This skill is a reference for the decorators that change how Ginkgo runs or selects tests. It is for developers writing Go tests with Ginkgo who need the right option.
When to use it
- βWhen you want certain Ginkgo tests to run one at a time or in a fixed order.
- βWhen you want to tag tests with labels so you can run only some of them.
- βWhen a slow test needs a timeout or a retry setting.
Skill link
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/decorators/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βMake this Ginkgo test run on its own, not in parallel, with a 30 second timeout.β
5 new skills a week. 1 minute to read.
How it works
The agent picks the right decorator for each node, such as Serial for no parallel runs or NodeTimeout for a time limit, and checks which kinds of blocks each decorator can be placed on.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Ginkgo decorator reference
Terse lookup. Decorators are passed alongside a node's text/closure: It("...", Serial, Label("slow"), func(){...}). Most attach to containers and/or subjects; some are setup-only or interruptible-only. Decorators on a container apply to all nodes within it; the innermost/most-specific wins when they conflict. Full docs: https://onsi.github.io/ginkgo/#decorator-reference.
Execution / ordering
Serial(container, subject) β never runs in parallel; Ginkgo runs serial specs last, on process #1. βginkgo:parallelism.Ordered(container only) β child specs run in definition order, never reordered; enablesBeforeAll/AfterAll. βginkgo:ordering-and-flakes.ContinueOnFailure(outermostOrderedcontainer only) β a failing spec doesn't skip the rest of the ordered group.OncePerOrdered(setup nodes) β makes aBeforeEach/AfterEachrun once around anOrderedcontainer (like aBeforeAll) instead of per-spec.SpecPriority(int)(container, subject) β hint to run higher-priority specs earlier; use sparingly, not to impose a total order.
Selection / filtering (β ginkgo:filtering)
Label("a", "b")(container, subject) β tag specs for--label-filter; labels union down the hierarchy. No&|!,()/"chars.Focus(container, subject) β run only focused specs; don't commit it (CI exits non-zero). Constructors:FDescribe,FContext,FIt,FEntry.Pending(container, subject) β never run (and never compiled into the run set); no closure needed. Constructors:PDescribe,XDescribe,PIt,XIt,PEntry.SemVerConstraint(">= 2.0.0", ...)/ComponentSemVerConstraint("redis", ">= 8.0.0")(container, subject) β run only when--sem-ver-filtersatisfies the constraint; children may narrow, not widen.
Flakiness / repetition (β ginkgo:ordering-and-flakes)
FlakeAttempts(n)(container, subject) β retry a failing spec up tontimes; a later pass marks it flaky, not failed. CLI--flake-attempts=noverrides.MustPassRepeatedly(n)(container, subject) β the spec must passntimes in a row to count as passed.
Timeouts / interruption (interruptible nodes β those taking ctx SpecContext; β ginkgo:timeouts-and-async)
NodeTimeout(d)(subject, setup,DeferCleanup/DeferOnFailure) β deadline for a single interruptible node.SpecTimeout(d)(Itonly) β deadline for the whole spec (all its nodes combined).GracePeriod(d)(subject, setup,DeferCleanup/DeferOnFailure) β how long Ginkgo waits for an interrupted node to return before leaking it; overrides--grace-period.
Progress reporting (β ginkgo:debugging-failures)
PollProgressAfter(d)(subject, setup) β emit a progress report if the node runs longer thand;0disables.PollProgressInterval(d)(subject, setup) β interval between progress reports once they start.SuppressProgressReporting(subject, setup) β silence progress reports for this node.
Wrapping / advanced
AroundNode(fn)(any node, incl.RunSpecs) β wrap a node's execution; forms a stack on a container applied to every descendant node (unlikeBeforeEach, which runs once per spec). Forms: a barefunc(), a context transformerfunc(context.Context) context.Context, or a full wrapperfunc(ctx, func(context.Context)).
Location / identity (rarely needed by hand)
Offset(n)(any node) β skipnstack frames when computing the reported code location. PreferGinkgoHelper()inside helper funcs instead.CodeLocation(loc)(any node) β supply atypes.CodeLocationexplicitly.
Tables
EntryDescription("format %d")β auto-formatEntrydescriptions from their parameters; usable table-wide or per-entry. βginkgo:tables-and-dynamic-specs.Entry/Italso acceptLabel,Focus,Pending,FlakeAttempts, etc. β every decorator above works on table entries.
Reporting
ReportEntryVisibility{Always,FailureOrVerbose,Never}β passed toAddReportEntryto control console emission. βginkgo:reporting.
FAQ
Can decorators apply to a whole group of tests?
Some can. The skill notes which decorators work on a group and which work on single tests.
What happens if two decorators conflict?
The most specific one, closest to the test, takes precedence.
Should Focus be committed?
No. The skill says not to commit Focus, since CI fails when it is left in.
Details
Original description by the author
One-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.
repo: onsi/ginkgo
Popularity
- GitHub stars
- 9.1k
- Ranking position
- #12300
- License
- MIT
- Updated
- 10/9/2026
Comments
- β¦
More skills from this repository
ci
9.1kHelps your agent set up Ginkgo tests for continuous integration, with recommended flags that catch leftover focus or pending markers and flaky tests.
debugging-failures
9.1kHelps your agent find out why Ginkgo tests failed by reading the summary line and pulling the exact failing tests and messages from a JSON report.
filtering
9.1kHelps your agent run only some Ginkgo tests, using pending, skip, focus, labels, version constraints and file filters in the right order of precedence.
ordering-and-flakes
9.1kHelps your agent control the order of Go tests and handle flaky ones, using Ginkgo's Serial and Ordered settings and retry options.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.