SqlServer.Rules copilot-instructions.md

Repository instructions for SqlServer.Rules, a .NET library and command-line tool that checks SQL Server code against design, naming, and performance rules. The project also includes packages and extensions for Visual Studio.

In plain words
What is it for?
Use them when developing the SQL analysis library, its command-line tool, tests, packages, or Visual Studio extensions.
Why use it?
They document how to restore, build, test, and run the project, including which Windows-only parts should be excluded on Linux or macOS.

Instructions file for GitHub Copilot

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.

agentmods
npx agentmods add instructions/erikej/sqlserver.rules/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/ErikEJ/SqlServer.Rules

Made for: GitHub Copilot.

Per session 1,835 This file is loaded in full into every session.
When invoked 1,835 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin fork From a forked repository.
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 $0.01835 $0.01835
Opus 5 $0.00918 $0.00918
Sonnet 5 $0.00367 $0.00367
Haiku 4.5 $0.00184 $0.00184

Measured yesterday against content hash a91d72848c95, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

SqlServer.Rules copilot-instructions.md 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 yesterday.

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.

.github/copilot-instructions.md · 147 lines

How it starts

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

SqlServer.Rules - SQL Code Analysis Library

SqlServer.Rules is a .NET library and command line tool that provides static code analysis for SQL Server projects, implementing design, naming, and performance analysis rules. The solution includes NuGet packages, a CLI tool, and a Visual Studio extension for analyzing SQL code against best practices.

Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

Working Effectively

Bootstrap and Build Process

  • Prerequisites: .NET 10.0 SDK or later
  • The solution file is SqlServer.Rules.slnx
  • On Windows, restore and build the full solution:
    • dotnet restore SqlServer.Rules.slnx -- NEVER CANCEL. Takes approximately 25 seconds. Set timeout to 60+ seconds.
    • dotnet build SqlServer.Rules.slnx --no-restore --configuration Release -- NEVER CANCEL. Set timeout to 90+ seconds.
  • On Linux/macOS, do not run dotnet build at the repository root. The solution includes Windows-only extension projects (tools/SqlAnalyzerVsix, tools/SqlAnalyzerSsms) that fail to build outside Windows. Use project-specific build/test commands instead.

Testing

  • On Windows, run the full test command used by CI:
    • dotnet test --no-build --configuration Release --verbosity normal -- NEVER CANCEL. Takes approximately 30 seconds. Set timeout to 90+ seconds.
  • Always run SqlServer.Rules.Tests for pull requests:
    • dotnet test test/SqlServer.Rules.Test/SqlServer.Rules.Tests.csproj --configuration Release --verbosity normal
  • TSQLAnalyzer.Tests covers the analyzer library:
    • dotnet test test/TSQLAnalyzer.Tests/TSQLAnalyzer.Tests.csproj --configuration Release --verbosity normal

CLI Tool Development and Testing

  • Build CLI tool: Included in the Windows solution build; on Linux/macOS build tools/SqlAnalyzerCli/SqlAnalyzerCli.csproj directly if needed
  • Test CLI tool functionality:
    • Direct execution: ./tools/SqlAnalyzerCli/bin/Release/net10.0/ErikEJ.TSQLAnalyzerCli -i [file]
    • Package CLI: dotnet pack tools/SqlAnalyzerCli/SqlAnalyzerCli.csproj --configuration Release
    • Install globally: dotnet tool install --global ErikEJ.DacFX.TSQLAnalyzer.Cli
    • Test samples: Use tools/SqlAnalyzerCli/testfiles/simple.sql or tools/SqlAnalyzerCli/testfiles/Chinook.dacpac

Read the full file on GitHub · 147 lines

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. yesterday First seen · 147 lines · 1,835 tokens per session scan A a91d72848c95

Subscribe to this mod's changes

SqlServer.Rules copilot-instructions.md is an instructions file published in the GitHub repository ErikEJ/SqlServer.Rules (240 stars, last pushed 12d ago), licensed MIT. It adds 1,835 tokens to every session, about $0.0092 per session on Opus 5. A static security scan graded it A with 0 findings. It comes from a forked repository.