Vercel Composition Patterns
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
Writing your own Gomega matchers — the GomegaMatcher interface (Match/FailureMessage/NegatedFailureMessage), gcustom.MakeMatcher with message templates and template data, the format package helpers…
$ npx skills add onsi/gomega --skill custom-matchers -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install onsi/gomega custom-matchers --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/onsi/gomega.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/gomega/skills/custom-matchers .claude/skills/custom-matchers && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "custom-matchers" agent skill from https://github.com/onsi/gomega/tree/master/plugins/gomega/skills/custom-matchers into .claude/skills/custom-matchers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "custom-matchers", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/onsi/gomega/tree/master/plugins/gomega/skills/custom-matchersType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add onsi/gomega --skill custom-matchers -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install onsi/gomega custom-matchers --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/onsi/gomega.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/gomega/skills/custom-matchers .agents/skills/custom-matchers && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "custom-matchers" agent skill from https://github.com/onsi/gomega/tree/master/plugins/gomega/skills/custom-matchers into .agents/skills/custom-matchers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "custom-matchers", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add onsi/gomega --skill custom-matchers -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install onsi/gomega custom-matchers --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/onsi/gomega.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/gomega/skills/custom-matchers .cursor/skills/custom-matchers && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "custom-matchers" agent skill from https://github.com/onsi/gomega/tree/master/plugins/gomega/skills/custom-matchers into .cursor/skills/custom-matchers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "custom-matchers", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/onsi/gomega.git --path plugins/gomega/skills/custom-matchers--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add onsi/gomega --skill custom-matchers -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install onsi/gomega custom-matchers --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/onsi/gomega.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/gomega/skills/custom-matchers .gemini/skills/custom-matchers && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "custom-matchers" agent skill from https://github.com/onsi/gomega/tree/master/plugins/gomega/skills/custom-matchers into .gemini/skills/custom-matchers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "custom-matchers", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install onsi/gomega custom-matchersInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add onsi/gomega --skill custom-matchers -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/onsi/gomega.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/gomega/skills/custom-matchers .github/skills/custom-matchers && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "custom-matchers" agent skill from https://github.com/onsi/gomega/tree/master/plugins/gomega/skills/custom-matchers into .github/skills/custom-matchers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "custom-matchers", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add onsi/gomega --skill custom-matchers -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install onsi/gomega custom-matchers --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/onsi/gomega.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/gomega/skills/custom-matchers .opencode/skills/custom-matchers && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "custom-matchers" agent skill from https://github.com/onsi/gomega/tree/master/plugins/gomega/skills/custom-matchers into .opencode/skills/custom-matchers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "custom-matchers", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
custom-matchersWriting your own Gomega matchers — the GomegaMatcher interface (Match/FailureMessage/NegatedFailureMessage), gcustom.MakeMatcher with message templates and template data, the format package helpers…
Custom Matchers is an agent skill from onsi/gomega. Writing your own Gomega matchers — the GomegaMatcher interface (Match/FailureMessage/NegatedFailureMessage), gcustom.MakeMatcher with message templates and template data, the format package helpers (format.Message/format.Object), MatchMayChangeInTheFuture and StopTrying for Eventually/Consistently, and how to test and package custom matchers. Use when a built-in or composed matcher can't express your domain assertion and you need to build one.
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development. The repository describes itself as: Ginkgo's Preferred Matcher Library. The licence is MIT.
Read from SKILL.md and the folder at commit 820ad4d. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are go).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
onsi.github.ioFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Custom Matchers loads about 2.4k tokens when it runs. Until then it costs about 116 tokens; SKILL.md has 714 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from onsi/gomega at commit 820ad4d, republished under its MIT licence (© onsi). 714 words, ~2,371 tokens.
.claude/skills/custom-matchers/SKILL.md (or your agent's skills folder).When no built-in matcher fits and composition (And/Or/WithTransform/SatisfyAll — see gomega:composing-matchers) can't express it cleanly, write a custom matcher. Reach for gcustom.MakeMatcher first — it's the modern, low-boilerplate path. Drop to a hand-written type only when you need full control. Docs: https://onsi.github.io/gomega/#adding-your-own-matchers.
gcustom.MakeMatcher(matchFunc, ...) builds a full types.GomegaMatcher from one function. The match function must be func(actual T) (bool, error):
import (
"github.com/onsi/gomega/gcustom"
"github.com/onsi/gomega/types"
"encoding/json"
"fmt"
"net/http"
"reflect"
)
func RepresentJSONifiedObject(expected any) types.GomegaMatcher {
return gcustom.MakeMatcher(func(response *http.Response) (bool, error) {
ptr := reflect.New(reflect.TypeOf(expected)).Interface()
if err := json.NewDecoder(response.Body).Decode(ptr); err != nil {
return false, fmt.Errorf("failed to decode JSON: %w", err)
}
decoded := reflect.ValueOf(ptr).Elem().Interface()
return reflect.DeepEqual(decoded, expected), nil
}).WithTemplate("Expected:\n{{.FormattedActual}}\n{{.To}} contain the JSON representation of\n{{format .Data 1}}").WithTemplateData(expected)
}Then Expect(resp).To(RepresentJSONifiedObject(book)) just works.
Typed match funcs get free type-checking. Because the func takes *http.Response, gcustom rejects any other actual with a clear error before calling your code. Use func(actual any) (bool, error) only if you want to handle multiple types or do your own type checks.
Return (false, err) for bad input, not a panic. A non-nil error fails the assertion in both the To and NotTo directions — you can't accidentally pass a negated assertion by feeding garbage.
.WithMessage("contain the JSON representation") — simplest. Renders Expected:\n<actual>\nto contain the JSON representation (and not to when negated)..WithTemplate(tmpl, optionalData) — full control. WithTemplate(tmpl, data) is shorthand for .WithTemplate(tmpl).WithTemplateData(data).Custom matcher failed for:\n<actual> message.Template variables and functions:
| token | meaning |
|---|---|
{{.Actual}} | the raw actual value |
{{.FormattedActual}} | actual pretty-printed (indent 1) |
{{.To}} | "to" on positive failure, "not to" on negated failure |
{{.Failure}} / {{.NegatedFailure}} | bools for the two directions |
{{.Data}} | whatever you passed to WithTemplateData |
{{format <obj> <indent>}} | render any object with Gomega's formatter |
Avoid recompiling templates in hot paths. WithTemplate parses on every constructor call. Precompile once with gcustom.ParseTemplate(str) (use that, not raw text/template, so the format func is registered) and pass it to MakeMatcher(matchFunc, tmpl) or .WithPrecompiledTemplate(tmpl).
MakeMatcher returns this; implement it directly only when you need behavior gcustom doesn't expose:
type GomegaMatcher interface {
Match(actual any) (success bool, err error)
FailureMessage(actual any) (message string)
NegatedFailureMessage(actual any) (message string)
}A hand-rolled version of the matcher above:
func RepresentJSONifiedObject(expected any) types.GomegaMatcher {
return &representJSONMatcher{expected: expected}
}
type representJSONMatcher struct{ expected any }
func (m *representJSONMatcher) Match(actual any) (bool, error) {
response, ok := actual.(*http.Response)
if !ok {
return false, fmt.Errorf("RepresentJSONifiedObject matcher expects an *http.Response")
}
ptr := reflect.New(reflect.TypeOf(m.expected)).Interface()
if err := json.NewDecoder(response.Body).Decode(ptr); err != nil {
return false, fmt.Errorf("failed to decode JSON: %w", err)
}
decoded := reflect.ValueOf(ptr).Elem().Interface()
return reflect.DeepEqual(decoded, m.expected), nil
}
func (m *representJSONMatcher) FailureMessage(actual any) string {
return format.Message(actual, "to contain the JSON representation of", m.expected)
}
func (m *representJSONMatcher) NegatedFailureMessage(actual any) string {
return format.Message(actual, "not to contain the JSON representation of", m.expected)
}Conventions:
RepresentJSONifiedObject) returns the matcher; the struct itself stays unexported. Take concrete types in the constructor where you can; use any only when you genuinely must.FailureMessage/NegatedFailureMessage are always called after Match — stash anything you computed in Match on the struct and reuse it in the messages.reflect to interpret generic actual/expected inputs.Use these for messages instead of hand-rolling fmt.Sprintf so output matches every other Gomega matcher:
format.Message(actual, "to <verb>", expected) → Expected\n<actual>\n<message>\n<expected>. Omit expected for a one-sided message.format.Object(obj, indent) → the pretty-printed block Gomega uses everywhere (indent is a uint).format.MessageWithDiff(actual, "to equal", expected) for string-diff highlighting.Eventually/Consistently (see gomega:async) re-invoke your matcher each poll. If a match result can become permanently fixed (e.g. a closed channel, an exited process), implement the optional OracleMatcher method so polling can short-circuit:
func (m *exitMatcher) MatchMayChangeInTheFuture(actual any) bool {
session := actual.(*gexec.Session)
return session.ExitCode() == -1 // true while still running; false once exited
}This is not part of GomegaMatcher — most matchers don't need it. When present, Gomega calls it after each Match; returning false stops polling and fails/passes as appropriate (so Eventually(session).Should(Exit(0)) fails the instant a wrong exit code lands instead of waiting out the timeout). gcustom matchers don't expose this; hand-write the type if you need it.
Only consulted for bare values. If Eventually is polling a function, Gomega can't assume the result is stable, so MatchMayChangeInTheFuture is skipped.
A more direct, modern alternative: have Match return a StopTrying(...) error (or call StopTrying(...).Now()) to abort Eventually/Consistently immediately and fail with your message.
func (m *thing) Match(actual any) (bool, error) {
if irrecoverable {
return false, StopTrying("the resource was deleted; it will never appear")
}
return check(actual), nil
}You can .Wrap(err) and .Attach("desc", obj) onto the signal. Full polling-signal semantics (including TryAgainAfter) live in gomega:async.
Drive the matcher under test with ordinary assertions, and for the error paths call Match directly (an erroring matcher would otherwise just fail your assertion):
var _ = Describe("RepresentJSONifiedObject", func() {
var book Book
var response *http.Response
BeforeEach(func() {
book = Book{Title: "Les Miserables", Author: "Victor Hugo"}
j, err := json.Marshal(book)
Expect(err).NotTo(HaveOccurred())
response = &http.Response{Body: io.NopCloser(bytes.NewBuffer(j))}
})
It("matches an http.Response carrying the object's JSON", func() {
Expect(response).To(RepresentJSONifiedObject(book))
})
It("does not match a different payload", func() {
response.Body = io.NopCloser(strings.NewReader(`{}`))
Expect(response).NotTo(RepresentJSONifiedObject(book))
})
It("errors on the wrong actual type", func() {
_, err := RepresentJSONifiedObject(book).Match("not a response")
Expect(err).To(HaveOccurred())
})
})Assert on FailureMessage(actual) / NegatedFailureMessage(actual) when the wording matters.
format package, put the matcher and its tests in the matchers package, and add the constructor to matchers.go in the top-level package. Issues and PRs welcome at https://github.com/onsi/gomega.You can replace gomega.Default with a type implementing both gomega.Gomega and an Inner() Gomega method that returns the real default, delegating every call through. Useful for cross-suite logging, call counting, or injecting delays to surface timing dependencies — rarely needed, but the seam exists.
See also: gomega:matchers (catalog — check before building), gomega:composing-matchers (build matchers without code), gomega:async (polling signals).
© onsi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in plugins/gomega/skills/custom-matchers of onsi/gomega.
Open the folder on GitHubat commit 820ad4d
Custom Matchers next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Custom Matchers this skillonsi/gomega | 2.4k | — | ~2.4k | Automated safety check: Pass | MIT | |
| Vercel Composition Patternssupabase/supabase | 111k | 58 repos | ~726 | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 297k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Typescript Advanced Typesrolling-scopes/rsschool-app | 10k | 25 repos | ~4.2k | Automated safety check: Pass | MPL-2.0 | |
| PR Babysitteropeninterpreter/openinterpreter | 69k | 3 repos | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Code Review ChecklistshareAI-lab/learn-claude-code | 78k | 4 repos | ~1.1k | Automated safety check: Pass | MIT |
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
rolling-scopes/rsschool-app
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.
openinterpreter/openinterpreter
Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.
shareAI-lab/learn-claude-code
Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.
onyx-dot-app/onyx
Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.
onsi/gomega
Write correct synchronous Gomega assertions — Expect/Ω notation, the To/NotTo/ToNot/Should/ShouldNot equivalences, the multi-return error idiom, Succeed vs HaveOccurred, the .Error() chaining form…
onsi/gomega
Polling assertions in Gomega — Eventually (poll until it passes) and Consistently (must keep passing), the func(g Gomega) callback idiom, WithTimeout/WithPolling/Within/ProbeEvery, WithContext and…
onsi/gomega
Build compound Gomega assertions by combining matchers — And/SatisfyAll (all pass), Or/SatisfyAny (any pass), Not (negate), WithTransform to map the actual before matching, Satisfy for an ad-hoc…
onsi/gomega
Testing streaming io buffers with gbytes — gbytes.NewBuffer() (an io.Writer also returned by gexec sessions), the Say(regexp) matcher that forward-scans from a moving read cursor, the canonical…
onsi/gomega
Testing external processes with gexec — compile binaries with Build/BuildWithEnvironment/BuildIn and CleanupBuildArtifacts, start them with Start returning a Session, await exit with the Exit…
onsi/gomega
The ghttp test HTTP server for testing HTTP clients — NewServer/NewTLSServer, AppendHandlers, the Verify assertions (VerifyRequest/VerifyHeader/VerifyHeaderKV/VerifyJSON/VerifyForm/VerifyBasicAuth/Ve…
Categories
Writing your own Gomega matchers — the GomegaMatcher interface (Match/FailureMessage/NegatedFailureMessage), gcustom.MakeMatcher with message templates and template data, the format package helpers…. Custom Matchers is an agent skill from onsi/gomega.Object), MatchMayChangeInTheFuture and StopTrying for Eventually/Consistently, and how to test and package custom matchers.
Custom Matchers fits situations like: composed matcher cant express your domain assertion and you need to build one.
Run `npx skills add onsi/gomega --skill custom-matchers -a claude-code`. Or copy the skill folder (plugins/gomega/skills/custom-matchers in onsi/gomega) into .claude/skills/custom-matchers in your project. Claude Code loads it when a task matches its description.
Run `npx skills add onsi/gomega --skill custom-matchers -a codex`. Or copy the skill folder (plugins/gomega/skills/custom-matchers in onsi/gomega) into .agents/skills/custom-matchers in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add onsi/gomega --skill custom-matchers -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/custom-matchers, .gemini/skills/custom-matchers, .github/skills/custom-matchers and .opencode/skills/custom-matchers in your project.
SKILL.md names no scripts, command-line tools or credentials: Custom Matchers is instructions for the agent only.
SKILL.md names 1 domain. As links in the text: onsi.github.io. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Custom Matchers is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Custom Matchers: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
onsi (a GitHub user) maintains it in onsi/gomega, which has 2,356 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 10, 2026.
Source: onsi/gomega on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.