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.
npx agentmods add instructions/erikej/sqlserver.rules/claude-mdgit clone --depth 1 https://github.com/ErikEJ/SqlServer.RulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01932 | $0.01932 |
| Opus 5 | $0.00966 | $0.00966 |
| Sonnet 5 | $0.00386 | $0.00386 |
| Haiku 4.5 | $0.00193 | $0.00193 |
Grade A, and why
SqlServer.Rules CLAUDE.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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Build, Test, Run
The solution file is SqlServer.Rules.slnx (slnx format — handled by modern dotnet SDK). CI uses .NET 10 SDK; the rules library targets netstandard2.1 + net472, tools/tests target net8.0 and net10.0.
dotnet restore
dotnet build --no-restore --configuration Release
dotnet test --no-build --configuration Release
Run a single test project / single test:
dotnet test test/SqlServer.Rules.Test/SqlServer.Rules.Tests.csproj
dotnet test test/SqlServer.Rules.Test/SqlServer.Rules.Tests.csproj --filter "FullyQualifiedName~SRD0039Tests"
Run the CLI against samples after a build:
./tools/SqlAnalyzerCli/bin/Release/net10.0/ErikEJ.TSQLAnalyzerCli -i tools/SqlAnalyzerCli/testfiles/simple.sql
./tools/SqlAnalyzerCli/bin/Release/net10.0/ErikEJ.TSQLAnalyzerCli -i tools/SqlAnalyzerCli/testfiles/Chinook.dacpac
The VSIX (tools/SqlAnalyzerVsix) is Windows-only (WPF) and is excluded from the main build (<Build Project="false" /> in the slnx). Build it with MSBuild directly when needed.
sqlprojects/* are also marked non-build in the slnx — they exist as test fixtures (real SQL projects with intentional rule violations) consumed by the test projects via relative file paths.
Architecture
How a rule works
src/SqlServer.Rules/is packaged asErikEJ.DacFX.SqlServer.Rules— a DacFx code-analysis NuGet that dropsSqlServer.Rules.dll/SqlServer.Rules.NetFx.dllintoanalyzers/dotnet/cs/(thenet472build is renamed to.NetFx.dllin a post-build step, seesrc/SqlServer.Rules/SqlServer.Rules.csproj). Both TFMs ship in one package so the analyzer loads under both legacy SSDT (net472) and modern SDK-style SQL projects.- Every rule inherits from
BaseSqlCodeAnalysisRule(src/SqlServer.Rules/BaseSqlCodeAnalysisRule.cs), which extends DacFx'sSqlCodeAnalysisRule. The base class exposes the sharedProgrammingSchemas/ProgrammingAndViewSchemaselement-type sets, keyword/data-type lists, a shared case-insensitiveComparer, and the heavyGetDataType(...)/GetColumnDataType(...)helpers (withConditionalWeakTablecaches keyed onTSqlObject— don't bypass these caches, column-type resolution is expensive). - Rules are discovered by MEF via
[ExportCodeAnalysisRule]. TheRuleIdis alwaysConstants.RuleNameSpace + "SR{D|N|P}####"(e.g.SqlServer.Rules.SRD0038). The category comes fromConstants.Design/Naming/Performanceinsrc/SqlServer.Rules/Globals/Constants.cs. Rules are organized in folders by category that mirror these constants. - Most rules walk the ScriptDom AST using visitors under
src/SqlServer.Rules/Visitors/. Prefer reusing an existing visitor — there are ~90 of them covering most node types. New visitors derive fromBaseVisitor(or a more specificTSqlConcreteFragmentVisitorsubclass). - XML doc comments on a rule class carry metadata used by the docs generator:
<FriendlyName>,<IsIgnorable>,<ExampleMd>. These get parsed intodocs/{Design,Naming,Performance}/SR*.md.
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.
- 2d ago First seen · 81 lines · 1,932 tokens per session scan A e5029e53bc9b
SqlServer.Rules CLAUDE.md is an instructions file published in the GitHub repository ErikEJ/SqlServer.Rules (240 stars, last pushed 12d ago), licensed MIT. It adds 1,932 tokens to every session, about $0.0097 per session on Opus 5. A static security scan graded it A with 0 findings. It comes from a forked repository.
Other instructions, from other repositories
turso AGENTS.md
Instructions for tursodatabase/turso, covering turso agent guidelines, quick reference, testing, running tests and test organization.
sqlglot AGENTS.md
Instructions for tobymao/sqlglot, covering contributing to sqlglot, about sqlglot, development commands, installation and basic installation.
graphjin AGENTS.md
Instructions for dosco/graphjin, covering graphjin agent guide, architectural overview, directory structure & responsibilities, build commands and coding guidelines.
spiceai copilot-instructions.md
Instructions for spiceai/spiceai, covering spice.ai agent instructions, data correctness — absolute top priority, evidence — no claim without a reproduction, build, test, lint (expensive — read first) and git & prs.
sq AGENTS.md
Instructions for neilotoole/sq, covering agents.md, about sq, key documents, common commands and conventions.
chdb AGENTS.md
Instructions for chdb-io/chdb, covering agents.md — chdb, 1. fully lazy execution architecture, 2. natural execution triggering (explicit calls prohibited), 3. unified architecture, simplicity first and 4. testing principles.