query-rewrite

Installation
SKILL.md

Query Rewrite (LITHE)

This skill rewrites T-SQL queries using LLM-generated structural transformations (the LITHE approach). It applies multiple rewrite strategies, validates each rewrite against the query optimizer's estimated cost, and tries to verify semantic equivalence. The result is a ranked list of lower-cost rewrites.

When to Use

  • User says "rewrite this query", "better form of this query", "restructure this query", "find a better SQL form"
  • User explicitly asks for a structural rewrite or reformulation of the SQL text
  • The improve-query-performance skill directed you here after the user selected rewrite analysis

When NOT to Use

  • Generic requests like "improve this query", "optimize this query", "make this faster", "help me with this query", "tune this query" → use improve-query-performance instead
  • User wants hint-based tuning → use query-hint-tuning skill instead
  • User wants index recommendations → use missing-index-analysis skill or LLM-based suggestions
  • User wants a full optimization workflow → use improve-query-performance skill instead

Choose the requested scope

Installs
32
GitHub Stars
66
First Seen
11 days ago