composing-matchers

composing-matchers is a skill for Claude Code from onsi/gomega. It costs 136 tokens per session (1,534 once invoked), scanned A, original, MIT.

A guide to combining Gomega matchers, which are Go test checks, into larger assertions. TDD means writing tests to describe expected behavior; these matchers help express those expectations.

In plain words
What is it for?
Use it to require all or any conditions, negate checks, transform values, inspect fields or methods, and test every item in a collection.
Why use it?
It avoids scattering related checks across separate assertions and makes compound test conditions explicit.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the gomega plugin — 12 skills shipped together

Good fit Use it to require all or any conditions, negate checks, transform values, inspect fields or methods, and test every item in a collection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/onsi/gomega/composing-matchers
About the project

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.

onsi/gomega · 2,355 stars · on GitHub · onsi.github.io

Install

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.

Any agent
npx skills add onsi/gomega --skill composing-matchers
Clone the repo
git clone --depth 1 https://github.com/onsi/gomega

Made for: Claude Code.

Or install gomega, the plugin that ships this one along with the rest of its 12 skills.

Wrote 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.

agentmods badge for composing-matchers

README.md
[![agentmods](https://agentmods.dev/badge/skills/onsi/gomega/composing-matchers.svg)](https://agentmods.dev/skills/onsi/gomega/composing-matchers)
Your own site
<a href="https://agentmods.dev/skills/onsi/gomega/composing-matchers"><img src="https://agentmods.dev/badge/skills/onsi/gomega/composing-matchers.svg" alt="Measured on agentmods" height="20"></a>
Per session 136 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,534 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00136 $0.01534
Opus 5 $0.00068 $0.00767
Sonnet 5 $0.00027 $0.00307
Haiku 4.5 $0.00014 $0.00153

Measured 9d ago against content hash 8e6bca4aa1ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

composing-matchers 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 9d 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.

plugins/gomega/skills/composing-matchers/SKILL.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Composing and transforming matchers

Gomega matchers are values, so you can wrap and nest them to express several requirements in a single Expect/Eventually. Start with gomega:matchers for the catalog; reach here when one assertion needs to do more. Docs: https://onsi.github.io/gomega/#composing-matchers.

Logical combinators

Expect(n).To(And(BeNumerically(">", 0), BeNumerically("<", 10)))   // all must pass
Expect(msg).To(Or(Equal("Success"), MatchRegexp(`^Error .+$`)))    // any may pass
Expect(s).To(Not(BeEmpty()))                                        // negate
  • And(ms ...GomegaMatcher) / SatisfyAll(...) — identical; succeeds only if every matcher passes. Short-circuits on the first failure.
  • Or(ms ...GomegaMatcher) / SatisfyAny(...) — identical; succeeds if any matcher passes. Short-circuits on the first success.
  • Not(matcher GomegaMatcher) — logical negation; usually clearer than the .NotTo(...) form when nested.

These are the building blocks for lightweight named matchers:

func BeBetween(min, max int) GomegaMatcher {
    return SatisfyAll(BeNumerically(">", min), BeNumerically("<", max))
}
Expect(n).To(BeBetween(0, 10))

WithTransform — map the actual, then match

WithTransform(transform any, matcher GomegaMatcher) applies transform to ACTUAL and matches the result.

Expect(element).To(WithTransform(func(e Element) Color { return e.Color }, Equal(BLUE)))

Transform-function rules: it must take exactly one argument (the actual) and return either one value, or (value, error). Returning an error fails the assertion gracefully instead of panicking — useful for transforms that accept several input types:

func HaveSprocketName(name string) GomegaMatcher {
    return WithTransform(func(actual any) (string, error) {
        switch s := actual.(type) {
        case *Sprocket: return s.Name, nil
        case Sprocket:  return s.Name, nil
        default:        return "", fmt.Errorf("expected a Sprocket, got %T", actual)
        }
    }, Equal(name))
}

Read the full file on GitHub · 120 lines

Changes

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.

  1. 9d ago First seen · 120 lines · 136 tokens per session scan A 8e6bca4aa1ff

Subscribe to this mod's changes

composing-matchers is a skill published in the GitHub repository onsi/gomega (2,355 stars, last pushed 12d ago), licensed MIT. It adds 136 tokens to every session and 1,534 once invoked, about $0.0007 per session on Opus 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.