Agent skill

Query Validation

by nimrodfisher in nimrodfisher/data-analytics-skills

SQL query review for correctness, performance, and best practices.

MITAuto-check passedDatabases

Install Query Validation

skills CLI
$ npx skills add nimrodfisher/data-analytics-skills --skill query-validation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nimrodfisher/data-analytics-skills query-validation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nimrodfisher/data-analytics-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/01-data-quality-validation/query-validation .claude/skills/query-validation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
query-validation
GitHub stars
465
Token cost
~551 tokens
SKILL.md length
236 words
Files
8 (incl. scripts, references, assets)
Skills in repo
31
Repo updated
First seen
Licence
MIT

At a glance

SQL query review for correctness, performance, and best practices.

  • Works in 6 steps: Lint the query — run scripts/sql_lint.py… → Review anti-patterns — compare the query… → Parse the explain plan — if an EXPLAIN… → …
  • Tasks that involve SQL
  • Runs Python scripts from its folder
  • Tasks that involve Data warehousing

What it does

Query Validation is an agent skill from nimrodfisher/data-analytics-skills. SQL query review for correctness, performance, and best practices. Activate when a query needs review before production use, shows unexpected results, or runs too slowly.

Its SKILL.md is about 550 tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts, reference files and assets (for example `assets/optimization_recommendations.md`, `assets/query_review_template.md` and `references/engine_specific_guide.md`).

It sits in Databases, covering SQL, Data warehousing and Data cleaning. It works with SQL. The repository describes itself as: A comprehensive list of Claude & Codex skills for a wide range of data analytics tasks. The licence is MIT.

When your agent uses it

  • Tasks that involve SQL
  • Tasks that involve Data warehousing
  • Tasks that involve Data cleaning

Example prompts

  • “/query-validation”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Lint the query — run scripts/sql_lint.py (sqlglot-based) to catch syntax errors, unsupported functions for the target engine, and style…
  2. Review anti-patterns — compare the query structure against references/sql_anti_patterns.md. Flag any present anti-patterns with a severity…
  3. Parse the explain plan — if an EXPLAIN or query profile output is available, run scripts/explain_plan_parser.py to extract slow steps…
  4. Estimate cardinality — run scripts/cardinality_estimator.py if schema stats are available to flag joins that might fan-out unexpectedly.
  5. Check engine-specific behaviour — consult references/engine_specific_guide.md for the target engine (Snowflake / BigQuery / Postgres /…
  6. Produce review output — fill in assets/query_review_template.md with findings; for any performance issues found, complete…

What it can do on your machine

Read from SKILL.md and the folder at commit 9449d36. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Query Validation loads about 551 tokens when it runs, and up to ~2.8k if it reads all its reference files. Until then it costs about 47 tokens; SKILL.md has 236 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~551
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from nimrodfisher/data-analytics-skills at commit 9449d36, republished under its MIT licence (© nimrodfisher). 236 words, ~551 tokens.

Download SKILL.mdSave it as .claude/skills/query-validation/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
query-validation
description
SQL query review for correctness, performance, and best practices. Activate when a query needs review before production use, shows unexpected results, or runs too slowly.

When to use

  • A SQL query is about to be promoted to a production dashboard or report
  • A query is returning surprising or incorrect results
  • A query is running slowly and needs performance review
  • You want to catch anti-patterns (implicit conversions, SELECT *, unbounded CTEs) before they cause incidents

Process

  1. Lint the query — run scripts/sql_lint.py (sqlglot-based) to catch syntax errors, unsupported functions for the target engine, and style violations. Fix hard errors before continuing.
  2. Review anti-patterns — compare the query structure against references/sql_anti_patterns.md. Flag any present anti-patterns with a severity rating.
  3. Parse the explain plan — if an EXPLAIN or query profile output is available, run scripts/explain_plan_parser.py to extract slow steps (full table scans, missing indexes, high row estimates).
  4. Estimate cardinality — run scripts/cardinality_estimator.py if schema stats are available to flag joins that might fan-out unexpectedly.
  5. Check engine-specific behaviour — consult references/engine_specific_guide.md for the target engine (Snowflake / BigQuery / Postgres / Redshift) to verify date functions, window behaviour, and clustering assumptions.
  6. Produce review output — fill in assets/query_review_template.md with findings; for any performance issues found, complete assets/optimization_recommendations.md.

Inputs the skill needs

  • Required: the SQL query text
  • Required: target database engine (Snowflake / BigQuery / Postgres / Redshift / other)
  • Optional: relevant table schemas (column names, types, approximate row counts)
  • Optional: EXPLAIN / query profile output
  • Optional: expected business logic — what should the query calculate?

Output

  • assets/query_review_template.md (filled) — categorised findings: correctness, performance, style
  • assets/optimization_recommendations.md (filled, if issues found) — ranked rewrite suggestions with expected impact

© nimrodfisher, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references, assets) in 01-data-quality-validation/query-validation of nimrodfisher/data-analytics-skills.

  • SKILL.md
  • assets/optimization_recommendations.md
  • assets/query_review_template.md
  • references/engine_specific_guide.md
  • references/sql_anti_patterns.md
  • scripts/cardinality_estimator.py
  • scripts/explain_plan_parser.py
  • scripts/sql_lint.py

Open the folder on GitHubat commit 9449d36

Compare with similar skills

Query Validation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Query Validation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Query Validation this skillnimrodfisher/data-analytics-skills465—~551Automated safety check: PassMIT
SQL Prodavila7/claude-code-templates32k9 repos~1.9kAutomated safety check: PassMIT
Analyzing Dataastronomer/agents451—~1.3kAutomated safety check: PassApache-2.0
Databricks Dbsqldatabricks/databricks-agent-skills3451 repos~2.8kAutomated safety check: PassCustom licence
Pytorch Clickhousepytorch/test-infra113—~2.8kAutomated safety check: PassCustom licence
Snowflake Developmentsickn33/agentic-awesome-skills47k2 repos~2.1kAutomated safety check: PassMIT

Similar skills

  • SQL Pro

    davila7/claude-code-templates

    Master modern SQL with cloud-native databases, OLTP/OLAP optimization, and advanced query techniques.

    32k GitHub starsUsed in 9 repos~1.9k tokens
    DatabasesAuto-check passed
  • Analyzing Data

    astronomer/agents

    Queries the data warehouse with SQL and answers business questions about data.

    451 GitHub stars~1.3k tokensUpdated today
    DatabasesAuto-check passed
  • Databricks Dbsql

    databricks/databricks-agent-skills

    Official

    Databricks SQL (DBSQL) advanced features and SQL warehouse capabilities.

    345 GitHub starsUsed in 1 repo~2.8k tokens
    DatabasesAuto-check passed
  • Pytorch Clickhouse

    pytorch/test-infra

    Load this FIRST whenever working with PyTorch CI data (any pytorch/ org repo), the torchci/HUD codebase, or the PyTorch HUD ClickHouse database.

    113 GitHub stars~2.8k tokensUpdated today
    DatabasesAuto-check passed
  • Snowflake Development

    sickn33/agentic-awesome-skills

    Comprehensive Snowflake development assistant covering SQL best practices, data pipeline design (Dynamic Tables, Streams, Tasks, Snowpipe), Cortex AI functions, Cortex Agents, Snowpark Python, dbt…

    47k GitHub starsUsed in 2 repos~2.1k tokens
    DatabasesAuto-check passed
  • Snowflake Development

    alirezarezvani/claude-skills

    A skill your agent uses when writing Snowflake SQL, building data pipelines with Dynamic Tables or Streams/Tasks, using Cortex AI functions, creating Cortex Agents, writing Snowpark Python…

    28k GitHub stars~3.2k tokensUpdated 1 mo ago
    DatabasesAuto-check passed

More from nimrodfisher/data-analytics-skills

All 31 skills in this repo
  • Ab Test Analysis

    nimrodfisher/data-analytics-skills

    Rigorous A/B test statistical analysis. An agent skill from nimrodfisher/data-analytics-skills.

    465 GitHub stars~708 tokensUpdated 12 days ago
    Auto-check passed
  • Analysis Assumptions Log

    nimrodfisher/data-analytics-skills

    Track and document analytical assumptions and decisions. An agent skill from nimrodfisher/data-analytics-skills.

    465 GitHub stars~578 tokensUpdated 12 days ago
    Auto-check passed
  • Analysis QA Checklist

    nimrodfisher/data-analytics-skills

    Pre-delivery quality assurance for analysis work. An agent skill from nimrodfisher/data-analytics-skills.

    465 GitHub stars~470 tokensUpdated 12 days ago
    Auto-check passed
  • Business Metrics Calculator

    nimrodfisher/data-analytics-skills

    Standard business metric calculation with industry benchmarks.

    465 GitHub stars~668 tokensUpdated 12 days ago
    Auto-check passed
  • Cohort Analysis

    nimrodfisher/data-analytics-skills

    Time-based cohort analysis with retention and behaviour tracking.

    465 GitHub stars~660 tokensUpdated 12 days ago
    Auto-check passed
  • Context Packager

    nimrodfisher/data-analytics-skills

    Efficiently package context for AI-assisted analysis. An agent skill from nimrodfisher/data-analytics-skills.

    465 GitHub stars~500 tokensUpdated 12 days ago
    Auto-check passed

Works with

Categories

Questions about Query Validation

What does Query Validation do?

SQL query review for correctness, performance, and best practices. Query Validation is an agent skill from nimrodfisher/data-analytics-skills. SQL query review for correctness, performance, and best practices.

When should I use Query Validation?

Query Validation fits situations like: tasks that involve SQL; tasks that involve Data warehousing; tasks that involve Data cleaning.

How do I install Query Validation in Claude Code?

Run `npx skills add nimrodfisher/data-analytics-skills --skill query-validation -a claude-code`. Or copy the skill folder (01-data-quality-validation/query-validation in nimrodfisher/data-analytics-skills) into .claude/skills/query-validation in your project. Claude Code loads it when a task matches its description.

How do I install Query Validation in Codex?

Run `npx skills add nimrodfisher/data-analytics-skills --skill query-validation -a codex`. Or copy the skill folder (01-data-quality-validation/query-validation in nimrodfisher/data-analytics-skills) into .agents/skills/query-validation in your project. Codex loads it when a task matches its description.

Can I use Query Validation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nimrodfisher/data-analytics-skills --skill query-validation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/query-validation, .gemini/skills/query-validation, .github/skills/query-validation and .opencode/skills/query-validation in your project.

What does Query Validation need to run?

Going by SKILL.md and its folder, Query Validation needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Query Validation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Query Validation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Query Validation use?

Query Validation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Query Validation use?

About 551 tokens (SKILL.md is roughly 2.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Query Validation?

Skills that share tags, products or a category with Query Validation: SQL Pro (davila7/claude-code-templates, 32k stars), Analyzing Data (astronomer/agents, 451 stars), Databricks Dbsql (databricks/databricks-agent-skills, 345 stars) and Pytorch Clickhouse (pytorch/test-infra, 113 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Query Validation?

nimrodfisher (a GitHub user) maintains it in nimrodfisher/data-analytics-skills, which has 465 GitHub stars. The repository holds 31 skills in this directory. The repository was last updated on September 25, 2026.

Source: nimrodfisher/data-analytics-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.