This document provides guidance for AI coding agents working with the Microsoft.Data.SqlClient repository.
Before making changes, agents should be aware of:
| File | Purpose |
|---|---|
| README.md | Project overview |
| BUILDGUIDE.md | Build and test instructions |
| CONTRIBUTING.md | Contribution guidelines |
| .github/copilot-instructions.md | Copilot-specific instructions |
The .github/instructions/ directory contains comprehensive guides:
| Guide | Coverage |
|---|---|
| architecture.instructions.md | Project structure, unified project model |
| tds-protocol.instructions.md | TDS protocol, packet handling |
| ado-pipelines.instructions.md | Azure DevOps CI/CD pipelines |
| onebranch-pipeline-design.instructions.md | OneBranch multi-product pipeline design spec |
| testing.instructions.md | Test framework, running tests |
| connection-pooling.instructions.md | Connection pool internals |
| api-design.instructions.md | Public API design principles |
| features.instructions.md | Feature reference, keywords |
| documentation.instructions.md | Documentation and samples |
| external-resources.instructions.md | Docs links, version matrix, external references |
This repository provides reusable prompts in .github/prompts/ for common maintainer workflows. Use these to guide agents through multi-step operations.
| Prompt | Purpose |
|---|---|
| fix-bug.prompt.md | Diagnose and fix a bug with tests and documentation |
| implement-feature.prompt.md | Plan and implement a new feature end-to-end |
| triage-issue.prompt.md | Triage a new GitHub issue with labeling and categorization |
| code-review.prompt.md | AI-assisted code review for a pull request |
| perf-optimization.prompt.md | Investigate and implement performance improvements |
| release-notes.prompt.md | Generate release notes for a specific milestone |
| update-build-pipelines.prompt.md | Modify Azure DevOps CI/CD pipeline configuration |
- Cross-Platform Compatibility: Code must work on .NET Framework 4.6.2+ and .NET 8.0+
- Backward Compatibility: No breaking changes without proper deprecation
- Test-First Development: All changes require tests
- Security by Default: Secure defaults, no credential logging
- Protocol Compliance: Follow MS-TDS specifications
- Performance Optimization: Use pooling, async, efficient allocations
- Observability: EventSource tracing, meaningful errors
- Understand the issue from the bug report
- Locate relevant code in
src/Microsoft.Data.SqlClient/src/(do NOT modify legacynetcore/src/ornetfx/src/) - Write a failing test that reproduces the issue
- Implement the fix
- Ensure all tests pass
- Update documentation if behavior changes
- Review the feature specification
- Plan the implementation (see
implement-featureprompt) - Update reference assemblies if adding public APIs
- Implement with tests
- Add samples to
doc/samples/ - Do not edit
CHANGELOG.mddirectly; instead, add a suggested release-note entry (per.github/copilot-instructions.md) in the PR description or via the release-notes workflow/prompt.
- Add to
SqlConnectionStringBuilder - Update connection string parser
- Default to backward-compatible value
- Add tests for new keyword
- Document in feature reference
- Reference MS-TDS specification
- Update
TdsEnums.csfor new constants - Implement in
TdsParser.csand related files - Test against multiple SQL Server versions
- Consider backward compatibility
- Profile the issue using benchmarks or traces
- Identify allocation hotspots (see
perf-optimizationprompt) - Apply patterns:
ArrayPool<T>,Span<T>, static/cached instances, source generation - Verify no regressions with existing tests
See the policy/ directory for:
- coding-best-practices.md - Programming standards
- coding-style.md - Code formatting guidelines
- review-process.md - PR review requirements
- Check existing tests for usage patterns
- Reference similar implementations in the codebase
- Consult the Microsoft Docs for API behavior specifications
- For protocol questions, refer to MS-TDS open specifications
This document is automatically loaded as context for AI agents working in this repository.