to-benchmark
GitHub根据Issue创建基准测试技能,通过对比主分支与指定分支的编码Agent表现,评估问题行为是否改善。
触发场景
安装
npx skills add withcoral/coral --skill to-benchmark -g -y
SKILL.md
Frontmatter
{
"name": "to-benchmark",
"description": "Create a benchmark skill from an issue. The benchmark skill runs coding agents against main and an optional branch and reports whether the issue's behaviour improved.",
"disable-model-invocation": true
}
To Benchmark
Purpose
Create a benchmark skill for one issue. The benchmark skill runs coding agents headlessly against builds of Coral and reports whether the behaviour described in the issue improved.
Input
An issue. Any of the following counts:
- A GitHub or Linear issue reference, passed as the argument.
- A spec file path, passed as the argument.
- The current conversation, when no argument is given.
Output
A new directory .agents/benchmark-skills/bench-<behaviour>/ containing:
SKILL.md, produced by filling in TEMPLATE.md.results.jsonl, empty. The benchmark skill appends one line per run and it is committed. Run output itself goes undertasks/benchmarks/, which git ignores, and is never committed.run.py, a copy of run.py. The benchmark skill runs it once per repeat, and again to read each run's standard metrics. Edit the copy if an agent needs different flags.plot.py, a copy of plot.py. The benchmark skill runs it to writeplots.pngfromresults.jsonl. Edit the copy if the benchmark needs a different plot.
Claude Code and Codex runs load the arm's Coral plugin (plugins/coral, which holds the Coral skill), because users run agents with it installed and a branch may change it. OpenCode runs do not load the plugin, so they cannot measure changes made in the Coral skill. Users who connect only the MCP server never see the skill, so when a change targets agent behaviour, run each agent in two setups: with --coral-plugin and without it.
Procedure
-
Obtain the issue text.
- If a reference was passed, fetch the full body and all comments.
- If no reference was passed, use the conversation.
- If neither describes an agent behaviour, ask the user for the issue.
-
Write the task prompt.
- The task prompt is the message a user would have sent that leads an agent into the behaviour the issue describes.
- Write it as a user would write it. Do not describe the failure or how to avoid it.
- Agents run with their default tools, so the prompt alone has to lead them to Coral and into the behaviour. When a smoke run shows an agent answering another way, or never showing the behaviour, the benchmark skill reports back with a revised prompt; expect to revise.
- Each run produces its own failure. Runs are expected to fail in different ways. The repeat count accounts for this.
- If it is unclear what request leads to the behaviour, or more than one plausible request exists, ask the user before continuing.
-
Write the comparison and the metrics to track.
- The comparison is one sentence: what we want to know about main versus the branch.
- The metrics to track are the values recorded per run that the comparison is computed from. Each is yes/no or a number, read from the transcript. Progress is counted in tool calls, never turns, since transcripts do not mark model rounds.
- EXAMPLE.md is the template filled in for one issue. There, the comparison is recovery rate and speed after a Program failure, and the metrics to track are: hit a Program failure, recovered, calls to recover, execs to recover, correct final answer.
-
Confirm with the user.
- Show the task prompt, the comparison, and the metrics to track. These are developed with the user, so expect changes.
- Ask which agents to run. Offer Claude Code, Codex, and OpenCode as the default.
- For each agent, ask which model and reasoning effort to use. Offer
claude-opus-5-5for Claude Code andgpt-6.1-solfor Codex, at medium effort, as the default.gpt-6.1-solneeds Codex CLI 0.160.0 or later; see KNOWN_ISSUES.md. - Ask how many repeats per agent per arm. Offer 5 as the default.
- Ask how the repeats are scheduled. Offer one lane per agent per arm, lanes in parallel, repeats within a lane in sequence, as the default.
- Revise until approved.
-
Write the benchmark skill.
- Name the skill after the behaviour, for example
bench-program-failure-recovery. - Copy TEMPLATE.md, fill in every placeholder, including the agents with their models and reasoning efforts, the repeat count, and the schedule, and save it as
.agents/benchmark-skills/bench-<behaviour>/SKILL.md. - Create an empty
results.jsonlbeside it. - Copy
run.pyandplot.pybeside it. - Keep the template's standard metrics and report format unless the issue or the user gives a reason to change them.
- Delete the Execution bullet for any agent the user did not choose.
- Name the skill after the behaviour, for example
-
Report to the user.
- State the skill's path.
- State that running it without a target produces the baseline for main, and that a target can be a branch, a commit, or a pull request number.
Reference
EXAMPLE.md is TEMPLATE.md filled in for withcoral/lagoon#122.
版本历史
- e44880e 当前 2026-10-19 01:35


