agentleFS
MicrosoftKnown publishermicrosoft/sqlsimtools/.github/skills/sqlsim/SKILL.md

sqlsim

Skill42 starsChanged 32 days agoMITView on GitHub

Run SQL queries, scripts, or multi-threaded workloads against SQL Server, Azure SQL Database, Azure SQL Managed Instance, or SQL database in Microsoft Fabric using the sqlsim CLI. USE FOR — executing T-SQL ad-hoc or from a `.sql` file; stress / load testing with N threads × R iterations; measuring connection / login / fetch timings; producing JSON metrics for automation; capturing per-query statistics (`-querystats`). DO NOT USE FOR — non-SQL Server engines (MySQL, Postgres, Oracle), or schema generation / data loading (sqlsim runs queries; it does not generate schemas).

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer the installed, version-matched copies in the workspace release overlay.

    line 9
  2. Very specific:

    If the overlay is not installed, for example when this skill comes from an Agent Plugin, use the public copies.

    line 15
  3. Distinctive:

    If neither exists, stop and report the missing prerequisite.

    line 31
  4. Very specific:

    Never append 2>&1, >, or | Select-String to a sqlsim invocation.

    line 82
  5. Very specific:

    Start load tests with a small -n value and scale gradually while monitoring client and server CPU, memory, network, and connection usage.

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

sqlsim — SQL workload simulator

Authoritative references (read these before authoring commands)

Prefer the installed, version-matched copies in the workspace release overlay. They match the executable you will run and work offline:

  • Consumer-facing agent instructions: sqlsim/AGENTS.md
  • User manual: sqlsim/sqlsim.md
  • Examples: sqlsim/examples/

If the overlay is not installed, for example when this skill comes from an Agent Plugin, use the public copies. They track the latest release, so confirm an option exists in sqlsim -h before relying on it:

Installation prerequisite and binary discovery

This plugin supplies agent guidance, not the sqlsim executable. Install a sqlsim release in the workspace or install sqlsim on PATH before running a workload.

Resolve the executable in this order:

  1. Workspace release overlay: .\sqlsim\x64\sqlsim.exe or .\sqlsim\ARM64\sqlsim.exe on Windows; ./sqlsim/x64/sqlsim on Ubuntu.
  2. A sqlsim executable already available on PATH.

If neither exists, stop and report the missing prerequisite. Do not assume the Agent Plugin installation directory contains the executable.

Command shape

sqlsim.exe -S <server> <auth> [-d <database>] [-Q <query> | -i <file>] [-n threads] [-r iters] [-q|-v] [-stream-json] [-json [-o file]]

Authentication (exactly one is required):

FlagUse case
-EWindows SSPI or Linux Kerberos integrated authentication
-AMicrosoft Entra interactive (Windows only)
-A ActiveDirectoryIntegratedEntra integrated (Kerberos ticket required on Linux)
-A ActiveDirectoryMsiManaged Identity
-A ActiveDirectoryServicePrincipal -U <client_id> -P <secret>Service principal
-T <token>Access token — preferred for repeated Azure runs
-U <user> -P <pwd>SQL Authentication

For local applications and automation, use -T - or -P - with redirected stdin to keep secrets out of process arguments.

Canonical patterns

# Smoke — local SQL Server
.\sqlsim\x64\sqlsim.exe -S localhost -E -Q "SELECT @@VERSION"

# Workload — 10 threads × 100 iterations, suppress result sets
.\sqlsim\x64\sqlsim.exe -S localhost -d AdventureWorks -E -i .\workload.sql -n 10 -r 100 -q

# Azure SQL with token (no interactive popup)
$token = az account get-access-token --resource https://database.windows.net --query accessToken -o tsv
$token | .\sqlsim\x64\sqlsim.exe -S myserver.database.windows.net -d mydb -T - -Q "SELECT 1"

# JSON for automation
.\sqlsim\x64\sqlsim.exe -S localhost -E -i .\workload.sql -n 4 -r 50 -json -o results.json
$r = Get-Content results.json | ConvertFrom-Json

# NDJSON progress stream for live consumers
.\sqlsim\x64\sqlsim.exe -S localhost -E -i .\workload.sql -n 4 -r 50 -stream-json

# NDJSON progress plus canonical final JSON
.\sqlsim\x64\sqlsim.exe -S localhost -E -i .\workload.sql -n 4 -r 50 `
  -stream-json -json -o final-results.json

Workload pattern

Separate logic from execution: a .ps1 invokes sqlsim.exe -i workload.sql. SQL batches are separated by GO. Use -stoponerror to halt all threads on the first failure (default: continue).

Rules

  1. Resolve the executable using the discovery order above. Do not search source build directories.
  2. Never append 2>&1, >, or | Select-String to a sqlsim invocation. Capture into a variable instead.
  3. Parse JSON results with ConvertFrom-Json. Compute deltas between phases — never compare cumulative values.
  4. For Azure SQL prefer -T <token> over -A for repeated runs.
  5. On Linux, do not use bare -A or ActiveDirectoryInteractive; use -T, Kerberos integrated authentication, managed identity, service principal, or SQL authentication.
  6. -querystats-interval <seconds> snapshots query statistics to a file while the run is in progress, implying -querystats and defaulting to querystats-live.json. The file is replaced atomically, so it is safe to poll. A write failure never fails the run and is reported once on stderr, but that message is suppressed in -json and -stream-json modes; verify the file exists rather than relying on a message or the exit code.
  7. Combine -stream-json with -json -o <file> to keep live NDJSON on stdout and write the canonical final JSON to the file. The combined mode requires -o.
  8. Certificate validation follows sqlcmd (Go): neither -N nor -C means the certificate is not validated, -N without -C requires validation, and -C bypasses it. This applies to every authentication mode including -T. For Azure SQL prefer -N m; use -C only for a self-signed server, or -F <hostname> when the connected name differs from the certificate name.
  9. Start load tests with a small -n value and scale gradually while monitoring client and server CPU, memory, network, and connection usage. High thread counts can exhaust client resources and invalidate results; use a dedicated client for significant load tests.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.