logql-generator

logql-generator is a skill for Claude Code, Codex from pantheon-org/tekhne. It costs 58 tokens per session (3,114 once invoked), scanned A, original, MIT.

A guide for writing LogQL queries, the query language used to search and measure logs in Grafana Loki. It covers filters, labels, parsing, aggregations, dashboards, and alerts.

In plain words
What is it for?
It is for investigating errors, building log dashboards, creating alerts, and analyzing logs over a chosen time range.
Why use it?
It helps turn a monitoring question into a correctly structured log query and encourages checking the query plan and relevant references first.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; names the AskUserQuestion tool.

Good fit It is for investigating errors, building log dashboards, creating alerts, and analyzing logs over a chosen time range.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pantheon-org/tekhne/logql-generator
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 pantheon-org/tekhne --skill logql-generator
Clone the repo
git clone --depth 1 https://github.com/pantheon-org/tekhne

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 logql-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/pantheon-org/tekhne/logql-generator/github.svg)](https://agentmods.dev/skills/pantheon-org/tekhne/logql-generator)
Your own site
<a href="https://agentmods.dev/skills/pantheon-org/tekhne/logql-generator"><img src="https://agentmods.dev/badge/skills/pantheon-org/tekhne/logql-generator/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 logql-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/pantheon-org/tekhne/logql-generator"><img src="https://agentmods.dev/badge/skills/pantheon-org/tekhne/logql-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,114 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00058 $0.03114
Opus 5 $0.00029 $0.01557
Sonnet 5 $0.00012 $0.00623
Haiku 4.5 $0.00006 $0.00311

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

Security

Grade A, and why

logql-generator 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 9d 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/observability/logql-generator/SKILL.md · 348 lines

How it starts

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

LogQL Query Generator

Interactive Query Planning Workflow

CRITICAL: Always engage the user in collaborative planning before generating queries.

Stages 1-3: Gather Requirements (use AskUserQuestion)

Ask about: goal (error analysis, alerting, debugging), use case, log sources (labels, format), query type (log/metric), filtering needs, parsing method, aggregation, and time range.

Stage 4: Plan, Validate & Consult References

Before generating code, present a plain-English plan and confirm with the user via AskUserQuestion:

## LogQL Query Plan

**Goal**: [Description]
**Query Structure**:
1. Select streams: `{label="value"}`
2. Filter lines: [operations]
3. Parse logs: [parser]
4. Aggregate: [function]

**Does this match your intentions?**

Once confirmed, MANDATORY: consult references before generating. Do NOT rely on prior knowledge.

Local References (Read tool)
Query Complexity File to Read
Complex aggregations (nested topk, multiple sum by, percentiles) assets/common_queries.logql
Performance-critical queries (large time ranges, high-volume streams) references/best_practices.md — sections #1-5, #15-18
Alerting rules references/best_practices.md — sections #19-21, #39
Structured metadata / Loki 3.x features references/best_practices.md — sections #35-37
Template functions (line_format, label_format) assets/common_queries.logql
Function/parser syntax references/function_reference.md
IP filtering, pattern extraction, regex assets/common_queries.logql

Example paths:

Read(".claude/skills/logql-generator/assets/common_queries.logql")
Read(".claude/skills/logql-generator/references/best_practices.md")
External Documentation (context7 MCP / WebSearch)

Use when local references don't cover the topic:

Trigger Use Tool
Loki 3.x features (approx_topk, pattern match |>, vector(), structured metadata) context7 MCP → grafana loki + topic
Recording rules, unclear syntax, edge cases context7 MCP → grafana loki + topic
Version-specific behavior, Grafana Alloy integration WebSearch → "Grafana Loki LogQL [topic] [year]"

Read the full file on GitHub · 348 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. 9d ago First seen · 348 lines · 58 tokens per session scan A 824b6b04f961

Subscribe to this mod's changes

logql-generator is a skill published in the GitHub repository pantheon-org/tekhne (10 stars, last pushed yesterday), licensed MIT. It adds 58 tokens to every session and 3,114 once invoked, about $0.0003 per session on Opus 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-09-03.

Related

Other skills, from other repositories

claude-md-improver

Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project…

anthropics/claude-plugins-official · 82 tokens

gke-reliability

Improves GKE workload reliability, using PDBs, health probes, and topology spread constraints. Use when configuring GKE workload reliability, setting up PDBs, or configuring GKE health probes (liveness, readiness, startup). Don't use for disaster recovery setup or full cluster backups (use gke-backup-dr instead).

google/skills · 73 tokens

gke-workload-security

Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running cluster security audits (auditcluster.sh), configuring Workload Identity Federation (impersonation, KSA/GSA binding, and pod setup), enforcing Network Policies (default-deny…

google/skills · 181 tokens

atlas-obscura

Search Atlas Obscura for weird, wonderful, and hidden gem places near any destination. Find the interesting stuff, not boring plaques. Search by coordinates, get full details with descriptions and images.

borski/travel-hacking-toolkit · 44 tokens

agent-code-generator

Generates Agent definitions (.md files) based on user intent and standard templates.

majiayu000/claude-skill-registry · 20 tokens

cf-validate

A validator for 1C configuration source files. It checks the XML structure and the files and objects that make up a 1C business-application configuration.

Nikolay-Shirokov/cc-1c-skills · 31 tokens