agentleFS
kvantatechkvantatech/RedLine/.github/skills/link-grafana-panel/SKILL.md

link-grafana-panel

Skill1 starsChanged 3 months agoMITView on GitHub

Type: skill (deterministic — pure string construction, no network, no token) · Used by: perf-run-one, perf-sweep · Status: LIVE (P3 — links the LGTM Perf - <team> dashboard; no GRAFANA_SERVICE_ACCOUNT_TOKEN needed) You are the link-grafana-panel skill. You construct a deep-link to the per-project LGTM dashboard (Perf - <team>, uid perf-<team> by convention), pre-filtered to the exact run(s) and time window, for embedding in the Jira draft (grafana_url) and the Slack alert. This is pure URL construction — no Grafana API…

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Gate: If observe is not 1 → return { "grafana_url": "", "reason": "run not exported (OBSERVE off) — no data in Mimir to link" }.

    line 21
  2. Very specific:

    If a confirm run is supplied, extend to to the confirm run's end + 60s (one window covering both runs).

    line 35

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

link-grafana-panel

Build a URL-encoded Grafana deep-link to the exact run window for the ticket / proof.

Type: skill (deterministic — pure string construction, no network, no token) · Used by: perf-run-one, perf-sweep · Status: LIVE (P3 — links the LGTM Perf - <team> dashboard; no GRAFANA_SERVICE_ACCOUNT_TOKEN needed)

Prompt

You are the link-grafana-panel skill. You construct a deep-link to the per-project LGTM dashboard (Perf - <team>, uid perf-<team> by convention), pre-filtered to the exact run(s) and time window, for embedding in the Jira draft (grafana_url) and the Slack alert. This is pure URL construction — no Grafana API call, no auth, no model call.

Inputs (from the workflow):

  • team, profile, env, run_id
  • started_at (ISO) + duration_s — from reports/<run_id>/contract.json
  • observe — whether the run exported OTLP (OBSERVE=1)
  • optional: confirm_run_id + its started_at/duration_s (corroborated reds — from reports/<run_id>_confirm/contract.json)

Steps

  1. Gate. If observe is not 1 → return { "grafana_url": "", "reason": "run not exported (OBSERVE off) — no data in Mimir to link" }. A link to an empty panel is worse than no link.
  2. Resolve the Grafana host (where the run's OTLP export landed):

    envhost
    stghttps://grafana.example.com
    prodhttps://grafana.example.com
  3. Dashboard path by convention: /d/perf-<team>/perf-<team> (per-project dashboard rule — one dashboard per project, uid perf-<project>, lives in the team-perf folder).
  4. Time window: from = epoch_ms(started_at) − 60000; to = epoch_ms(started_at) + duration_s×1000 + 60000. If a confirm run is supplied, extend to to the confirm run's end + 60s (one window covering both runs).
  5. Variables (must match the dashboard's templating + the script tag contract):
    • var-environment — map env: stg → staging, prod → prod-us
    • var-test_file — <profile> (e.g. api-benchmark)
    • var-run_id — <run_id>; if a confirm run exists, repeat the param (&var-run_id=<run_id>&var-run_id=<run_id>_confirm — multi-select shows both bars side by side)
  6. Assemble + URL-encode each value:

    <host>/d/perf-<team>/perf-<team>?orgId=1&from=<from_ms>&to=<to_ms>&var-environment=<env_tag>&var-test_file=<profile>&var-run_id=<run_id>[&var-run_id=<confirm_run_id>]
  7. Return { "grafana_url": "<url>" }. The workflow fills it into jira-draft.md (evidence section) before any filing, and passes it to notify-responsible-team.

Example (corroborated red)

https://grafana.example.com/d/perf-demo-web/perf-demo-web?orgId=1&from=1781102342000&to=1781103062000&var-environment=staging&var-test_file=api-benchmark&var-run_id=demo-web_api-benchmark_stg_20260610T143022Z&var-run_id=demo-web_api-benchmark_stg_20260610T143022Z_confirm

Hard rules

  • No Grafana API, no token, no network. A deep-link is a string. (The GRAFANA_SERVICE_ACCOUNT_TOKEN is NOT needed here — it only unlocks the reviewer's optional Grafana-MCP context enrichment.)
  • Never link a run that didn't export (observe != 1 → empty url + reason).
  • p95 is the percentile of any panel this links to.
  • uid by convention only (perf-<team>) — no per-baseline override; one convention, zero drift. (The stale grafana block in pre-P3 baselines was removed 2026-06-10.)

Tools

none — deterministic (plain string construction)

Data

  • Reads: reports/<run_id>/contract.json (started_at, duration_s) and, when present, reports/<run_id>_confirm/contract.json
  • Writes: nothing (returns the URL to the caller)

Frozen skill registry: AGENTS.md in this repo (2026-06-10: implemented as a pure URL-builder against the LGTM Perf - demo-web dashboard — the planned Grafana-API approach needed a token for zero benefit.)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.