azure-sdk-for-cpp
AGENTS.md206 starsChanged 8 months agoMITView on GitHub
This file provides guidance for AI agents (e.g., GitHub Copilot, LLM-based assistants, and automation tools) interacting with the Azure SDK for C++ repository. The Azure SDK for C++ provides modern C++ libraries for Azure services, following the Azure SDK Design Guidelines for C++. This repository contains: AI agents working in this repository are encouraged to: Agents should NOT:
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 33,398 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.
- sdk/storage/AGENTS.mdAGENTS.md
- sdk/storage/azure-storage-blobs/AGENTS.mdAGENTS.md
- sdk/storage/azure-storage-files-datalake/AGENTS.mdAGENTS.md
- sdk/storage/azure-storage-files-shares/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- azsdk-common-apiview-feedback-resolutionSkill
- azsdk-common-generate-sdk-locallySkill
- azsdk-common-pipeline-troubleshootingSkill
- azsdk-common-prepare-release-planSkill
- azsdk-common-sdk-releaseSkill
- code-reviewSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
26 rules. About 3 are common, 23 are distinctive, and 0 are very specific to this project.
≈3
Common · estimate
Many files like this have a rule of this kind.
≈23
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 32
Add or update unit tests using Google Test framework
- Distinctive: line 38
Update CONTRIBUTING.md when development processes change
- Distinctive: line 42
Run CMake builds locally
- Distinctive: line 68
Test proxy configuration changes need verification
- Common: line 85
No credentials in code or config files
- Common: line 86
No API keys in tests (use environment variables)
- Distinctive: line 87
No connection strings in source
- Distinctive: line 195
Agent Guidance: Do not manually edit generated files.
- Distinctive: line 201
Update to public header files
- Distinctive: line 219
Agent Guidance: Ensure changes work across platforms.
- Distinctive: line 228
Agent Guidance: Update version files and changelogs when making changes.
- Common: line 248
PLAYBACK: Use recorded responses (no network, no credentials needed for actual services)
- Distinctive: line 252
Agent Guidance: Use PLAYBACK mode for local development.
- Distinctive: line 274
Update CMakeLists.txt with new package name
- Distinctive: line 276
Add unit tests and samples
- Distinctive: line 278
Update root CMakeLists.txt to include new package
- Distinctive: line 280
Agent Guidance: Follow the template structure.
- Distinctive: line 284
Add a failing unit test that reproduces the bug
- Distinctive: line 286
Verify test passes and no regressions
- Distinctive: line 290
Agent Guidance: Keep changes surgical. One bug = one PR.
- Distinctive: line 295
Create issue or spec doc for large features
- Distinctive: line 297
Add samples demonstrating usage
- Distinctive: line 298
Update package version and CHANGELOG
- Distinctive: line 323
Test Thoroughly: Run tests locally before submitting changes
- Distinctive: line 324
Document Changes: Update comments, docs, and changelogs
- Distinctive: line 327
Check CI: Ensure all CI checks pass before merging
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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
AGENTS.md
This file provides guidance for AI agents (e.g., GitHub Copilot, LLM-based assistants, and automation tools) interacting with the Azure SDK for C++ repository.
Repository Purpose and Scope
The Azure SDK for C++ provides modern C++ libraries for Azure services, following the Azure SDK Design Guidelines for C++. This repository contains:
- Client libraries for Azure services (Storage, Key Vault, Identity, etc.)
- Core libraries (
azure-core) providing shared functionality (HTTP pipeline, authentication, retry policies, etc.) - Build infrastructure using CMake and vcpkg
- Documentation and samples for developers
- Test infrastructure including unit tests and integration tests
Key Technologies
- Language: C++14
- Build System: CMake (version 3.13+)
- Package Manager: vcpkg (manifest mode)
- Testing: Google Test (gtest)
- Documentation: Doxygen
- CI/CD: Azure Pipelines
Agent Capabilities and Boundaries
Supported Agent Actions
AI agents working in this repository are encouraged to:
- Code Contributions
- Implement new features following the C++ Guidelines
- Fix bugs with minimal, surgical changes
- Add or update unit tests using Google Test framework
- Improve code documentation using Doxygen-style comments
- Documentation
- Update README files
- Improve inline code comments
- Update CONTRIBUTING.md when development processes change
- Generate or update API documentation
- Build and Test
- Run CMake builds locally
- Execute unit tests via
ctest - Generate code coverage reports (when BUILD_CODE_COVERAGE is ON)
- Build samples (when BUILD_SAMPLES is ON)
- Code Review and Analysis
- Review pull requests for adherence to guidelines
- Suggest improvements to code structure and style
- Identify potential issues before CI runs
Actions Requiring Caution
- Dependency Management
- Changing vcpkg.json should be done sparingly
- New dependencies require justification and approval
- OpenSSL version changes need careful consideration
- Consult
vcpkg-custom-portsfor custom dependency versions
- Breaking Changes
- Public API changes must follow semver and SDK guidelines
- Internal types (in
_internalnamespace) can change within constraints - Private types (in
_detailnamespace) have fewer restrictions
- CI/CD Configuration
- Changes to
.github/workflows/require testing - Azure Pipeline configurations need validation
- Test proxy configuration changes need verification
- Changes to
Actions Outside Agent Scope
Agents should NOT:
- Modify Security-Critical Code without explicit review
- Authentication flows
- Credential handling
- Cryptographic operations
- Make Large Architectural Changes without design review
- Changing core abstractions
- Modifying HTTP pipeline architecture
- Restructuring repository layout
- Commit Secrets or Sensitive Data
- No credentials in code or config files
- No API keys in tests (use environment variables)
- No connection strings in source
Key Workflows and Commands
Building the Project
# Basic build
mkdir build && cd build
cmake ..
cmake --build .
# Build with tests
cmake -DBUILD_TESTING=ON ..
cmake --build .
# Build with samples
cmake -DBUILD_SAMPLES=ON ..
cmake --build .
# Build with specific transport adapter
cmake -DBUILD_TRANSPORT_CURL=ON ..
cmake --build .Running Tests
# Set test mode (LIVE, PLAYBACK, or RECORD)
export AZURE_TEST_MODE=PLAYBACK
# Run all tests
ctest -V
# Run specific package tests
ctest -R azure-core
ctest -R storage
# Run with test proxy (for recording/playback)
export AZURE_TEST_USE_TEST_PROXY=ON
ctest -VCode Coverage
# Build with coverage enabled (requires Debug mode and GNU compiler)
cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON ..
cmake --build .
# Generate coverage reports
make azure-core_cov_xml # XML report
make azure-core_cov_html # HTML reportDocumentation Generation
# Build Doxygen documentation
cmake -DBUILD_DOCUMENTATION=ON ..
cmake --build .Code Formatting
# Format code using clang-format
# The repository includes a .clang-format configuration
find sdk/ -name "*.cpp" -o -name "*.hpp" | xargs clang-format -iRepository Structure
azure-sdk-for-cpp/
+-- .github/ # GitHub configuration and workflows
+-- copilot-instructions.md # Copilot-specific guidance
+-- workflows/ # CI/CD workflows
+-- cmake-modules/ # CMake helper modules
+-- doc/ # Documentation
+-- eng/ # Engineering system scripts
+-- common/ # Shared scripts across Azure SDKs
+-- docs/ # Documentation generation
+-- samples/ # Sample applications
+-- sdk/ # SDK service libraries
+-- core/ # Core libraries (azure-core, azure-core-amqp, etc.)
+-- storage/ # Storage services (blobs, files, queues)
+-- identity/ # Authentication and identity
+-- keyvault/ # Key Vault (keys, secrets, certificates)
+-- template/ # Template for new services
+-- tools/ # Development tools
+-- vcpkg.json # Package dependencies manifest
+-- CMakeLists.txt # Root CMake configuration
+-- CONTRIBUTING.md # Contribution guidelines
+-- AGENTS.md # This fileSDK-Specific Automation Workflows
1. Code Generation
The C++ repository generates SDKs using TypeSpec with the typespec-cpp emitter:
- TypeSpec Projects: Located in package directories with
tspconfig.yamlandtsp-location.yamlfiles - Configuration: Service-specific settings in
tspconfig.yamldefine emitter options - Generated Code: Auto-generated code in
src/private/and header directories - TypeSpec Emitter: Uses
@azure-tools/typespec-cppwith Azure flavor for code generation
Agent Guidance: Do not manually edit generated files. Modify TypeSpec specifications and regenerate using the typespec-cpp emitter. Some older services may still have swagger directories for legacy purposes, but new SDK development uses TypeSpec exclusively.
2. API Review Process
Public API changes require:
- Update to public header files
- Doxygen documentation for new APIs
- Unit tests covering new functionality
- Sample code demonstrating usage
- API review approval (tracked externally)
Agent Guidance: Flag API changes for human review. Include APIView links when available.
3. Test Matrix
Tests run across multiple configurations:
- Platforms: Windows, Linux (Ubuntu), macOS
- Compilers: MSVC, GCC, Clang
- Build Types: Debug, Release
- Transport Adapters: libcurl, WinHTTP
- Test Modes: LIVE, PLAYBACK, RECORD
Agent Guidance: Ensure changes work across platforms. Test with both curl and WinHTTP when modifying HTTP layer.
4. Versioning and Releases
- Semantic Versioning: Libraries follow semver (MAJOR.MINOR.PATCH)
- Version Files:
src/private/package_version.hppin each package - Release Tags: Format
{package-name}_{version}(e.g.,azure-core_1.10.0) - Changelogs:
CHANGELOG.mdin each package directory
Agent Guidance: Update version files and changelogs when making changes. Follow branching strategy.
Testing Guidelines
Test Environment Setup
Tests require environment variables for authentication and configuration:
# Example for Storage tests
export STANDARD_STORAGE_CONNECTION_STRING="..."
export AZURE_STORAGE_ACCOUNT_URL="..."
export AZURE_STORAGE_ACCOUNT_NAME="..."
export AZURE_STORAGE_ACCOUNT_KEY="..."See sdk/core/ci.yml for required configuration per package.
Test Modes
- PLAYBACK: Use recorded responses (no network, no credentials needed for actual services)
- LIVE: Connect to real Azure services (requires valid credentials)
- RECORD: Capture responses for playback (requires test proxy)
Agent Guidance: Use PLAYBACK mode for local development. Use RECORD only when updating test recordings.
Test Proxy
The test proxy (test-proxy) enables recording and playback:
# Start test proxy automatically
export AZURE_TEST_USE_TEST_PROXY=ON
# Or start manually
dotnet tool install azure.sdk.tools.testproxy --global
test-proxy startSee doc/TestProxy.md for details.
Common Development Scenarios
Adding a New Service Library
- Copy
sdk/template/azure-template/as starting point - Update CMakeLists.txt with new package name
- Implement service client following SDK guidelines
- Add unit tests and samples
- Generate documentation
- Update root CMakeLists.txt to include new package
Agent Guidance: Follow the template structure. Maintain consistency with existing packages.
Fixing a Bug
- Add a failing unit test that reproduces the bug
- Make minimal changes to fix the issue
- Verify test passes and no regressions
- Update CHANGELOG.md
- Submit PR with clear description
Agent Guidance: Keep changes surgical. One bug = one PR.
Adding a Feature
- Review API design guidelines
- Create issue or spec doc for large features
- Implement with tests and documentation
- Add samples demonstrating usage
- Update package version and CHANGELOG
Agent Guidance: Get design approval before implementing. Include usage examples.
Cross-References
- Copilot-Specific Instructions: .github/copilot-instructions.md
- Contribution Guide: CONTRIBUTING.md
- API Design Guidelines: https://azure.github.io/azure-sdk/cpp_introduction.html
- Test Proxy Documentation: doc/TestProxy.md
- Performance Testing: doc/PerformanceTesting.md
- Distributed Tracing: doc/DistributedTracing.md
Additional Resources
- Developer Documentation: https://azure.github.io/azure-sdk-for-cpp
- Azure for C++ Developers: https://learn.microsoft.com/azure/
- SDK Design Guidelines: https://azure.github.io/azure-sdk/cpp_introduction.html
- Azure SDK Repository Policies: https://github.com/Azure/azure-sdk
- Filing Issues: https://github.com/Azure/azure-sdk-for-cpp/issues/new/choose
Agent Best Practices
- Understand Before Changing: Review existing code and patterns before making changes
- Follow Conventions: Maintain consistency with existing code style and structure
- Test Thoroughly: Run tests locally before submitting changes
- Document Changes: Update comments, docs, and changelogs
- Keep Changes Minimal: Make surgical changes; avoid unnecessary refactoring
- Seek Review: Complex changes should be reviewed by maintainers
- Check CI: Ensure all CI checks pass before merging
Metadata
- Repository: https://github.com/Azure/azure-sdk-for-cpp
- Language: C++14
- License: MIT
- Maintainers: Azure SDK Team
- Last Updated: 2025-01-09
This file follows the AGENTS.md specification for standardizing AI agent interactions with repositories.
For Copilot-specific instructions, see .github/copilot-instructions.md.
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.

