compare-to-baseline
Skill1 starsChanged 3 months agoMITView on GitHub
Type: skill (deterministic) · Used by: perf-run-one, perf-sweep, run-k6-action gate · Status: LIVE (P1) You will compare the parsed run contract against the team's saved baseline and emit a verdict. Follow these steps exactly — no model judgment. Required: - run_id — string; used to locate reports/<run_id>/contract.json - team — e.g. demo-web - profile — e.g. api-benchmark, browser-journey, load, spike, soak, stress - exit_code — integer from run-k6-script output Reject and STOP if: - reports/<run_id>/contract.json does not exist If the…
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- k6-browser-testSkill
- k6-load-testSkill
- k6-playwright-converterSkill
- k6-smoke-testSkill
- k6-test-plannerSkill
- apply-ws2-conventionsSkill
- author-resilient-playwrightSkill
- build-status-viewsSkill
- choose-k6-execution-modeSkill
- compare-coreSkill
- corroborate-2-sourcesSkill
- curate-baselinesSkill
- doc-consistency-checkSkill
- emit-otlp-and-prometheusSkill
- estimate-token-costSkill
- explore-product-structureSkill
- file-perf-regression-jiraSkill
- func-verdictSkill
- heal-playwright-suiteSkill
- k6-profile-benchmarkSkill
- k6-profile-loadSkill
- k6-profile-soakSkill
- k6-profile-spikeSkill
- k6-profile-stressSkill
- learn-via-k6-docsSkill
- link-grafana-panelSkill
- notify-responsible-teamSkill
- open-draft-prSkill
- parse-k6-json-summarySkill
- parse-playwright-summarySkill
- perf-run-logSkill
- run-k6-scriptSkill
- run-ledgerSkill
- run-playwright-suiteSkill
- scope-reviewSkill
- scrub-har-secretsSkill
- triage-func-verdictSkill
- triage-perf-verdictSkill
- verify-k6-scriptSkill
- verify-playwright-suiteSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
If the mapped baseline file does not exist → emit overall_verdict: "no-baseline" and STOP (not an error.
- Very specific: line 31
Env guard: after reading the baseline, verify its env field matches the run's env input.
- Distinctive: line 33
Never score a run against another environment's thresholds.
- Very specific: line 128
Read, Write, Bash (only to run node compare-core.js) — no MCP, no model calls.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
compare-to-baseline
Compare a new run against the saved baseline → green / red.
Type: skill (deterministic) · Used by: perf-run-one, perf-sweep, run-k6-action gate · Status: LIVE (P1)
Prompt
You will compare the parsed run contract against the team's saved baseline and emit a verdict. Follow these steps exactly — no model judgment.
1 — Validate inputs
Required:
run_id— string; used to locatereports/<run_id>/contract.jsonteam— e.g.demo-webprofile— e.g.api-benchmark,browser-journey,load,spike,soak,stressexit_code— integer fromrun-k6-scriptoutput
Reject and STOP if:
reports/<run_id>/contract.jsondoes not exist
If the mapped baseline file does not exist → emit overall_verdict: "no-baseline" and STOP (not an error; baselines are seeded at P2).
Baseline filename mapping (env-aware):
env == stg→baselines/<team>.<profile>.json(stg is the default; no suffix)env != stg→baselines/<team>.<profile>.<env>.json(e.g.baselines/demo-web.api-benchmark.prod.json)
e.g. demo-web + api-benchmark + stg → baselines/demo-web.api-benchmark.json
Env guard: after reading the baseline, verify its env field matches the run's env input.
Mismatch → emit overall_verdict: "no-baseline" with reason "env mismatch: baseline=<x>, run=<y>" and STOP.
Never score a run against another environment's thresholds.
2 — Read inputs
Read:
reports/<run_id>/contract.jsonbaselines/<team>.<profile>.json
3 — Run compare-core logic
Preferred path (guaranteed gate parity): execute the ONE compare-core implementation directly — it handles every step below, writes verdict.json, and prints the summary line:
node .github/actions/run-k6-action/compare-core.js \
--contract reports/<run_id>/contract.json \
--baseline baselines/<team>.<profile>.json \
--exit-code <exit_code> --run-id <run_id> \
--out reports/<run_id>/verdict.jsonExit 0 covers green/red/no-baseline in report-only mode; read
overall_verdict from the written verdict.json. Only fall back to applying
the rules manually (below) if Node is unavailable.
Apply the compare-core verdict rules exactly:
a. Exit code 97 → immediate FAIL
b. Missing endpoints → red
For each endpoint/metric defined in the baseline, check if it appears in contract.endpoints.
- Baseline uses
endpoints[].nameor a top-levelmetricsobject keyed by metric name (browser-journey style) - Match by
namefield in contract endpoints, OR bymetricfield if present
c. Per-endpoint verdict For each matched endpoint:
p95 == null → red
p95 <= p95_red_ms → green
else → red
error_rate > error_rate_red → red (override)d. Overall verdict = worst of all endpoint verdicts (fail > red > green)
e. Compute deltas
delta_ms = p95_ms - p95_red_ms
delta_pct = (delta_ms / p95_red_ms) * 100 (1 decimal)4 — Write verdict.json
Write to reports/<run_id>/verdict.json:
{
"run_id": "<run_id>",
"team": "<team>",
"profile": "<profile>",
"env": "<from contract or baseline>",
"overall_verdict": "green" | "red" | "fail" | "no-baseline",
"exit_code": <n>,
"endpoints": [
{
"name": "<string>",
"metric": "<string>",
"p95_ms": <integer or null>,
"p95_red_ms": <integer>,
"delta_ms": <integer>,
"delta_pct": <float>,
"verdict": "green" | "red",
"reason": "<only if not green>"
}
],
"missing_endpoints": [],
"summary_line": "<one line: e.g. 'GREEN — GET /api/config p95=668ms (within threshold ≤900ms)' or 'RED — GET /api/config p95=1250ms (threshold 900ms, +350ms +38.9%)'>"
}5 — Return
Return:
{
"verdict_path": "reports/<run_id>/verdict.json",
"overall_verdict": "<verdict>",
"summary_line": "<one line>"
}Tools
Read, Write, Bash (only to run node compare-core.js) — no MCP, no model calls.
Data
- Reads:
reports/<run_id>/contract.json,baselines/<team>.<profile>.json - Writes:
reports/<run_id>/verdict.json
Hard rules
- One verdict implementation — this skill applies
compare-corelogic verbatim. Do not invent a second compare path. - No baseline =
no-baselineverdict, not an error — baselines are seeded at P2; before that, the workflow recordsno-baselineand continues. - Exit 97 = FAIL — never evaluate thresholds on a crashed run.
- Missing endpoint = red — a baseline endpoint absent from the contract is always red.
- No model calls — zero autonomy; this runs on the gate hot path.
Frozen skill registry: AGENTS.md in this repo
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

