sqlsimtools / sqlsim
Copilot instructions42 starsChanged 32 days agoMITView on GitHub
On Ubuntu 24.04/26.04 LTS x64, use: The Ubuntu Release binary is build/linux-x64/sqlsim. Do not invoke CMake directly. For the Private Preview macOS Apple Silicon path, use: The Private Preview macOS ARM64 binary is build/macos-arm64/sqlsim. Do not invoke CMake directly. Treat macOS as invitation-only while customer and tester validation, live SQL testing, signing, and notarization decisions remain incomplete. On Windows, always use the build script to compile both architectures: Always use the build script to compile both architectures: Do NOT use…
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,336 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository15 other files it gives its agents.
- sqlpysim/AGENTS.mdAGENTS.md
- sqlsim/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- sqlpysim/.github/copilot-instructions.mdCopilot instructions
- docs/llms.txtllms.txt
- sqlpysimSkill
- sqlsimSkill
- sqlsimstudio-load-testSkill
- sqlsimstudio-manual-testSkill
- sqlsimstudioSkill
- sqlsimtools-buildSkill
- sqlsimtools-project-statsSkill
- sqlsimtools-releaseSkill
- sqlpysimSkill
- sqlsimSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
27 rules. About 0 are common, 19 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Always use the build script to compile both architectures:
- Distinctive: line 29
Do NOT use cmake, msbuild, or other build commands directly.
- Very specific: line 31
CRITICAL: Always build both architectures (x64 and ARM64) by running .\build.ps1 without -Architecture.
- Very specific: line 33
Use -Architecture x64 or -Architecture ARM64 to build only one architecture when the user explicitly requests it.
- Distinctive: line 39
After a successful build, ask the user whether to run:
- Very specific: line 43
Note: Always use -SkipBuild when running tests immediately after .\build.ps1 to avoid redundant rebuilds.
- Very specific: line 45
When adding a live test, build its arguments from the suite's auth arguments and launch sqlsim through the suite's launcher (& $runSqlsim …
- Distinctive: line 54
CRITICAL: Before running any command (build, test, or sqlsim.exe), ALWAYS check the VS Code terminal context first:
- Very specific: line 55
Look at Last Command: to see what the user already ran
- Very specific: line 56
Look at Exit Code: to see if it succeeded (0) or failed (non-zero)
- Distinctive: line 57
Do NOT re-run commands the user has already executed successfully
- Distinctive: line 58
If the user just ran a command, ask about the results or wait for them to share output instead of running it again
- Distinctive: line 62
CRITICAL: Always use valid syntax when running sqlsim.
- Distinctive: line 147
If Copilot skips this step, stop it immediately and ask: "What does your copilot-instructions say about this type of change?"
- Distinctive: line 153
STOP: Search for ALL related occurrences FIRST: - Use grep/search to find everywhere the string or pattern appears:
- Distinctive: line 161
STOP: Read documentation FIRST: - Check sqlsim.md BEFORE making changes to understand:
- Distinctive: line 183
After ANY code change, you MUST:
- Distinctive: line 186
Ask the user: "Should I run full-test-suite.ps1 -SkipBuild?"
- Distinctive: line 188
Run the chosen test suite: - Do NOT consider a change complete until all tests pass.
- Distinctive: line 190
Verify test counts: - If you add or remove tests, update the test counts in:
- Very specific: line 199
Ask about publishing: - If you changed sqlsim.exe behavior OR sqlsim.md, ask the user: "Would you like to publish?
- Very specific: line 202
Validate release package: - After publishing, if example scripts were changed, remind user: "Run .\test-nonazure-release-examples.ps1 to …
- Distinctive: line 206
Evaluate README.md and BUILD.md: - If you changed smoke-test.ps1 or full-test-suite.ps1, check whether:
- Distinctive: line 207
Test counts in README.md need updating
- Distinctive: line 208
Test counts in BUILD.md need updating
- Distinctive: line 209
Test descriptions need updating
- Distinctive: line 261
Use cmake/msbuild directly (always use build.ps1)
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions 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
Copilot Instructions for sqlsim
Building the Code
On Ubuntu 24.04/26.04 LTS x64, use:
bash ./build-linux.sh
bash ./smoke-test-linux.sh --skip-buildThe Ubuntu Release binary is build/linux-x64/sqlsim. Do not invoke CMake directly.
For the Private Preview macOS Apple Silicon path, use:
bash ./build-macos.sh
bash ./smoke-test-macos.sh --skip-buildThe Private Preview macOS ARM64 binary is build/macos-arm64/sqlsim. Do not invoke CMake directly. Treat macOS as invitation-only while customer and tester validation, live SQL testing, signing, and notarization decisions remain incomplete.
On Windows, always use the build script to compile both architectures:
Always use the build script to compile both architectures:
.\build.ps1Do NOT use cmake, msbuild, or other build commands directly.
CRITICAL: Always build both architectures (x64 and ARM64) by running .\build.ps1 without -Architecture. Do NOT use -Architecture x64 to build only one platform, even during iterative development. Both architectures must compile cleanly before testing.
Use -Architecture x64 or -Architecture ARM64 to build only one architecture when the user explicitly requests it.
- x64:
build\x64\Release\sqlsim.exe - ARM64:
build\ARM64\Release\sqlsim.exe
Note: There is NO build\Release\ folder - always use the architecture-specific paths.
After a successful build, ask the user whether to run:
.\full-test-suite.ps1 -SkipBuild(comprehensive validation, ~15 seconds).\publish.ps1(create release package for distribution)
Note: Always use -SkipBuild when running tests immediately after .\build.ps1 to avoid redundant rebuilds.
When adding a live test, build its arguments from the suite's auth arguments and
launch sqlsim through the suite's launcher (& $runSqlsim or Invoke-Sqlsim in
PowerShell, with_secret in Bash). The launcher hands the token or password over
on stdin; calling the executable directly with the auth arguments fails, because
-T - expects the secret on stdin. Add the test to the PowerShell and Bash suites
together; scripts/check-suite-parity.ps1 checks.
Checking Terminal Output Before Acting
CRITICAL: Before running any command (build, test, or sqlsim.exe), ALWAYS check the VS Code terminal context first:
- Look at
Last Command:to see what the user already ran - Look at
Exit Code:to see if it succeeded (0) or failed (non-zero) - Do NOT re-run commands the user has already executed successfully
- If the user just ran a command, ask about the results or wait for them to share output instead of running it again
Running sqlsim for Testing/Debugging
CRITICAL: Always use valid syntax when running sqlsim. Authentication is REQUIRED.
Valid Command Patterns
# Minimal connection test (Windows Auth)
.\build\x64\Release\sqlsim.exe -S localhost -E
# Query with Windows Auth
.\build\x64\Release\sqlsim.exe -S localhost -E -Q "SELECT @@VERSION"
# Query with database specified
.\build\x64\Release\sqlsim.exe -S localhost -d testdb -E -Q "SELECT 1"
# Multiple threads/iterations
.\build\x64\Release\sqlsim.exe -S localhost -E -Q "SELECT 1" -n 4 -r 10
# Verbose mode
.\build\x64\Release\sqlsim.exe -S localhost -E -Q "SELECT 1" -v
# JSON output
.\build\x64\Release\sqlsim.exe -S localhost -E -Q "SELECT 1" -json
# Input file
.\build\x64\Release\sqlsim.exe -S localhost -E -i examples\sql\01-simple-queries.sql
# Quiet mode (suppress results)
.\build\x64\Release\sqlsim.exe -S localhost -E -Q "SELECT 1" -qAuthentication Options (one REQUIRED)
| Option | Description |
-E | Windows Authentication |
-A | Microsoft Entra (interactive) |
-A ActiveDirectoryMsi | Managed Identity |
-T <token> | Access token |
-U <user> -P <pass> | SQL Authentication |
Common Invalid Patterns (DO NOT USE)
# WRONG: Missing authentication
.\build\x64\Release\sqlsim.exe -S localhost -Q "SELECT 1"
# WRONG: Long option names not supported (except --help)
.\build\x64\Release\sqlsim.exe --server localhost
# WRONG: Unix-style double-dash options
.\build\x64\Release\sqlsim.exe --verboseGetting Help
# Any of these show help:
.\build\x64\Release\sqlsim.exe
.\build\x64\Release\sqlsim.exe -h
.\build\x64\Release\sqlsim.exe -?
.\build\x64\Release\sqlsim.exe --helpKey Parameters
| Parameter | Description |
-S <server> | Server name (defaults to localhost if omitted) |
-d <database> | Database name (optional) |
-Q <query> | Query string (use GO on own line for multiple batches) |
-i <file> | Input file with queries |
-n <threads> | Number of concurrent threads (default: 1) |
-r <iterations> | Iterations per thread (default: 1) |
-v | Verbose mode |
-q | Quiet mode |
-json | JSON output |
-o <file> | Output to file |
-stoponerror | Stop on first error |
CRITICAL: Code Change Workflow (Follow This Order!)
⚠️ MANDATORY: Before ANY code change, say aloud:
"This change affects [type]. Per the dependency table, I must also update [list of files]."
If Copilot skips this step, stop it immediately and ask: "What does your copilot-instructions say about this type of change?"
BEFORE Editing Any Code:
STOP: Search for ALL related occurrences FIRST - Use grep/search to find everywhere the string or pattern appears:
- Source files (src/.cpp, include/.h)
- Tests (smoke-test.ps1, full-test-suite.ps1)
- Documentation (sqlsim.md, BUILD.md, README.md, SETUP.md)
- Examples (examples/sql/.sql, examples/powershell/.ps1)
List all files that will need changes BEFORE proceeding.
- STOP: Read documentation FIRST - Check sqlsim.md BEFORE making changes to understand:
- Current sample outputs that may need updating
- Feature descriptions that may need updating
- Parameter tables that may need changes
- Behavioral descriptions that may conflict with your changes
DURING Code Changes:
Update ALL affected files in a SINGLE response (not separately):
- Source code (src/.cpp, include/.h)
- Tests (smoke-test.ps1, full-test-suite.ps1)
- Documentation (sqlsim.md, BUILD.md, README.md, SETUP.md)
- Examples (examples/sql/.sql, examples/powershell/.ps1)
Do NOT wait for user to ask "what about docs?" - include them proactively.
AFTER Editing Code:
- Build and evaluate sqlsim.md:
After ANY code change, you MUST:.\build.ps1- Build with
.\build.ps1 - Evaluate whether sqlsim.md needs updates (sample outputs, parameter docs, behavior descriptions)
- Ask the user: "Should I run full-test-suite.ps1 -SkipBuild?"
- Build with
- Run the chosen test suite - Do NOT consider a change complete until all tests pass.
- Verify test counts - If you add or remove tests, update the test counts in:
- smoke-test.ps1 (header comment and output message)
- BUILD.md (smoke test and full test suite counts)
- README.md (test counts)
BEFORE Saying "Done":
- Review the dependency table below - For each type of change made, verify all dependent files were updated.
- Ask about publishing - If you changed sqlsim.exe behavior OR sqlsim.md, ask the user:
"Would you like to publish? Run
.\publish.ps1to create a release package." - Validate release package - After publishing, if example scripts were changed, remind user:
"Run
.\test-nonazure-release-examples.ps1to validate the release package works correctly." For Azure testing:.\test-azure-release-examples.ps1 -ServerName <server> - Evaluate README.md and BUILD.md - If you changed smoke-test.ps1 or full-test-suite.ps1, check whether:
- Test counts in README.md need updating
- Test counts in BUILD.md need updating
- Test descriptions need updating
Key Dependencies (If X changes, update Y)
| If you change... | You MUST also update... |
| Output format/text | Tests that validate output, sqlsim.md sample outputs |
| Command-line parameters | Help text in main.cpp, sqlsim.md parameter tables, tests |
| JSON output fields | JSON schema docs in sqlsim.md, JSON validation tests, examples/powershell/json-output-examples.ps1 |
| Error messages | Tests that expect specific error text |
| Terminology (e.g., "batches" vs "queries") | ALL files - grep to find every occurrence |
| Examples in -? help text | test-examples.ps1, sqlsim.md, full-test-suite.ps1 example validation tests |
| Examples in sqlsim.md | test-examples.ps1, full-test-suite.ps1 example validation tests |
| Examples folder (add/remove/rename) | test-examples.ps1, sqlsim.md "Example Files" section, examples/README.md, release validation scripts |
| Example scripts in examples/powershell/*.ps1 | test-nonazure-release-examples.ps1, test-azure-release-examples.ps1 |
| Report generators in examples/reports/*.ps1 | Encode JSON-derived HTML values and coerce JavaScript numbers; run test-reports.ps1 |
| Test count (add/remove tests) | smoke-test.ps1 header, BUILD.md test counts, README.md |
| Version number | src/main.cpp, sqlsim.md, README.md |
| Verbose vs non-verbose behavior | Both text and JSON output paths, related tests |
Security and Performance Review Threshold
After significant code changes, ask the user whether to run a security and performance review.
What triggers this prompt:
- 3+ source files modified in a single session (src/.cpp, include/.h)
- New feature added that involves user input, network, or file I/O
- Authentication or connection handling changes
- Memory management changes (allocations, buffers, string handling)
- Concurrency/threading changes
- Any change to ODBC calls or SQL execution paths
When threshold is met, ask:
"This session involved significant code changes ([list types: e.g., 'memory handling, threading, user input']). Would you like me to perform a security and performance review before we finalize?"
Security review checks:
- Buffer overflow risks
- SQL injection vectors
- Input validation
- Memory leaks
- Credential handling
- Error message information disclosure
Performance review checks:
- Unnecessary allocations in hot paths
- String copying vs. references
- Connection pooling efficiency
- Lock contention in multi-threaded code
- I/O batching opportunities
Do NOT
- Use cmake/msbuild directly (always use build.ps1)
- Skip running full-test-suite.ps1 after code changes
- Say "done" or "ready to publish" without verifying the dependency table above
Useful Grep Patterns
# Find all occurrences of a string across source, tests, and docs
Get-ChildItem -Recurse -Include *.cpp,*.h,*.ps1,*.md | Select-String "pattern"
# Find output format strings
Get-ChildItem -Recurse -Include *.cpp | Select-String "TS_OUT|std::cout"
# Find test expectations
Get-ChildItem -Include *.ps1 | Select-String "ExpectedOutput"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.

