sql-server-best-practices — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited sql-server-best-practices (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill covers both on-premises SQL Server (2016+) and Azure SQL Database / Managed Instance. When differences exist between the two, they are called out in the relevant section.
Identify which domain(s) the user's request falls into, then read the corresponding reference file(s) before responding. For requests that touch multiple domains (e.g., "review this stored proc and its indexes"), read all relevant files.
| Domain | When to use | Reference file |
|---|---|---|
| T-SQL & query patterns | Writing queries, stored procs, functions, CTEs, cursors, error handling | references/query-patterns.md |
| Indexing strategy | Index design, fragmentation, missing/duplicate indexes, query plan issues | references/indexing.md |
| Schema & data modeling | Table design, data types, naming conventions, constraints, relationships | references/schema-design.md |
| Security | Permissions, least privilege, dynamic SQL injection, encryption, auditing | references/security.md |
| Maintenance & monitoring | Health checks, index rebuild, statistics, backups, CHECKDB | references/maintenance.md |
These apply regardless of domain — internalize them before reading any reference file:
dbo.TableName), always use SET NOCOUNT ON in procs, always define column lists in INSERT.SET STATISTICS IO ON, and sp_BlitzCache rather than intuiting performance.When reviewing any SQL, DDL, or migration code, always call out the following issues unprompted — even if the user only asked about something else:
sp_executesql with parameters.Keep the callout brief and constructive — one or two sentences, then move on to what the user actually asked.
Before writing any DDL or stored procedures, ask the questions below if the answers aren't already clear from context. Ask them together upfront — don't generate code first and ask after.
For any stored procedure or T-SQL code:
"What prefix do you use for stored procedures —usp_(common default), none, or something else?" Note: avoidsp_— SQL Server searches the master database first for any proc starting withsp_, which causes unnecessary overhead and confusion with system procedures.
For schema / table design or new database setup:
"Do you prefer INT IDENTITY (auto-increment integers: 1, 2, 3…) or GUID (UNIQUEIDENTIFIER — globally unique, better for distributed systems)?"
"Do you want soft deletes (anIsDeleted BITflag +DeletedAt DATETIME2column so rows are hidden but not removed) or hard deletes (physically remove the row)?"
"Do you want standard audit columns on each table —CreatedAt DATETIME2,UpdatedAt DATETIME2, and optionallyCreatedBy/UpdatedBy?"
If the user has already answered any of these earlier in the conversation, use that answer — don't ask again.
Ask yourself what the user is trying to accomplish:
query-patterns.mdindexing.md + maintenance.md (sp_BlitzCache/sp_BlitzFirst live there) + possibly query-patterns.md for SARGabilityschema-design.mdsecurity.mdmaintenance.mdschema-design.md + security.md~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.