Agent skill

Gmeasure

by onsi in onsi/gomega

Benchmark and measure Go code with gmeasure — an Experiment groups named Measurements, recorded via RecordValue/RecordDuration/MeasureDuration or repeated Sample/SampleValue/SampleDuration with…

MITAuto-check passedDevelopment

Install Gmeasure

skills CLI
$ npx skills add onsi/gomega --skill gmeasure -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install onsi/gomega gmeasure --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/onsi/gomega.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/gomega/skills/gmeasure .claude/skills/gmeasure && rm -rf skills-src

Use ~/.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/

Facts

Skill name
gmeasure
GitHub stars
2.4k
Token cost
~2.2k tokens
SKILL.md length
455 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Benchmark and measure Go code with gmeasure — an Experiment groups named Measurements, recorded via RecordValue/RecordDuration/MeasureDuration or repeated Sample/SampleValue/SampleDuration with…

  • You need human-readable benchmarks
  • SKILL.md covers Mental model, Recording values and durations, Sampling: ensembles of data… and Stopwatch: timing sections…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Performance reports

What it does

Gmeasure is an agent skill from onsi/gomega. Benchmark and measure Go code with gmeasure — an Experiment groups named Measurements, recorded via RecordValue/RecordDuration/MeasureDuration or repeated Sample/SampleValue/SampleDuration with SamplingConfig, timed inline with a Stopwatch, summarized through GetStats/Stats (StatMin/Max/Mean/Median/StdDev, ValueFor/DurationFor) and compared with RankStats; decorate output with Units/Precision/Style/Annotation, render in Ginkgo via AddReportEntry, and persist with ExperimentCache. Use when you need human-readable…

Its SKILL.md is about 2.2k 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.

When your agent uses it

  • You need human-readable benchmarks
  • Performance reports
  • Regression baselines (not pass/fail assertions on their own)

Example prompts

  • “/gmeasure”

What it can do on your machine

Read from SKILL.md and the folder at commit 37fa900. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    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.

  • Network

    Links to these hosts (documentation or services it may open):

    • onsi.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gmeasure loads about 2.2k tokens when it runs. Until then it costs about 156 tokens; SKILL.md has 455 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~156
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from onsi/gomega at commit 37fa900, republished under its MIT licence (© onsi). 455 words, ~2,177 tokens.

Download SKILL.mdSave it as .claude/skills/gmeasure/SKILL.md (or your agent's skills folder).
name
gmeasure
description
Benchmark and measure Go code with gmeasure — an Experiment groups named Measurements, recorded via RecordValue/RecordDuration/MeasureDuration or repeated Sample/SampleValue/SampleDuration with SamplingConfig, timed inline with a Stopwatch, summarized through GetStats/Stats (StatMin/Max/Mean/Median/StdDev, ValueFor/DurationFor) and compared with RankStats; decorate output with Units/Precision/Style/Annotation, render in Ginkgo via AddReportEntry, and persist with ExperimentCache. Use when you need human-readable benchmarks, performance reports, or regression baselines (not pass/fail assertions on their own).

gmeasure: benchmarking and measuring code

gmeasure records benchmarks as Experiments that hold one or more named Measurements. Use it standalone (fmt.Println(experiment)) or wire it into Ginkgo for rich report output. Docs: https://onsi.github.io/gomega/#gmeasure-benchmarking-code. For the broader library see gomega:overview.

go
import "github.com/onsi/gomega/gmeasure"

Mental model

  • An Experiment (gmeasure.NewExperiment(name)) groups related measurements for one system/context.
  • A Measurement is a named bag of data points plus a Type: MeasurementTypeValue (float64) or MeasurementTypeDuration (time.Duration). It is created on its first recorded data point; later records of the same name append.
  • Stats are statistical aggregates (min/max/mean/median/stddev) computed over a measurement's data points.

gmeasure does not fail tests by itself. It is a benchmarking/reporting tool. To gate on results you must pull Stats and write your own Expect(...) (or use RankStats(...).Winner()).

go
experiment := gmeasure.NewExperiment("My Experiment")
experiment.RecordDuration("runtime", 3*time.Second) // creates the "runtime" measurement
experiment.RecordDuration("runtime", 5*time.Second) // appends a data point

Recording values and durations

go
// Direct values / durations:
experiment.RecordValue("length", 3.141)
experiment.RecordDuration("runtime", 200*time.Millisecond)

// Callback-driven — gmeasure times MeasureDuration for you:
v := experiment.MeasureValue("length", func() float64 { return computeLength() })
d := experiment.MeasureDuration("save", func() { client.Save(model) })

Experiments are thread-safe — RecordX/MeasureX may be called from any goroutine.

Sampling: ensembles of data points

Run a callback repeatedly to build up many data points. Configure with SamplingConfig:

go
type SamplingConfig struct {
	N                   int           // cap on number of samples
	Duration            time.Duration // cap on total sampling time
	NumParallel         int           // run samples across this many goroutines (>1)
	MinSamplingInterval time.Duration // minimum gap between samples (incompatible with NumParallel)
}

At least one of N or Duration must be set — otherwise sampling has no stop condition. With both, sampling stops at whichever limit hits first.

go
// SampleDuration: time each call, append to "runtime"
experiment.SampleDuration("runtime", func(idx int) {
	RunAlgorithm()
}, gmeasure.SamplingConfig{N: 1000})

// SampleValue: record each returned float64
experiment.SampleValue("alloc-mb", func(idx int) float64 {
	return currentAllocMB()
}, gmeasure.SamplingConfig{Duration: time.Minute, NumParallel: 4})

SampleAnnotatedDuration / SampleAnnotatedValue take callbacks that also return a gmeasure.Annotation per data point. The bare experiment.Sample(func(idx int){...}, cfg) just drives the loop and isn't tied to a measurement — record whatever you like inside it.

Stopwatch: timing sections inline

experiment.NewStopwatch() starts immediately. Record(name) stores elapsed time since the last Reset (or since creation) into a duration measurement; it returns the stopwatch so you can chain. Stopwatches are not thread-safe — make a fresh one per goroutine inside Sample.

go
It("measures the end-to-end performance of the web-server", func() {
	experiment := gmeasure.NewExperiment("end-to-end performance")
	AddReportEntry(experiment.Name, experiment)

	experiment.Sample(func(idx int) {
		defer GinkgoRecover() // these run as goroutines and contain assertions
		stopwatch := experiment.NewStopwatch()

		model, err := client.Fetch("model-id-17")
		stopwatch.Record("fetch")
		Expect(err).NotTo(HaveOccurred())

		stopwatch.Reset()
		Expect(client.Save(model)).To(Succeed())
		stopwatch.Record("save").Reset()

		_, err = client.List("reticulated-models")
		stopwatch.Record("list")
		Expect(err).NotTo(HaveOccurred())
	}, gmeasure.SamplingConfig{N: 100, Duration: time.Minute, NumParallel: 8})
})

Pause() / Resume() bracket out work you don't want counted.

Show full SKILL.md (193 more words)Show less

Stats and rankings

experiment.GetStats(name) returns a Stats. Pull individual stats with the gmeasure.Stat enum: StatMin, StatMax, StatMean, StatMedian, StatStdDev.

go
stats := experiment.GetStats("runtime")
med := stats.DurationFor(gmeasure.StatMedian) // time.Duration (Duration measurements)
mb  := experiment.GetStats("alloc-mb").ValueFor(gmeasure.StatMax) // float64 (Value measurements)

// FloatFor(stat) works for either type (durations come back as float64(ns));
// StringFor(stat) returns a formatted, precision-aware string.

Compare measurements with gmeasure.RankStats(criterion, ...Stats), then .Winner():

go
ranking := gmeasure.RankStats(gmeasure.LowerMedianIsBetter,
	experiment.GetStats("runtime: algorithm 1"),
	experiment.GetStats("runtime: algorithm 2"),
)
AddReportEntry("Ranking", ranking)
Expect(ranking.Winner().MeasurementName).To(Equal("runtime: algorithm 2"))

Criteria: LowerMeanIsBetter, HigherMeanIsBetter, LowerMedianIsBetter, HigherMedianIsBetter, LowerMinIsBetter, HigherMinIsBetter, LowerMaxIsBetter, HigherMaxIsBetter.

Decorations: units, precision, style, annotations

Pass these as variadic args to any RecordX/MeasureX/SampleX call. Units, Precision, and Style must be set on the first data point of a measurement (that's when the measurement is initialized); later they're ignored. Annotation can be attached to any individual data point.

go
experiment.RecordValue("length", 3.141,
	gmeasure.Units("inches"),     // rendered as "length [inches]"
	gmeasure.Precision(2),        // int → %.2f for values
	gmeasure.Style("{{blue}}"),   // Ginkgo console style for the row
	gmeasure.Annotation("box A"),
)
experiment.RecordValue("length", 2.71, gmeasure.Annotation("box B")) // appends w/ annotation

// For Duration measurements, Precision takes a time.Duration to round to:
experiment.MeasureDuration("teardown", teardown, gmeasure.Precision(time.Millisecond))

experiment.RecordNote("...") adds a contextual row to the rendered table.

Ginkgo integration

Register the experiment (and any rankings) as report entries so Ginkgo renders styled tables and includes them in machine-readable reports (ginkgo --json-report):

go
experiment := gmeasure.NewExperiment("my benchmark")
AddReportEntry(experiment.Name, experiment) // also works for Measurement and Ranking

Without AddReportEntry you'll see no output under Ginkgo. Outside Ginkgo, just fmt.Println(experiment) — Experiment/Measurement/Ranking all implement String() (and ColorableString() for styled output).

Caching experiments

gmeasure.NewExperimentCache(dir) (returns (ExperimentCache, error)) persists experiments to disk keyed by name + version. Use it to skip expensive re-runs or to store committed baselines for regression checks.

go
cache, err := gmeasure.NewExperimentCache("./gmeasure-cache")
Expect(err).NotTo(HaveOccurred())

const VERSION = 1 // bump to bust the cache and force recomputation
if experiment := cache.Load(name, VERSION); experiment != nil {
	AddReportEntry(experiment.Name, experiment)
	Skip("cached") // reuse cached results, skip re-measuring
} else {
	experiment = gmeasure.NewExperiment(name)
	// ... measure ...
	cache.Save(experiment.Name, VERSION, experiment)
}

cache.Load returns nil on a miss. Other methods: Save, Delete, List, Clear. For a regression gate, load a committed baseline and assert the current stats stay within a tolerance:

go
baseline := cache.Load("perf", 1)
if baseline == nil {
	cache.Save("perf", 1, experiment) // first run establishes the baseline
} else {
	cur := experiment.GetStats("fetch")
	base := baseline.GetStats("fetch")
	Expect(cur.DurationFor(gmeasure.StatMean)).To(BeNumerically("~",
		base.DurationFor(gmeasure.StatMean), base.DurationFor(gmeasure.StatStdDev)))
}

© onsi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/gomega/skills/gmeasure of onsi/gomega.

Open the folder on GitHubat commit 37fa900

Compare with similar skills

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

Gmeasure compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gmeasure this skillonsi/gomega2.4k—~2.2kAutomated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed
  • 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.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    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.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    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.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    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.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from onsi/gomega

All 12 skills in this repo
  • Assertions

    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…

    2.4k GitHub stars~2.1k tokensUpdated 14 days ago
    Auto-check passed
  • Async

    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…

    2.4k GitHub stars~2.2k tokensUpdated 14 days ago
    Auto-check passed
  • 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…

    2.4k GitHub stars~1.5k tokensUpdated 14 days ago
    Auto-check passed
  • Custom Matchers

    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…

    2.4k GitHub stars~2.4k tokensUpdated 14 days ago
    Auto-check passed
  • Gbytes

    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…

    2.4k GitHub stars~1.5k tokensUpdated 14 days ago
    Auto-check passed
  • Gexec

    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…

    2.4k GitHub stars~1.3k tokensUpdated 14 days ago
    Auto-check passed

Categories

Questions about Gmeasure

What does Gmeasure do?

Benchmark and measure Go code with gmeasure — an Experiment groups named Measurements, recorded via RecordValue/RecordDuration/MeasureDuration or repeated Sample/SampleValue/SampleDuration with…. Gmeasure is an agent skill from onsi/gomega. Benchmark and measure Go code with gmeasure — an Experiment groups named Measurements, recorded via RecordValue/RecordDuration/MeasureDuration or repeated Sample/SampleValue/SampleDuration with SamplingConfig, timed inline with a Stopwatch, summarized through GetStats/Stats (StatMin/Max/Mean/Median/StdDev, ValueFor/DurationFor) and compared with RankStats; decorate output with Units/Precision/Style/Annotation, render in Ginkgo via AddReportEntry, and persist with ExperimentCache.

When should I use Gmeasure?

Gmeasure fits situations like: you need human-readable benchmarks; performance reports; regression baselines (not pass/fail assertions on their own).

How do I install Gmeasure in Claude Code?

Run `npx skills add onsi/gomega --skill gmeasure -a claude-code`. Or copy the skill folder (plugins/gomega/skills/gmeasure in onsi/gomega) into .claude/skills/gmeasure in your project. Claude Code loads it when a task matches its description.

How do I install Gmeasure in Codex?

Run `npx skills add onsi/gomega --skill gmeasure -a codex`. Or copy the skill folder (plugins/gomega/skills/gmeasure in onsi/gomega) into .agents/skills/gmeasure in your project. Codex loads it when a task matches its description.

Can I use Gmeasure in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add onsi/gomega --skill gmeasure -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gmeasure, .gemini/skills/gmeasure, .github/skills/gmeasure and .opencode/skills/gmeasure in your project.

What does Gmeasure need to run?

SKILL.md names no scripts, command-line tools or credentials: Gmeasure is instructions for the agent only.

Does Gmeasure access the network?

SKILL.md names 1 domain. As links in the text: onsi.github.io. This is read from the text; nothing was executed.

Is Gmeasure safe to install?

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.

What licence does Gmeasure use?

Gmeasure is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gmeasure use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Gmeasure?

Skills that share tags, products or a category with Gmeasure: 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.

Who maintains Gmeasure?

onsi (a GitHub user) maintains it in onsi/gomega, which has 2,357 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on September 24, 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.