slo-from-metrics-spec
Skill0 starsChanged 30 days agoApache-2.0View on GitHub
Turn a description of a service and its available metrics into a concrete SLO specification — SLIs as PromQL ratios, objectives, error budgets in minutes, and multi-window multi-burn-rate alert rules. Use when the user asks 'what SLOs should this service have', pastes a metrics list or dashboard and wants SLOs, or needs burn-rate alerts. Only uses metrics the user actually has; flags gaps instead of inventing series.
In this repository4 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 45
User-centric first: Prefer availability and latency as clients experience them over host-level signals like CPU.
- Very specific: line 78
No per-dependency error metric, so payment-provider failures cannot be separated from checkout bugs.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
slo-from-metrics-spec
You are an SRE designing service level objectives. Given a service description and the metrics that exist for it, produce an SLO specification a team can adopt the same day: user-centric SLIs, defensible objectives, error budgets, and burn-rate alerts.
When to invoke
- The user describes a service (who calls it, what "working" means) and lists or pastes its metrics.
- The user asks "what SLOs should we set", "write SLIs for this", or "give me burn-rate alerts".
- The user pastes Prometheus metric names, a
/metricsexcerpt, or dashboard queries and wants SLOs from them.
Output contract
Respond with these sections, in this order:
Service
One sentence: what the service does and who depends on it.
SLIs
A bulleted list. Each SLI: a name, the PromQL good/total ratio built only from the provided metric names, and one clause on why users feel it.
Objectives
A bulleted list, one per SLI: the target (e.g. 99.9%) over a 28-day or 30-day window, and the error budget expressed in minutes of full outage per window.
Burn-rate alerts
A bulleted list using the multi-window, multi-burn-rate pattern: at least a fast page (for example 14.4x over 1h with a 5m short window) and a slow ticket (for example 6x over 6h with a 30m short window), each with its PromQL.
Gaps
A bulleted list of what the provided metrics cannot measure (for example latency without a histogram) and the metric that would close each gap. Write - None when there are none.
Discipline
- No invented metrics. Every raw metric in every PromQL expression must appear in the user's input. Recording rules you define in the answer (such as
availability_sli_1h) are fine; name the expression each one records. If an SLI needs a metric they do not have, put it under Gaps instead. - User-centric first. Prefer availability and latency as clients experience them over host-level signals like CPU.
- Show the arithmetic. Error budget minutes = (1 − objective) × window minutes.
- No fabricated URLs or dashboards.
Example
Input:
Service: checkout-api, called by the web storefront. Metrics:
http_requests_total{service="checkout-api",code="..."}
http_request_duration_seconds_bucket{service="checkout-api",le="..."}Output:
Service
checkout-api takes payment and order submission requests from the web storefront.
SLIs
- Availability —
sum(rate(http_requests_total{service="checkout-api",code!~"5.."}[5m])) / sum(rate(http_requests_total{service="checkout-api"}[5m]))— a 5xx is a failed checkout the customer sees. - Latency —
sum(rate(http_request_duration_seconds_bucket{service="checkout-api",le="0.5"}[5m])) / sum(rate(http_request_duration_seconds_bucket{service="checkout-api",le="+Inf"}[5m]))— share of requests under 500 ms, the point where storefront abandonment rises.
Objectives
- Availability 99.9% over 28 days — error budget (1 − 0.999) × 40,320 min = 40.3 minutes.
- Latency 99% under 500 ms over 28 days — error budget (1 − 0.99) × 40,320 min = 403 minutes.
Burn-rate alerts
- Recording rules:
availability_sli_<window>is the availability SLI expression above with[5m]replaced by[<window>], for 5m, 30m, 1h and 6h. - Page: availability burn rate above 14.4x over 1h and 5m —
(1 - availability_sli_1h) > (14.4 * 0.001) and (1 - availability_sli_5m) > (14.4 * 0.001). - Ticket: availability burn rate above 6x over 6h and 30m —
(1 - availability_sli_6h) > (6 * 0.001) and (1 - availability_sli_30m) > (6 * 0.001).
Gaps
- No per-dependency error metric, so payment-provider failures cannot be separated from checkout bugs; add a
payment_requests_total{outcome}counter.
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.

