Gomega is a Go library for writing test assertions with matchers, including support for asynchronous checks and several specialized testing sub-libraries. It is used by Go developers, especially alongside the Ginkgo behavior-driven testing framework, to express and evaluate test expectations. The catalogue entries are Claude Code skills and a plugin that help agents use Gomega's matchers and testing idioms.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add onsi/gomega --skill gstructgit clone --depth 1 https://github.com/onsi/gomegaWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/onsi/gomega/gstruct)<a href="https://agentmods.dev/skills/onsi/gomega/gstruct"><img src="https://agentmods.dev/badge/skills/onsi/gomega/gstruct/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/onsi/gomega/gstruct"><img src="https://agentmods.dev/badge/skills/onsi/gomega/gstruct.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00104 | $0.01796 |
| Opus 5.5 | $0.00042 | $0.00718 |
| Sonnet 5.5 | $0.00021 | $0.00359 |
| Haiku 4.5 | $0.00010 | $0.00180 |
Grade A, and why
gstruct scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.
gstruct: matching complex data types
gstruct builds composite matchers that apply a separate matcher to each field of a struct, each element of a slice, each key of a map, or the target of a pointer. It is the tool for fuzzy-matching large, deeply nested values. Docs: https://onsi.github.io/gomega/#gstruct-testing-complex-data-types.
Dot-import gomega; import gstruct normally (or dot-import it too):
import (
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gstruct"
)
The values in Fields/Elements/Keys are themselves matchers. That is the whole point: compose with the core catalog (gomega:matchers) and combinators like And/Or/Not/WithTransform (gomega:composing-matchers). Examples below assume gstruct is dot-imported for brevity.
If you find yourself building an overly complex gstruct matcher, consider if you should be building a custom matcher (gomega:custom-matchers) instead.
Structs — Fields
Fields is map[string]types.GomegaMatcher keyed by field name.
actual := struct {
A int
B bool
C string
}{5, true, "foo"}
Expect(actual).To(MatchAllFields(Fields{
"A": BeNumerically("<", 10),
"B": BeTrue(),
"C": Equal("foo"),
}))
MatchAllFields requires an exact 1:1 mapping — every field must have a matcher and every matcher must map to a field. This is great for maintainability: adding or removing a struct field breaks the test until you update it.
To match a subset/superset, use MatchFields(options, Fields{...}):
// IgnoreExtras: ignore struct fields with no matcher
Expect(actual).To(MatchFields(IgnoreExtras, Fields{
"A": BeNumerically("<", 10),
"B": BeTrue(), // no entry for C — fine
}))
// IgnoreMissing: ignore matchers with no corresponding field
Expect(actual).To(MatchFields(IgnoreMissing, Fields{
"A": BeNumerically("<", 10),
"B": BeTrue(),
"C": Equal("foo"),
"D": Equal("bar"), // ignored — actual has no field D
}))
IgnoreUnexportedExtras is a middle ground: it ignores only unexported extra fields (gstruct can't read them via reflect anyway) while still requiring all exported fields to be matched.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 158 lines · 104 tokens per session scan A 76aa134f8cd7
gstruct is a skill published in the GitHub repository onsi/gomega (2,357 stars, last pushed 9d ago), licensed MIT. It adds 104 tokens to every session and 1,796 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
golang-testing
Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.
setup
Wire Ginkgo into a Go package — install the ginkgo CLI and Ginkgo+Gomega, ginkgo bootstrap to generate the suitetest.go (TestXxx/RegisterFailHandler(Fail)/RunSpecs), the package xxxtest convention, dot-import alternatives (aliased import, dsl/ subpackages, --nodot), ginkgo generate, and testing.T interop via…
timeouts-and-async
Make Ginkgo specs interruptible and test asynchronous behavior — SpecContext/context.Context cancellable nodes, NodeTimeout/SpecTimeout/GracePeriod, the --timeout flag, Abort and SIGINT behavior, Gomega Eventually/Consistently (the func(g Gomega) form, .WithContext), and the defer GinkgoRecover() rule for goroutines.…
eng-test-conventions
Go test-shape discipline for Compozy. Use when writing or editing test.go under cmd or internal after test placement is justified. Do not use for non-Go tests, fixture-only changes, or as a replacement for eng-consolidate-test-suites.
overview
The Ginkgo mental model for writing Go tests — the one idea that explains everything (Ginkgo builds a spec tree at construction time, then runs it) and its consequences for how you write specs, plus spec independence and the node taxonomy. Use this first when you start working with Ginkgo in a project, or to decide…
golang-testing
Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…