Works with the AI Agents you already use
Prometheus Alert Rules Review and Generator
by Saizul Amin
This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice.
$10
Prometheus Alert Rules Review and Generator
Example session with this skill installed
Run the Prometheus Alert Rules Review and Generator skill on my project and give me a prioritised list of what to fix, with exact changes.
- Read your context and instructions
- Compiled the prometheus alert rules
Here is what the Prometheus Alert Rules Review and Generator skill produced.
Demo: real, unedited output of the skill's bundled script on a sample input from its test suite.
Output
HIGH alert.value_in_labels: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'HighLatency': label 'value' uses $value: every new value is a new alert (flapping, re-notifications)
-> move $value to an annotation
HIGH rule.invalid_name: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'Disk Full': 'Disk Full' is not a valid name
-> use letters, digits, '_' (and ':' for recording rules), e.g. HighErrorRate
HIGH duration.invalid: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'Disk Full': 'for: 10' is not a valid duration
-> e.g. 5m
HIGH expr.unbalanced: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'http_requests_rate': unbalanced (), [] or {} in expr
-> fix the brackets
HIGH record.has_for: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'http_requests_rate': recording rules cannot have 'for'
-> remove it
HIGH group.duplicate_name: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api': duplicate group name (Prometheus rejects it)
MEDIUM expr.short_rate_window: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'HighLatency': rate() over [30s] is shorter than 60s
-> use a window of at least 4x the scrape interval (e.g. [2m] or more for 30s scrapes)
MEDIUM alert.missing_for: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'HighLatency': no 'for' (or 'for: 0s'): one bad evaluation pages someone
-> add 'for: 5m' (or longer for non-urgent alerts)
MEDIUM alert.missing_runbook: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'HighLatency': no runbook_url annotation
-> link a runbook: what to check first, how to mitigate, who owns it
MEDIUM expr.high_cardinality_by: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'ErrorsPerUser': groups by high-cardinality label(s) user_id
-> aggregate these away (one series or alert per user/request/path does not scale)
MEDIUM expr.no_threshold: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'ErrorsPerUser': alert expr has no comparison, so it fires whenever the series exists
-> add a threshold such as '> 0.05' or wrap in absent()
MEDIUM alert.missing_severity: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'Disk Full': no 'severity' label, so Alertmanager cannot route it
-> add labels.severity: critical|warning|info
MEDIUM alert.high_cardinality_label: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'QueueGrowing': label 'customer' copies high-cardinality label 'customer_id'
-> keep identifiers in annotations, not alert labels
LOW alert.unknown_severity: -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/observability-skills/tests/fixtures/prometheus/rules-bad.yml group 'api' rule 'ErrorsPerUser': severity 'urgent' is not one of critical, error, high, info, low, medium, none, page, ticket, warning
-> use the values your Alertmanager routes match on (see --severi
What you do next
- Fix the highest-severity items first.
- Ask your agent to apply the fixes it suggests, then run the skill again to confirm.
- Keep the skill installed and re-run it whenever the project changes.
Connects securely to your tools. The creator never sees your data.
About this skill
Review and fix Prometheus alerting and recording rules with a deterministic linter - missing for, missing severity label, summary, description and runbook_url, $value in labels (flapping alerts), high-cardinality labels (user_id, path, request_id) in by clauses and alert labels, expressions without a threshold, rate() windows shorter than the scrape interval allows, irate in alerts, rate on gauges, invalid durations and names, duplicate groups and alerts, recording rule naming (level:metric:operations). Reads rule files, Kubernetes PrometheusRule CRDs and /api/v1/rules JSON.
Who it's for
Use when the user shares a Prometheus rules YAML, asks to review or write alert rules, complains about noisy, flapping or useless alerts, alert fatigue, or wants a CI check for rule files.
What's inside
- Tested, offline Python script(s): alert_rules_lint.py (deterministic results, standard library only unless noted)
- Reference guides: alerting-guidelines.md, checks.md
- Step-by-step agent instructions in SKILL.md covering: When to use; When not to use; Workflow
Why it's worth it
Generic prompts guess. This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice. See the real demo below.
Works with every major AI agent
Built on the open SKILL.md standard: Claude Code, Codex CLI, Cursor, VS Code Copilot, Gemini CLI, Windsurf and 20+ other agents.
Requirements
- Python 3.8+ for the bundled scripts
- No API keys, no account, runs locally
Open source: saizul/observability-skills on GitHub (MIT licence, by Saizul Amin).
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago
- Software
Python 3.8+
Permissions
Allowed Hosts