本文へ移動
cccskills
無料GitHub で公開

query-validation

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.

インストール方法を見る

含まれるファイル(8)

  • SKILL.md2.2 KB
  • assets/optimization_recommendations.md1.3 KB
  • assets/query_review_template.md1.7 KB
  • references/engine_specific_guide.md5.1 KB
  • references/sql_anti_patterns.md3.9 KB
  • scripts/cardinality_estimator.py3.6 KB
  • scripts/explain_plan_parser.py3.7 KB
  • scripts/sql_lint.py3.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Rigorous A/B test statistical analysis. Use when analyzing experiment results, calculating statistical significance, checking for sample ratio mismatch, or validating test design before launch.

日本語の概要は準備中です。原文の説明を表示しています。

nimrodfisher/data-analytics-skills4702026年9月25日 更新

Track and document analytical assumptions and decisions. Use when making analytical choices, documenting trade-offs, ensuring transparency, or creating audit trails for analytical work.

日本語の概要は準備中です。原文の説明を表示しています。

nimrodfisher/data-analytics-skills4702026年9月25日 更新

Structured, reproducible analysis documentation. Use when documenting analysis findings, creating analysis notebooks, ensuring reproducibility, or building analysis archives for future reference.

日本語の概要は準備中です。原文の説明を表示しています。

nimrodfisher/data-analytics-skills4702026年9月25日 更新

Structure analysis approach before starting work. Use when receiving new analysis requests, breaking down complex questions into steps, or planning iterative analysis workflows.

日本語の概要は準備中です。原文の説明を表示しています。

nimrodfisher/data-analytics-skills4702026年9月25日 更新

Pre-delivery quality assurance for analysis work. Use when reviewing analysis before sharing with stakeholders, checking for completeness, validating assumptions, or ensuring clarity of recommendations.

日本語の概要は準備中です。原文の説明を表示しています。

nimrodfisher/data-analytics-skills4702026年9月25日 更新

Post-analysis learning and process improvement. Use when completing major analysis projects, documenting lessons learned, or improving team analytical practices.

日本語の概要は準備中です。原文の説明を表示しています。

nimrodfisher/data-analytics-skills4702026年9月25日 更新

nimrodfisher のスキルをすべて見る

このスキルの問題を報告する