authoring-and-testing-prometheus-rules

authoring-and-testing-prometheus-rules is a skill for Claude Code, Codex from talkops-ai/talkops-mcp. It costs 226 tokens per session (2,497 once invoked), scanned A, original, Apache-2.0.

A guide for creating and testing Prometheus recording and alerting rules. Recording rules save query results for reuse, while alerting rules notify operators when a condition is met.

In plain words
What is it for?
Use it to author, audit, unit-test, backtest, deploy, or remove rule groups in Kubernetes resources, HTTP rule services, local files, or GitOps YAML.
Why use it?
It helps validate rules and simulate their behavior before deployment, reducing broken alerts and accidental changes to existing rule groups. It supports several storage and deployment formats.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to author, audit, unit-test, backtest, deploy, or remove rule groups in Kubernetes resources, HTTP rule services, local files, or GitOps YAML.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/talkops-ai/talkops-mcp/authoring-and-testing-prometheus-rules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add talkops-ai/talkops-mcp --skill authoring-and-testing-prometheus-rules
Clone the repo
git clone --depth 1 https://github.com/talkops-ai/talkops-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for authoring-and-testing-prometheus-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/talkops-ai/talkops-mcp/authoring-and-testing-prometheus-rules/github.svg)](https://agentmods.dev/skills/talkops-ai/talkops-mcp/authoring-and-testing-prometheus-rules)
Your own site
<a href="https://agentmods.dev/skills/talkops-ai/talkops-mcp/authoring-and-testing-prometheus-rules"><img src="https://agentmods.dev/badge/skills/talkops-ai/talkops-mcp/authoring-and-testing-prometheus-rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for authoring-and-testing-prometheus-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/talkops-ai/talkops-mcp/authoring-and-testing-prometheus-rules"><img src="https://agentmods.dev/badge/skills/talkops-ai/talkops-mcp/authoring-and-testing-prometheus-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 226 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,497 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00226 $0.02497
Opus 5.5 $0.00090 $0.00999
Sonnet 5.5 $0.00045 $0.00499
Haiku 4.5 $0.00023 $0.00250

Measured 11d ago against content hash 229b08b4f4d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

authoring-and-testing-prometheus-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/build_promtool_test_suite.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/prometheus-mcp-server/skills/authoring-and-testing-prometheus-rules/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Authoring and Testing Prometheus Rules

Provides a safety-gated workflow for creating, auditing, tuning, unit-testing (promtool), backtest-simulating, and deploying Prometheus recording and alerting rule groups across k8s_crd, http_ruler, local_file, and yaml_only modes while strictly preserving sibling rule groups. Never shell out to kubectl or raw promtool when MCP resources (prom://rules/groups, prom://rules/{backend_id}/groups/{group_name}, prom://kubernetes/scrape-crds, prom://kubernetes/manifests/{kind}/{namespace}/{name}) and tools (prom_validate_rules, prom_upsert_rule_group, prom_delete_rule_group) are available. If invoked via commands/setup-monitoring.md (/setup-monitoring), read that command file first.

MCP Execution Primitives Used

  • Resources:
    • prom://rules/groups — snapshot of all loaded alerting and recording rule groups across backends.
    • prom://rules/{backend_id}/groups/{group_name} — inspect full rule definitions and evaluation health for a specific loaded group (passing backend_id="default" and the group name).
    • prom://kubernetes/scrape-crds — inventory of deployed PrometheusRule CRDs and their metadata labels.
    • prom://kubernetes/manifests/{kind}/{namespace}/{name} — read a live PrometheusRule CRD manifest (prom://kubernetes/manifests/PrometheusRule/{namespace}/{name}) before editing or diagnosing ruleSelector label mismatches.
    • prom://audit/recent — verify rule upsert/delete dry_run and succeeded audit records.
  • Tools (rules & query toolsets):
    • prom_explore_metrics & prom_query_range — verify exact metric/label names and inspect historical trajectories before setting thresholds.
    • prom_get_firing_alerts — inspect /api/v1/alerts and ALERTS_FOR_STATE history (include_history_lookback="24h") to detect FLAPPING_ALERT (fires_per_day >= 10, mean_duration_seconds < 300) and CHRONIC_ALWAYS_FIRING.
    • prom_validate_rules — run promtool check rules, structural/hygiene checks (check_hygiene=True), and promtool test rules (unit_tests).
    • prom_simulate_rule_firing — backtest candidate alerts against live TSDB history (mode="historical") or synthetic series (mode="synthetic").
    • prom_upsert_rule_group — non-destructively upsert a rule group via storage_mode (k8s_crd, http_ruler, local_file, or yaml_only; dry_run=True default).
    • prom_delete_rule_group — remove a single rule group from k8s_crd, http_ruler, or local_file (dry_run=True default), warning when remaining_group_count == 0 deletes the entire PrometheusRule CRD.

Read the full file on GitHub · 78 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 78 lines · 226 tokens per session scan A 229b08b4f4d0

Subscribe to this mod's changes

authoring-and-testing-prometheus-rules is a skill published in the GitHub repository talkops-ai/talkops-mcp (4 stars, last pushed 12d ago), licensed Apache-2.0. It adds 226 tokens to every session and 2,497 once invoked, about $0.0009 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-18.

Related

authoring-and-testing-prometheus-rules compared with skills from other repositories

authoring-and-testing-prometheus-rules next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
authoring-and-testing-prometheus-rulestalkops-ai/talkops-mcpSkill412d agoApache-2.0A226Claude Code, Codex
smart-contract-testingnirholas/three.wsSkill287yesterdayApache-2.0A33Claude Code, Codex
testinggriddynamics/rosettaSkill3825d agoApache-2.0A26Claude Code
test-commanderEliasOulkadi/shokuninSkill1121mo agoMITA117Claude Code
argocdalivirgo/Major-AI-SkillsSkill6yesterdayMITA42Claude Code
edt-mcp-project-yaxunitDitriXNew/EDT-MCPSkill352todayAGPL-3.0A39Claude Code, Codex
fix-codecov-gapsAnselmoo/mcp-ai-agent-guidelinesSkill65d agoMITA87Claude Code