promql-fmt

promql-fmt is a skill for Claude Code, Codex from conallob/o11y-analysis-tools. It costs 0 tokens per session (1,327 once invoked), scanned A, original, BSD-3-Clause.

A formatter and checker for PromQL, the query language used by Prometheus monitoring systems, inside alert and recording-rule YAML files.

In plain words
What is it for?
Use it to format rule files, remove redundant aggregation clauses, review changes and fail CI checks when rules do not meet the expected style.
Why use it?
It catches inconsistent formatting and selected naming or instrumentation issues before rules are committed or deployed.

Skill for Claude CodeCodex

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go build -o bin/promql-fmt ./cmd/promql-fmt.

Good fit Use it to format rule files, remove redundant aggregation clauses, review changes and fail CI checks when rules do not meet the expected style.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/conallob/o11y-analysis-tools
agentmods
npx agentmods add skills/conallob/o11y-analysis-tools/promql-fmt

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin promql-fmt/plugin install promql-fmt after adding the marketplace above.

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 promql-fmt

README.md
[![agentmods](https://agentmods.dev/badge/skills/conallob/o11y-analysis-tools/promql-fmt/github.svg)](https://agentmods.dev/skills/conallob/o11y-analysis-tools/promql-fmt)
Your own site
<a href="https://agentmods.dev/skills/conallob/o11y-analysis-tools/promql-fmt"><img src="https://agentmods.dev/badge/skills/conallob/o11y-analysis-tools/promql-fmt/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 promql-fmt

Your own site · 80×15
<a href="https://agentmods.dev/skills/conallob/o11y-analysis-tools/promql-fmt"><img src="https://agentmods.dev/badge/skills/conallob/o11y-analysis-tools/promql-fmt.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,327 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.00000 $0.01327
Opus 5 $0.00000 $0.00664
Sonnet 5 $0.00000 $0.00265
Haiku 4.5 $0.00000 $0.00133

Measured 12d ago against content hash 28a37ac88323, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

promql-fmt 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 12d ago.

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.

skills/promql-fmt/SKILL.md · 116 lines

How it starts

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

promql-fmt

Static analyzer and auto-formatter for PromQL expr:/query: fields inside Prometheus-style rule YAML files. Hermetic — it only reads the files you point it at.

When to use this skill

  • A user is authoring or editing a Prometheus/Thanos/Cortex/Mimir alert or recording rule and wants it formatted consistently.
  • You're reviewing a diff to rule YAML and want to catch style or best-practice violations before commit.
  • You're wiring a CI job that should fail a PR touching rule files with inconsistent formatting.

Setup

go build -o bin/promql-fmt ./cmd/promql-fmt
# or: go install github.com/conallob/o11y-analysis-tools/cmd/promql-fmt@latest

Usage

promql-fmt [options] <file|directory>...

Only .yml/.yaml files are scanned; directories are walked recursively. There is no stdin mode (unlike label-check) — always pass a file or directory path.

Flag Default Effect
--check true Report issues, exit 1 if any found. Do not modify files.
--fix / --fmt false Rewrite files in place with the formatted output. --fmt is an alias for --fix. Passing either disables --check automatically.
--verbose false Print per-file "Fixing …" lines while fixing.
--disable-line-length false Suppress the "should use multiline formatting" nudge for long lines — useful for recording rules with unavoidably long metric names.
--prometheus-url "" Optional. If set, additionally queries that Prometheus for timeseries continuity — i.e., flags expressions that reference metrics with no matching series. This is the one non-hermetic opt-in check; omit the flag to stay fully offline.

Typical invocations

# CI gate / pre-commit check (default mode)
promql-fmt --check ./prometheus/

# Auto-fix in place, then re-check
promql-fmt --fix ./prometheus/

# Verbose fix, skip line-length nudges for long recording-rule names
promql-fmt --fix --verbose --disable-line-length ./prometheus/recording-rules.yml

Read the full file on GitHub · 116 lines

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. 12d ago First seen · 116 lines · 0 tokens per session scan A 28a37ac88323

Subscribe to this mod's changes

promql-fmt is a skill published in the GitHub repository conallob/o11y-analysis-tools (4 stars, last pushed 1mo ago), licensed BSD-3-Clause. It costs nothing until one of its globs matches a file; then it loads 1,327 tokens. 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-08-31.

Related

Other skills, from other repositories

Observability with Prometheus & Grafana

Production-grade observability stack with Prometheus metrics, Grafana dashboards, PromQL query language, alerting rules, and AI-powered anomaly detection for modern cloud-native applications.

bobmatnyc/mcp-skillset · 42 tokens

querying-yandex-cloud

Read Yandex Cloud through its REST API. Applies to any question about VMs, metrics, logs, audit events, Kubernetes, managed databases, serverless, networking or any other Yandex Cloud resource. Never shell out to the yc CLI — it is not how this agent reaches Yandex Cloud and is usually not installed.

Tracer-Cloud/opensre · 73 tokens

i18n-lookup

Look up Zeabur platform UI term translations from the dashboard i18n files. Use when writing or reviewing docs that reference UI elements (button labels, tab names, menu items) to ensure docs match the actual platform translations.

zeabur/zeabur · 52 tokens

k8s-pod-rightsizer

Analyze Kubernetes workload metrics and produce policy-constrained CPU/memory rightsizing recommendations with optional patch generation and rollback-safe apply.

initializ/forge · 33 tokens

translate

Translate documentation pages to all missing locales. Use when a document exists in one locale but needs to be translated to others. Supports --dry-run, single-locale targeting, and incremental updates.

zeabur/zeabur · 40 tokens

monitoring-observability

Monitoring and observability patterns for Prometheus metrics, Grafana dashboards, Langfuse v4 LLM tracing (astype, scorecurrentspan, shouldexportspan, LangfuseMedia), and drift detection. Use when adding logging, metrics, distributed tracing, LLM cost tracking, or quality drift monitoring.

yonatangross/orchestkit · 69 tokens