mssql-extension
AGENTS.md137 starsChanged 3 months agoMITView on GitHub
Predefined agent configurations for common development tasks. Launch via the Task tool. All prompts use the project root directory (where this file lives) as the working directory. When launching agents, replace $PROJECT_ROOT with the actual absolute path, or instruct the agent to use the current working directory. Build the extension using Ninja generator. Run tests with SQL Server. Starts Docker container if needed. Test environment uses these variables (auto-exported by Makefile): Test groups: [sql], [integration], [mssql], [dml], [transaction]
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 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 repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
The file
We split this agents.md into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Very specific: line 5
All prompts use the project root directory (where this file lives) as the working directory.
- Very specific: line 6
When launching agents, replace $PROJECT_ROOT with the actual absolute path, or instruct the agent to use the current working directory.
- Distinctive: line 40
Run tests with SQL Server.
- Distinctive: line 42
Test environment uses these variables (auto-exported by Makefile):
- Very specific: line 49
Test groups: [sql], [integration], [mssql], [dml], [transaction]
- Distinctive: line 117
Run a specific SQL command against the statically linked DuckDB CLI with TDS debug logging enabled.
- Distinctive: line 163
When gaps are known, use this to update docs:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
Reusable Subagent Definitions
Predefined agent configurations for common development tasks. Launch via the Task tool.
All prompts use the project root directory (where this file lives) as the working directory.
When launching agents, replace $PROJECT_ROOT with the actual absolute path, or instruct
the agent to use the current working directory.
1. Build
Build the extension using Ninja generator.
subagent_type: Bash
description: Build the extension
prompt: |
Build the mssql-extension with Ninja generator. Run from the project root:
GEN=ninja make release
This uses CMake with -G "Ninja" via the extension-ci-tools Makefile.
Build outputs:
- DuckDB CLI: build/release/duckdb
- Static extension: build/release/extension/mssql/libmssql_extension.a
- Loadable extension: build/release/extension/mssql/mssql.duckdb_extension
Report: success/failure, number of targets built, and any errors.Debug Build Variant
subagent_type: Bash
description: Build debug extension
prompt: |
Build the mssql-extension in debug mode with Ninja generator. Run from the project root:
GEN=ninja make debug
Report: success/failure, number of targets built, and any errors.2. Test
Run tests with SQL Server. Starts Docker container if needed.
Test environment uses these variables (auto-exported by Makefile):
MSSQL_TEST_DSN— ADO.NET connection string for masterMSSQL_TESTDB_DSN— ADO.NET connection string for TestDBMSSQL_TEST_URI/MSSQL_TESTDB_URI— URI connection stringsMSSQL_TEST_DSN_TLS— TLS URI (NOT exported by default, TLS tests skipped without it)
Test groups: [sql], [integration], [mssql], [dml], [transaction]
subagent_type: Bash
description: Run extension tests
prompt: |
Run the mssql-extension test suite from the project root. Steps:
1. Check SQL Server container: make docker-status
2. If not running/healthy, start it: make docker-up
(waits up to 120s for healthy state, then runs init scripts)
3. Run all tests: make test-all
This runs: build/release/test/unittest "*mssql*" --force-reload
Environment variables (MSSQL_TEST_DSN, MSSQL_TESTDB_DSN, etc.) are auto-exported.
4. Report: total tests, passed, failed, skipped, and any failure details.
NOTE: TLS tests (tls_connection, tls_multipacket, tls_parallel, tls_queries) are
skipped unless MSSQL_TEST_DSN_TLS is manually exported.Unit Tests Only (no SQL Server)
subagent_type: Bash
description: Run unit tests
prompt: |
Run unit tests only (no SQL Server required). Run from the project root:
make test
Unit tests are C++ tests in test/cpp/ that test isolated components:
batch builder, connection pool, DDL translator, insert executor,
statistics provider, TLS connection, value serializer.
Report: total tests, passed, failed, and any failure details.Integration Tests Only
subagent_type: Bash
description: Run integration tests
prompt: |
Run integration tests against SQL Server from the project root. Steps:
1. Ensure SQL Server is running: make docker-status || make docker-up
2. Run: make integration-test
This runs two test suites sequentially:
build/release/test/unittest "[integration]" --force-reload
build/release/test/unittest "[sql]" --force-reload
All MSSQL_TEST_* env vars are auto-exported by the Makefile.
3. Report: total tests, passed, failed, skipped, and any failure details.Run Specific Test Group
subagent_type: Bash
description: Run specific test group
prompt: |
Run a specific test group from the project root. Steps:
1. Ensure SQL Server is running: make docker-status
2. Source env vars from .env and compute connection strings:
set -a && source .env && set +a
export MSSQL_TEST_DSN="Server=${MSSQL_TEST_HOST},${MSSQL_TEST_PORT};Database=${MSSQL_TEST_DB};User Id=${MSSQL_TEST_USER};Password=${MSSQL_TEST_PASS}"
export MSSQL_TESTDB_DSN="Server=${MSSQL_TEST_HOST},${MSSQL_TEST_PORT};Database=TestDB;User Id=${MSSQL_TEST_USER};Password=${MSSQL_TEST_PASS}"
build/release/test/unittest "[GROUP]" --force-reload
Replace [GROUP] with: [sql], [integration], [mssql], [dml], or [transaction].
For a single file: build/release/test/unittest "test/sql/path/to/file.test" --force-reload
Report: total tests, passed, failed, skipped, and any failure details.Debug Test (run SQL with MSSQL_DEBUG)
Run a specific SQL command against the statically linked DuckDB CLI with TDS debug logging enabled. This agent should be allowed to run by default without additional permission prompts.
subagent_type: Bash
description: Debug test SQL command
prompt: |
Run a debug test with the mssql-extension from the project root.
Execute the DuckDB CLI with TDS debug logging:
MSSQL_DEBUG=1 ./build/release/duckdb -c "<SQL_COMMAND>"
The static build at build/release/duckdb has the mssql extension linked in (no LOAD needed).
Replace <SQL_COMMAND> with the SQL to execute. Example:
set -a && source .env && set +a
MSSQL_DEBUG=1 ./build/release/duckdb -c "ATTACH 'Server=${MSSQL_TEST_HOST},${MSSQL_TEST_PORT};Database=TestDB;User Id=${MSSQL_TEST_USER};Password=${MSSQL_TEST_PASS}' AS db (TYPE mssql); SELECT * FROM db.dbo.TestSimplePK;"
Debug levels:
MSSQL_DEBUG=1 Basic TDS protocol debug
MSSQL_DEBUG=2 Verbose debug
MSSQL_DEBUG=3 Trace level (all packets)
Additional debug vars:
MSSQL_DML_DEBUG=1 DML operation debug (generated SQL, batch sizes, rowid values)
Report: command output, any debug log lines, errors, and query results.3. Architect
Investigate architecture and update documentation.
subagent_type: Explore
description: Investigate architecture
prompt: |
Investigate the mssql-extension architecture in the project root.
Thoroughness: very thorough.
1. Read all docs in docs/ folder.
2. Explore source code in src/ to find any undocumented components, classes, or patterns.
3. Compare documentation against actual code and identify:
- Missing classes or modules not covered in docs
- Outdated information (class names, method signatures, file paths)
- Missing configuration settings or extension functions
- Architectural patterns not described
4. Report findings as a structured list of gaps with file references.Architecture Update Variant
When gaps are known, use this to update docs:
subagent_type: general-purpose
description: Update architecture docs
prompt: |
Update architecture documentation in docs/.
Read the existing docs and the source code, then update the documentation files
to reflect the current state of the codebase. Follow the style and structure
of existing documentation. Do NOT create new files unless a major new component
has no corresponding doc file.
Key docs to check:
- docs/architecture.md (main overview)
- docs/tds-protocol.md (TDS layer)
- docs/connection-management.md (pool, provider)
- docs/catalog-integration.md (catalog, schema, tables)
- docs/type-mapping.md (type conversion)
- docs/query-execution.md (scan, DML)
- docs/transactions.md (transaction management)
Report what was updated and why.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.

