This is a structured workflow for building LogQL queries without memorizing Grafana Loki's syntax. It walks you through stream selectors, parsers, filters, and metric aggregations in stages, asking about your log format, labels, and whether you need raw logs or dashboard metrics. The deterministic flow handles version compatibility intelligently, defaulting to safe syntax when your Loki version is unknown and offering 3.x optimized variants separately. For complex queries like nested aggregations or alerting rules, it enforces a reference checkpoint to pull from local examples before generating output. You can get a final query immediately or step through incremental builds for debugging. Useful when you know what you want to find in logs but not how to express it in LogQL's query pipeline.

skills.sh installs
640
GitHub stars
337
last updated
Aug 21, 2026

Install

$ npx -y skills add akin-ozer/cc-devops-skills --skill logql-generator --agent claude-code

Installs into .claude/skills of the current project.

Files

LogQL Query Generator

Overview

Interactive workflow for generating production-ready LogQL queries. LogQL is Grafana Loki's query language with indexed label selection, line filtering, parsing, and metric aggregation.

Trigger Hints

  • "Write a LogQL query for error rate by service."
  • "Help me build a Loki alert query."
  • "Convert this troubleshooting requirement into LogQL."
  • "I need step-by-step LogQL query construction."

Use this skill for query generation, dashboard queries, alerting expressions, and troubleshooting with Loki logs.

Execution Flow (Deterministic)

Always run stages in order. Do not skip required stages.

Stage 1 (Required): Capture Intent

Use AskUserQuestion to collect goal and use case.

Template:

  • "What is your primary goal: debugging, alerting, dashboard metric, or investigation?"
  • "Do you need a log query (raw lines) or a metric query (numeric output)?"
  • "What time window should this cover (example: last 15m, 1h, 24h)?"

Fallback if AskUserQuestion is unavailable:

  • Ask the same questions in plain text and continue.

Stage 2 (Required): Capture Log Source Details

Sponsors

Details

Repository
github.com/akin-ozer/cc-devops-skills
Categories
DevOps & CI/CD, Automation & Workflows
First seen
Jun 3, 2026

More from akin-ozer/cc-devops-skills

All 31
1akin-ozer avatardockerfile-generatorakin-ozer/cc-devops-skillsCreate, generate, or write Dockerfiles and multi-stage Docker images. Containerize apps.741skills.sh installs
2akin-ozer avatarhelm-validatorakin-ozer/cc-devops-skillsValidate, lint, audit, check Helm charts — Chart.yaml, templates, values.yaml, CRDs, schemas.712skills.sh installs
3akin-ozer avatarjenkinsfile-validatorakin-ozer/cc-devops-skillsValidate, lint, audit, or check Jenkinsfiles and shared libraries.706skills.sh installs
4akin-ozer avatarazure-pipelines-generatorakin-ozer/cc-devops-skillsGenerate/create/scaffold azure-pipelines.yml, stages, jobs, steps, or reusable templates.692skills.sh installs
5microsoft avatarmicrosoft-foundrymicrosoft/azure-skillsDeploy, evaluate, fine-tune, and manage Foundry agents end-to-end with azd: hosted agent scaffold/run/deploy, prompt agent create, batch eval, continuous eval, 671.4Kskills.sh installs
6microsoft avatarazure-preparemicrosoft/azure-skillsPrepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workf661.6Kskills.sh installs