{"id":79561,"plugin_id":"plugins_6ab40fcbcc3c81919e0c679fee35faaf","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-04T00:11:25.692Z","digest":"a98dce330c216460f8f43d7805b0fbd53f36ecb8e074bbc755f0dbde534ea503","against":null,"payload":{"description":"Review provided SQL for semantic correctness before proposing cosmetic rewrites or optimization.","included_files":[],"name":"review-sql-correctness","skill_md_contents":"---\nname: review-sql-correctness\ndescription: Review provided SQL for semantic correctness before proposing cosmetic rewrites or optimization.\n---\n\n# Review Sql Correctness\n\n**Trigger:** Review provided SQL for semantic correctness before proposing cosmetic rewrites or optimization.\n\n## Workflow\n1. Reconstruct the intended result: who or what constitutes one row, and which measures must reconcile?\n2. Walk each clause in logical order: FROM/JOIN, WHERE, GROUP BY, HAVING, windows, SELECT, ORDER BY and LIMIT. Consider platform-specific evaluation details.\n3. Examine join keys, filtering of optional rows, aggregation level, 3-valued NULL logic, date and timezone semantics, tie-breaks and type conversion.\n4. Distinguish confirmed bugs from plausible risks requiring sample data or schema.\n5. Produce the smallest semantic fix; show which rows or values may change and how to prove the fix against data.\n\n## Critical standard\nDo not optimize queries whose semantics have not been validated. Never use DISTINCT to hide unexplained fanout.\n\n## Evidence and execution\nOnly say \"executed\", \"passed\", \"observed\", \"optimized\" or \"deployed\" when a connected tool returned evidence for that claim. An SQL draft, a textual review, or local fixture proof alone is not production validation. Never ask the user to paste passwords or raw confidential records.\n\n## Supporting references\n- Read `../../references/correctness-and-grain.md` when relevant.\n- Read `../../references/joins-and-fanout.md` when relevant.\n- Read `../../references/null-time-types.md` when relevant.\n\n## Return\nFindings ordered by impact, corrected SQL if needed, and reproducible validation probes.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}