tsql-review

tsql-review is a skill for Claude Code from vanterx/mssql-performance-skills. It costs 137 tokens per session (14,417 once invoked), scanned A, original, MIT.

A static reviewer for T-SQL, the SQL language used by Microsoft SQL Server. It checks source code such as queries, stored procedures, functions, views, and migration scripts for 85 known problem patterns without running them.

In plain words
What is it for?
Use it during code review to inspect pasted SQL or .sql files, assess described query structures, and identify issues across SQL Server 2017–2022 syntax and usage.
Why use it?
It can expose security risks, correctness issues, deprecated syntax, and likely performance problems before code reaches production. It complements execution-plan review, which examines behavior visible only after a query runs.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the mssql-performance-skills plugin — 26 skills, 3 hooks, 1 MCP server shipped together

Good fit Use it during code review to inspect pasted SQL or .sql files, assess described query structures, and identify issues across SQL Server 2017–2022 syntax and usage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vanterx/mssql-performance-skills/tsql-review
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 vanterx/mssql-performance-skills --skill tsql-review
Clone the repo
git clone --depth 1 https://github.com/vanterx/mssql-performance-skills

Made for: Claude Code.

Or install mssql-performance-skills, the plugin that ships this one along with the rest of its 26 skills, 3 hooks, 1 MCP server.

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 tsql-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/vanterx/mssql-performance-skills/tsql-review/github.svg)](https://agentmods.dev/skills/vanterx/mssql-performance-skills/tsql-review)
Your own site
<a href="https://agentmods.dev/skills/vanterx/mssql-performance-skills/tsql-review"><img src="https://agentmods.dev/badge/skills/vanterx/mssql-performance-skills/tsql-review/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 tsql-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/vanterx/mssql-performance-skills/tsql-review"><img src="https://agentmods.dev/badge/skills/vanterx/mssql-performance-skills/tsql-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 14,417 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.00137 $0.14417
Opus 5 $0.00068 $0.07208
Sonnet 5 $0.00027 $0.02883
Haiku 4.5 $0.00014 $0.01442

Measured 12d ago against content hash aa9555f50b8c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

tsql-review 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 12d ago.

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.

skills/tsql-review/SKILL.md · 542 lines

How it starts

The opening of the file, as written. The whole thing — 542 lines — stays where its author put it; the contents beside it link to each section on GitHub.

T-SQL Static Review Skill

Purpose

Analyze T-SQL source code — stored procedures, ad-hoc queries, scripts, migration files — for anti-patterns that are detectable without running the query or capturing an execution plan. Covers 85 checks (T1–T85) across six categories: structural anti-patterns, correctness and logic, security and dynamic SQL, deprecated and non-idiomatic syntax, performance smells, and SQL Server 2017–2022 modern syntax checks.

This is the "shift-left" complement to sqlplan-review. Run it during code review to catch problems before they reach production. Run sqlplan-review on the resulting execution plan to catch what only surfaces at runtime.

Input

Accept any of:

  • Raw T-SQL source code (paste inline or provide a file path)
  • A .sql file path
  • A description of the query structure ("a stored proc with a cursor that builds a dynamic WHERE clause")

If the user provides a file path, read the file and analyze its content. If the input is inline SQL, analyze it directly. If the input is a description, apply the checks based on what is described and note which checks could not be verified from the description alone.

How to Run

Walk T1–T85 in category order. Report every triggered finding — do not stop at the first match. For checks where the SQL construct is absent, note them as passing in the Passed Checks section. For checks where schema or parameter type information is unknown, state your assumption explicitly rather than skipping the check.


Thresholds Reference

Metric Value
CTE chain depth warning > 4 levels deep
Large IN list > 20 discrete values in an IN() clause
Nested subquery depth ≥ 3 levels of nested scalar subqueries
Excessive parameters > 50 named parameters in a stored procedure
Wide index suggestion > 4 key columns OR > 5 INCLUDE columns
NOLOCK overuse threshold ≥ 3 tables WITH (NOLOCK) in the same query
Small variable-length type ≤ 2 characters (VARCHAR(1), VARCHAR(2), NVARCHAR(1), NVARCHAR(2))

Read the full file on GitHub · 542 lines

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. 12d ago First seen · 542 lines · 137 tokens per session scan A aa9555f50b8c

Subscribe to this mod's changes

tsql-review is a skill published in the GitHub repository vanterx/mssql-performance-skills (5 stars, last pushed 5d ago), licensed MIT. It adds 137 tokens to every session and 14,417 once invoked, about $0.0007 per session on Opus 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-31.

Related

Other skills, from other repositories

triage-contributor-pr

Triage open pull requests from external contributors to prisma/prisma and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…

prisma/orm · 131 tokens

review-implement-phase

Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.

prisma/orm · 38 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

review-prs

Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…

googleapis/mcp-toolbox · 162 tokens

migration-review

Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.

rohitg00/ai-engineering-from-scratch · 35 tokens

product-review-report

A product-review workflow that researches a product and writes a Markdown report for deciding whether it is worth buying and using. It compares products from both the decision-maker's and everyday user's viewpoints.

digoal/blog · 153 tokens