Skip to content

feat(skills): add codspeed-write-benchmarks skill - #621

Open
not-matthias wants to merge 4 commits into
mainfrom
cod-4129-provide-a-skill-for-creating-and-maintaining
Open

not-matthias wants to merge 4 commits into
mainfrom
cod-4129-provide-a-skill-for-creating-and-maintaining

Conversation

@not-matthias

@not-matthias not-matthias commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

TLDR: Agents had no guidance on writing valid CodSpeed benchmarks. This adds a compact skill with rules, a verify step and maintenance tasks, and points the existing skills at it.

New skill codspeed-write-benchmarks

  • Language-agnostic rules: measure only the code under test, constant inputs, isolated state, sizing per instrument, stable identity.
  • Verify step: static review always, one CodSpeed run checked through the MCP tools, reruns only for noisy benchmarks.
  • Maintenance: noisy benchmarks, suite audits, renames and removals, changes to the code under test.
  • Short notes for Rust, Node.js, Python and the exec harness. Details link to the CodSpeed docs.

Existing skills and plugin

  • codspeed-setup-harness: description narrowed to first-time setup, so both skills no longer trigger on "create a benchmark". Its benchmark-writing step now points to the new skill.
  • codspeed-optimize: fix noisy or invalid benchmarks with the new skill before optimizing.
  • plugin.json: long description mentions the new skill.

Review notes

  • "The old benchmark shows up as skipped" after an identity change is inferred, not stated in the docs.

Fixes COD-4129

@not-matthias
not-matthias marked this pull request as ready for review November 10, 2026 15:49
@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds codspeed-write-benchmarks to guide benchmark writing, checks, and maintenance.

  • CodSpeed agents now have a dedicated guide for writing and maintaining benchmarks.
  • Setup and optimization now point benchmark work to the dedicated guide.

Reviews (2) · Last reviewed commit: "docs(plugin): mention benchmark writing ..." · Reviewed by Greptile

@codspeed

codspeed Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 13.49%

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 8 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 1 improved benchmark
✅ 52 untouched benchmarks
⏩ 6 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Walltime memtrack track dd (with physical) 1.4 s 1.2 s +13.49%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cod-4129-provide-a-skill-for-creating-and-maintaining (32c1427) with main (34b48f1)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Agents writing or editing CodSpeed benchmarks had no guidance on what makes a benchmark valid: the existing skills cover harness setup and optimization, not benchmark design.

The skill lists language-agnostic rules (measure only the code under test, keep inputs constant, isolate state, size per instrument, keep names stable), a tiered verify step (static review, one CodSpeed run checked through the MCP tools, reruns only for noisy benchmarks), maintenance tasks for renames and code changes, and short notes for Rust, Node.js, Python and the exec harness. Details link to the CodSpeed docs.
Both skills triggered on requests like 'create a benchmark', and setup-harness repeated a shorter version of the benchmark-writing rules. Narrow its description to first-time setup and replace Step 4 with workload selection plus a pointer to codspeed-write-benchmarks, so the rules live in one place.
Optimizing against a noisy or invalid benchmark produces gains that are not real. Tell the optimize skill to fix such benchmarks with codspeed-write-benchmarks before starting the loop.
List the new codspeed-write-benchmarks skill among the included skills in the plugin long description.
@not-matthias
not-matthias force-pushed the cod-4129-provide-a-skill-for-creating-and-maintaining branch from aee0b29 to 32c1427 Compare November 10, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant