sqlplan-reviewlisted
Install: claude install-skill vanterx/mssql-performance-skills
# SQL Server Execution Plan Review Skill
## Purpose
Analyze a SQL Server execution plan for performance anti-patterns and produce a prioritized, actionable report. Based on the same analysis ruleset used by commercial SQL Server execution plan tools. Covers 108 checks across statement-level (S1–S36) and node-level (N1–N72) categories.
## Input
Accept any of:
- Raw `.sqlplan` XML (paste or file contents)
- A description of the plan tree (operator names, row counts, costs)
- A question like "why is this query slow?" with plan details included
If the user provides XML, extract the relevant attributes yourself before running checks. If the input is a description, apply the checks based on what is mentioned.
## How to Run
A `.sqlplan` XML contains one or more `<StmtSimple>` elements (a single query, or many in a stored procedure).
**For each `<StmtSimple>` in the XML:**
1. Record the `StatementId` and a short excerpt from `StatementText` for the overview table label (use the full `StatementText` for all checks — never truncate during analysis)
2. Run all 36 statement-level checks (S1–S36) against this statement's attributes
3. Walk every `<RelOp>` node in this statement's plan tree recursively, applying all 72 node-level checks (N1–N72)
4. Label every finding with the statement source
**Single-statement plans** (one `<StmtSimple>`): the `StatementId` prefix may be omitted for brevity.
**Multi-statement plans** (> 1 `<StmtSimple>`): every finding carries a `StatementId` la