azure-sdk-for-rust / core
AGENTS.md887 starsChanged 29 days agoMITView on GitHub
These rules apply in addition to the repository root AGENTS.md.
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,774 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 repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- eng/tools/generate_api/AGENTS.mdAGENTS.md
- samples/AGENTS.mdAGENTS.md
- sdk/cosmos/AGENTS.mdAGENTS.md
- sdk/cosmos/azure_data_cosmos_emulator/AGENTS.mdAGENTS.md
- sdk/cosmos/docs/AGENTS.mdAGENTS.md
- agentic-workflowsSkill
- analyze-codeSkill
- check-spellingSkill
- create-crateSkill
- create-hotfixSkill
- create-perf-testSkill
- create-recorded-testSkill
- document-cratesSkill
- export-apiSkill
- lint-markdownSkill
- prepare-releaseSkill
- review-doc-commentsSkill
- update-emitterSkill
- update-rustSkill
- cosmos-design-structSkill
- cosmos-pre-commit-validationSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 4 are distinctive, and 11 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.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Treat sdk/core as an ordered stack: typespec -> typespec_client_core -> azure_core.
- Very specific: line 20
If a higher crate is bumped only because of a propagated dependency change, its CHANGELOG.md should still mention that dependency-driven …
- Very specific: line 24
Keep versions for sdk/core dependencies managed from the root workspace Cargo.toml.
- Very specific: line 25
Prefer workspace = true in sdk/core crate manifests when inheriting workspace-managed dependencies.
- Very specific: line 26
When evaluating a release, focus on normal [dependencies] that affect the published crate.
- Distinctive: line 28
Keep crates in next-release state in their own manifests.
- Distinctive: line 35
When changing one side of a test/example graph to local source, check all directly exchanged public types in that graph and keep them on …
- Distinctive: line 40
Keep stubbed example APIs small and shaped like the public APIs they stand in for, but do not add real behavior unless tests need it.
- Very specific: line 43
If a compile-only test needs just one or two service types and would otherwise mix published and local azure_core graphs, prefer a tiny …
- Distinctive: line 47
Use "Resource Manager", not "ARM", in public documentation.
- Very specific: line 48
Put Resource Manager (ARM)-specific functionality in existing azure_core modules where appropriate.
- Very specific: line 49
Use resource_manager in module, field, function, and method names.
- Very specific: line 50
When names collide, prefer a resource_manager submodule gated by the unstable_resource_manager feature, such as …
- Very specific: line 52
Import azure_core::cloud::resource_manager::CloudConfigurationExt as _ in generated and hand-written ARM constructors to call endpoint(), …
- Very specific: line 54
Read the caller's CloudConfiguration from client options in Resource Manager constructors.
≈ “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
Core SDK Instructions
These rules apply in addition to the repository root AGENTS.md.
Semver Propagation
- Treat
sdk/coreas an ordered stack:typespec -> typespec_client_core -> azure_core. typespec_client_corere-exports public APIs fromtypespec;azure_corere-exports public APIstypespec_client_corewith few exceptions.- A semver-relevant change in a lower crate requires at least the same bump in each higher crate.
- A lower crate may force a higher bump, but a higher crate can still require a larger bump because of its own public API changes.
- A new public feature in
typespecrequiring1.0.x -> 1.1.0meanstypespec_client_coreandazure_coremust be at least1.1.0. - A new public feature in
typespec_client_corerequiring1.0.x -> 1.1.0meansazure_coremust be at least1.1.0. - A breaking change in
typespecrequiring2.0.0meanstypespec_client_coreandazure_coremust be at least2.0.0.
Changelog Propagation
- Reflect
typespecchangelog changes intypespec_client_corewhen they affect its shipped dependency surface or release decision. - Reflect
typespec_client_corechangelog changes inazure_corewhen they affect its shipped dependency surface or release decision. - If a higher crate is bumped only because of a propagated dependency change, its
CHANGELOG.mdshould still mention that dependency-driven update.
Dependencies and Versioning
- Keep versions for
sdk/coredependencies managed from the root workspaceCargo.toml. - Prefer
workspace = trueinsdk/corecrate manifests when inheriting workspace-managed dependencies. - When evaluating a release, focus on normal
[dependencies]that affect the published crate. Dev-only test/example/doc wiring may remain local unless the same manifest also names that package in normal dependencies. - For unreleased local
sdk/coredependencies, use the workspace table for the neededpath + versionentry. - Keep crates in next-release state in their own manifests; manage cross-crate version wiring from the workspace table.
Published vs. unpublished graphs
- Mixing published and local versions of
typespec,typespec_client_core,azure_core, or crates that expose their types can create duplicate-type failures. - Cargo also requires a single canonical source for a package within one manifest. If a crate appears in both normal and dev dependencies, do not mix a published source in one entry with a local path in the other.
- Common breakage looks like mismatched
ClientOptions,TokenCredential, or trait implementations that appear identical but come from different crate instances. - When changing one side of a test/example graph to local source, check all directly exchanged public types in that graph and keep them on the same crate instance.
Example and documentation stub crates
azure_core_examplesis a non-published helper crate for compile-only examples and docs. It intentionally depends on localsdk/core/azure_coreby path.- Keep stubbed example APIs small and shaped like the public APIs they stand in for, but do not add real behavior unless tests need it.
- Organize identity stubs in
azure_core_examples::identityper credential module, mirroringazure_identitywhere practical, and re-export them fromidentity/mod.rs. - For markdown compile tests, alias helper modules to the public crate names used in docs (for example
use azure_core_examples::identity as azure_identity;). - If a compile-only test needs just one or two service types and would otherwise mix published and local
azure_coregraphs, prefer a tiny local stub in that test module over broad dependency rewiring.
Resource Manager
- Use "Resource Manager", not "ARM", in public documentation. "ARM" is acceptable in code.
- Put Resource Manager (ARM)-specific functionality in existing
azure_coremodules where appropriate. - Use
resource_managerin module, field, function, and method names; useunstable_resource_managerfor the Cargo feature and retainazure_resourcemanager_*crate names. - When names collide, prefer a
resource_managersubmodule gated by theunstable_resource_managerfeature, such asazure_core::http::poller::resource_manager, overResourceManagertype or variant prefixes; do not re-export its items from parent modules. - Enable
azure_core'sunstable_resource_managerfeature and useazure_core::cloud::resource_manager::Audiencefor custom audience registration in all ARM crates; do not define crate-specific ARM audience markers. - Import
azure_core::cloud::resource_manager::CloudConfigurationExt as _in generated and hand-written ARM constructors to callendpoint(),audience(), anddefault_scope()without audience type parameters. Caller examples configuringCloudConfigurationandCustomConfigurationdo not need this trait. - Keep each ARM crate's first README client-configuration example as the normal case. Add a second example configuring and using a custom cloud: set
CustomConfiguration::authority_hostandendpoint, register the ARM audience inAudienceswith the shared marker, and use that cloud to configure the credential and client. - Read the caller's
CloudConfigurationfrom client options in Resource Manager constructors; useunwrap_or_default()when omitted. - Resolve built-in service endpoints and authentication audiences in the library; honor supplied custom-cloud values.
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.

