SQL-Expert

skill
Security Audit
Warn
Health Warn
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 13 GitHub stars
Code Pass
  • Code scan — Scanned 1 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

A Claude Code skill for T-SQL and SQL Server expertise: query patterns, performance tuning, security, and transactions

README.md

SQL Expert

License: MIT
SQL Server
Claude Code

A Claude Code skill for Microsoft SQL Server and T-SQL development expertise.

Overview

This skill provides guidance for writing, optimizing, and debugging T-SQL queries. It covers advanced querying techniques, performance tuning, security best practices, and transaction management.

Features

  • Live Documentation Verification - Verifies T-SQL syntax against Microsoft's official sql-docs repository using WebFetch, with WebSearch fallback and conditional verification tiers (MUST/SHOULD/Skip) to balance accuracy with efficiency
  • Structured Workflows - Guided workflows for query development, performance optimization, and security implementation
  • Quick-Reference Patterns - Inline examples for common tasks like pagination, running totals, and safe dynamic SQL
  • Anti-Pattern Detection - Catches non-SARGable predicates, implicit conversions, and other performance pitfalls
  • Comprehensive References - Five detailed reference docs covering query patterns, performance tuning, security, data types, and transactions

Installation

From .skill package (Recommended)

Download sql-expert.skill from this repository. The archive contains a top-level sql-expert/
folder, so extract into the skills directory itself rather than into a subfolder named for the skill.

User-level (all projects)

macOS/Linux:

mkdir -p ~/.claude/skills && unzip sql-expert.skill -d ~/.claude/skills/

Windows (PowerShell):

Expand-Archive sql-expert.skill -DestinationPath $HOME\.claude\skills\

Project-level (current project only)

macOS/Linux:

mkdir -p .claude/skills && unzip sql-expert.skill -d .claude/skills/

Windows (PowerShell):

Expand-Archive sql-expert.skill -DestinationPath .claude\skills\

Verified on PowerShell 7. If Windows PowerShell 5.1 rejects the .skill extension,
copy the file to sql-expert.zip and expand that instead.

From source

Clone this repository, then copy the sql-expert folder to your skills directory:

User-level (all projects)

macOS/Linux:

cp -r sql-expert ~/.claude/skills/

Windows (PowerShell):

Copy-Item -Recurse sql-expert $HOME\.claude\skills\

Project-level (current project only)

macOS/Linux:

cp -r sql-expert .claude/skills/

Windows (PowerShell):

Copy-Item -Recurse sql-expert .claude\skills\

Repository Structure

SQL-Expert/
├── .githooks/
│   ├── install.sh                # Points core.hooksPath at .githooks (run once per clone)
│   └── pre-commit                # Repacks sql-expert.skill when skill sources are staged
├── README.md
├── sql-expert.skill              # Packaged skill (zip of sql-expert/) for direct install
└── sql-expert/                   # <- Copy this folder to your skills directory
    ├── SKILL.md                  # Main skill definition with core instructions
    └── references/
        ├── patterns.md           # Query patterns: CTEs, pagination, PIVOT, MERGE, window functions
        ├── performance.md        # Execution plans, parameter sniffing, Query Store, wait statistics
        ├── security.md           # SQL injection prevention, dynamic SQL, permissions, data masking
        ├── data-types.md         # Type selection, collation, precision/scale, storage optimization
        └── transactions.md       # Isolation levels, deadlocks, distributed transactions, sagas

Usage

Once installed, Claude Code will automatically use this skill when you ask about:

  • T-SQL query writing or optimization
  • SQL Server stored procedures
  • Database performance tuning
  • Query execution plans
  • SQL security and injection prevention

SQL Server Version Support

The skill covers features from SQL Server 2016 through 2022, with version annotations where applicable.

Skill Development

sql-expert.skill is a committed binary, so it goes stale the moment a source file is
committed without repacking. A versioned pre-commit hook closes that gap. Run once per
clone:

./.githooks/install.sh

That sets core.hooksPath to the tracked .githooks/ directory — git does not clone
.git/hooks, so a hook only survives if it is committed and pointed at explicitly.

The hook repacks sql-expert.skill only when something under sql-expert/ is
staged
, and packs from the git index rather than the working tree — so the archive always
matches the commit, even under partial staging (git add -p). Commits that touch only the
README or changelog leave the archive untouched.

$ git commit -m "Add MERGE upsert pattern"
pre-commit: repacked sql-expert.skill ( 24K)
Situation Hook behaviour
Staged change under sql-expert/ Repacks and stages the archive
Only non-skill files staged Skips; archive untouched
Skill directory deleted Drops the stale archive from the commit
zip unavailable Warns and lets the commit proceed

Bypass once with git commit --no-verify.

License

MIT

Reviews (0)

No results found