mssql-code-authoring
Skill1 starsChanged 56 days agoApache-2.0View on GitHub
Write or modify Microsoft SQL Server and legacy MS-SQL queries, stored procedures, schemas, indexes, and migrations with version and compatibility-level gating, parameter safety, transaction correctness, and operational verification. Use when repository evidence shows SQL Server, T-SQL, Microsoft.Data.SqlClient, System.Data.SqlClient, mssql-jdbc, mssql, or tedious and the task changes a query, persistence path, database object, or migration. Do not use for review-only work or for PostgreSQL, MySQL, or generic ANSI SQL without SQL Server evidence.
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
MSSQL-1 (Prove the target) — MUST: Before drafting, inspect repository configuration and, when authorized DB access exists, collect the …
- Distinctive: line 24
If any version-gated fact is unknown, avoid the gated feature or mark the SQL as a conditional alternative.
- Very specific: line 52
MSSQL-7 (Integrity) — MUST: Put stable invariants in PRIMARY KEY, UNIQUE, NOT NULL, CHECK, and foreign-key constraints where compatible …
- Very specific: line 56
MSSQL-8 (Migration safety) — MUST: Use expand/backfill/validate/contract stages for large or compatibility-sensitive changes.
- Distinctive: line 66
MSSQL-10 (Legacy and security boundary) — MUST: Keep least privilege, deprecated-feature inventory, support lifecycle, and SQL Server …
- Distinctive: line 70
MSSQL-11 (Authoring is not execution) — MUST NOT: Do not run DDL, DML, compatibility changes, index maintenance, plan forcing, permission …
- Distinctive: line 76
Read principles, then load only the matching KB topics from the KB index.
- Distinctive: line 91
Do not present conditional syntax as universally executable.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Microsoft SQL Server code authoring
Author T-SQL only inside the lowest feature set proven by the target engine, edition, database compatibility level, and repository tooling. Treat an unknown legacy environment as a compatibility constraint, not permission to assume the latest SQL Server behavior.
Required preflight
MSSQL-1 (Prove the target) — MUST. Before drafting, inspect repository configuration and, when authorized DB access exists, collect the read-only environment profile from legacy environment profile. Record:
- engine product version, edition, and deployment type (on-premises, VM, Managed Instance, or Azure SQL)
- database
compatibility_leveland collation READ_COMMITTED_SNAPSHOT/SNAPSHOTstate and Query Store state- migration runner and its batch semantics, including whether it understands
GO - affected objects, constraints, indexes, permissions, row counts, and representative access patterns
If any version-gated fact is unknown, avoid the gated feature or mark the SQL as a conditional alternative. Never change compatibility level, isolation options, Query Store, server configuration, or edition-dependent behavior as an incidental part of a feature.
Construction contract
MSSQL-2 (Repository truth) — MUST. Preserve existing schema qualification, naming, collation, migration ordering, stored-procedure conventions, and parameter types. Do not invent tables, columns, constraints, indexes, or production cardinality.
MSSQL-3 (Parameter safety) — MUST. Bind every runtime value through the application driver or typed
sp_executesql parameters. Dynamic identifiers cannot be value parameters: select them from a closed allowlist and
apply QUOTENAME. Never concatenate user-controlled text into executable SQL.
MSSQL-4 (Query shape) — MUST. Select explicit columns, use deterministic ordering where order matters, match
parameter types to indexed columns, and keep predicates SARGable. Do not add NOLOCK, query hints, plan forcing, or
blanket recompilation as a speculative performance fix. Read
query construction.
MSSQL-5 (Transaction correctness) — MUST. Define transaction ownership, keep transactions short, handle errors
with TRY...CATCH, inspect XACT_STATE(), roll back owned or uncommittable work, and rethrow with THROW when the
proven version supports it. Treat row-versioned isolation changes and retry policy as architectural decisions. Read
transactions and concurrency.
MSSQL-6 (Data semantics) — MUST. Preserve existing types unless the task includes a compatible migration. For new
designs, use types that match the domain and proven version. rowversion is a binary concurrency token, not time;
timestamp is its deprecated synonym. Prefer explicit precision/scale and Unicode intent over implicit conversion.
MSSQL-7 (Integrity) — MUST. Put stable invariants in PRIMARY KEY, UNIQUE, NOT NULL, CHECK, and foreign-key
constraints where compatible with existing data and ownership. Discover duplicate, null, orphan, and invalid rows
before tightening a constraint.
MSSQL-8 (Migration safety) — MUST. Use expand/backfill/validate/contract stages for large or compatibility-sensitive
changes. State lock exposure, log growth, replication/CDC/temporal implications, edition/version gates, rollback or
roll-forward path, and verification. ONLINE or resumable index syntax is never assumed. Read
schema and migration construction.
MSSQL-9 (Plan-based performance) — MUST. Propose an index or hint only from an observed predicate, join, ordering, distribution, and execution-plan or Query Store signal. Measure logical reads, elapsed/CPU time, row estimates, and representative parameter sets where safe. Never claim improvement from SQL text alone. Read performance and observability.
MSSQL-10 (Legacy and security boundary) — MUST. Keep least privilege, deprecated-feature inventory, support lifecycle, and SQL Server versus Azure differences visible. Do not enable dangerous server features, cross-database trust, or broad roles to make a script convenient. Read security and legacy constraints.
MSSQL-11 (Authoring is not execution) — MUST NOT. Do not run DDL, DML, compatibility changes, index maintenance, plan forcing, permission grants, or production diagnostics without separate authorization. Read-only metadata is allowed only within the user's database scope.
KB routing
Read principles, then load only the matching KB topics from the KB index. For cross-cutting changes, load every affected topic; do not recursively read the entire KB by default.
Deliverable
Return:
- proven environment profile and explicit unknowns
- T-SQL or migration with version/compatibility annotations where needed
- parameter and transaction ownership contract
- lock, log, index, permission, and rollout impact
- focused validation using repository tests plus safe plan/Query Store checks
- rollback or roll-forward procedure and residual legacy risks
Do not present conditional syntax as universally executable. Keep every performance, compatibility, and safety claim tied to repository or database evidence.
In this repository65 other files it gives its agents.
- agent-evalSkill
- architecture-review-workflowSkill
- backend-code-review-workflowSkill
- code-authoring-routerSkill
- code-diagram-extractSkill
- codex-agent-runtimeSkill
- design-pattern-applySkill
- diagram-stylerSkill
- document-designerSkill
- e2e-evidence-reportSkill
- e2e-report-rendererSkill
- e2e-runnerSkill
- e2e-scenario-authorSkill
- e2e-test-workflowSkill
- entitySkill
- enumSkill
- explore-dead-codeSkill
- flywaySkill
- git-flowSkill
- harness-proposeSkill
- harness-refineSkill
- java-spring-review-workflowSkill
- knowledge-auditSkill
- korean-dev-writerSkill
- kotlin-code-authoringSkill
- kotlin-spring-reviewSkill
- kotlin-spring-review-workflowSkill
- learnSkill
- mapperSkill
- markdown-publisherSkill
- mermaid-diagramsSkill
- nl-sql-querySkill
- notion-domain-contextSkill
- oop-design-reviewSkill
- opensearch-code-authoringSkill
- opensearch-optimizationSkill
- opensearch-query-reviewSkill
- opensearch-review-workflowSkill
- opensearch-schema-reviewSkill
- pdf-qaSkill
- playwright-e2eSkill
- postgres-code-authoringSkill
- postgres-query-reviewSkill
- postgres-review-workflowSkill
- postgres-risk-checkSkill
- postgres-schema-designSkill
- product-requirementsSkill
- product-ui-designSkill
- refactoring-catalogSkill
- repositorySkill
- requestSkill
- responseSkill
- retroSkill
- schema-doc-extractSkill
- security-scan-workflowSkill
- serviceSkill
- skill-updaterSkill
- start-taskSkill
- test-authoringSkill
- test-quality-refactoring-workflowSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

