query-validation

query-validation is a skill for Claude Code, Codex from nimrodfisher/data-analytics-skills. It costs 34 tokens per session (473 once invoked), scanned A, original, MIT.

A review of SQL queries for correctness, speed, and common good practices. SQL is the language used to retrieve and work with data in many databases.

In plain words
What is it for?
Checking queries that return unexpected results, run slowly, or need approval for production use.
Why use it?
It helps find wrong results, slow operations, and avoidable query problems before a query is used in production.

Skill for Claude CodeCodex

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

Good fit Checking queries that return unexpected results, run slowly, or need approval for production use.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nimrodfisher/data-analytics-skills/query-validation
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 nimrodfisher/data-analytics-skills --skill query-validation
Clone the repo
git clone --depth 1 https://github.com/nimrodfisher/data-analytics-skills

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 query-validation

README.md
[![agentmods](https://agentmods.dev/badge/skills/nimrodfisher/data-analytics-skills/query-validation/github.svg)](https://agentmods.dev/skills/nimrodfisher/data-analytics-skills/query-validation)
Your own site
<a href="https://agentmods.dev/skills/nimrodfisher/data-analytics-skills/query-validation"><img src="https://agentmods.dev/badge/skills/nimrodfisher/data-analytics-skills/query-validation/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 query-validation

Your own site · 80×15
<a href="https://agentmods.dev/skills/nimrodfisher/data-analytics-skills/query-validation"><img src="https://agentmods.dev/badge/skills/nimrodfisher/data-analytics-skills/query-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 473 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.00034 $0.00473
Opus 5.5 $0.00014 $0.00189
Sonnet 5.5 $0.00007 $0.00095
Haiku 4.5 $0.00003 $0.00047

Measured 1mo ago against content hash 700b07e536f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

query-validation 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 1mo ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/cardinality_estimator.py, scripts/explain_plan_parser.py, scripts/sql_lint.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.

01-data-quality-validation/query-validation/SKILL.md · 30 lines

What it actually says

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
Files

What ships with it

7 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. 1mo ago First seen · 30 lines · 34 tokens per session scan A 700b07e536f3

Subscribe to this mod's changes

query-validation is a skill published in the GitHub repository nimrodfisher/data-analytics-skills (485 stars, last pushed 25d ago), licensed MIT. It adds 34 tokens to every session and 473 once invoked, about $0.0001 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-08-30.

Related

Other skills, from other repositories

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens

cloud-databases-onboarding

Guides users through discovering their database requirements, recommends a Google Cloud database based on a recommendation matrix, and assists in database creation. Use when a user asks 'What database service should I use?', 'Help me pick a database', or when a user wants to create a new database on Google Cloud.…

google/skills · 83 tokens

spanner-basics

Assists in provisioning instances and databases, designing performant schemas, and querying data in Cloud Spanner on Google Cloud. Use when designing primary keys, writing SQL queries or client library code, or diagnosing performance issues.

google/skills · 47 tokens

obsidian-bases

Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.

kepano/obsidian-skills · 63 tokens

similarity-search-patterns

Implement efficient similarity search with vector databases. Use when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance.

foryourhealth111-pixel/Vibe-Skills · 30 tokens

supabase

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies…

supabase/agent-skills · 185 tokens