create-crate
Skill887 starsChanged 29 days agoMITView on GitHub
Create a new Azure SDK crate from a TypeSpec specification.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- eng/tools/generate_api/AGENTS.mdAGENTS.md
- samples/AGENTS.mdAGENTS.md
- sdk/core/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-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
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 4 are distinctive, and 8 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.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
All new service crates must be generated from TypeSpec specifications in Azure/azure-rest-api-specs.
- Distinctive: line 11
Use the repository-pinned CLI.
- Very specific: line 18
Run commands with npm exec --prefix "$_TspClientDir" --no -- tsp-client
- Very specific: line 22
Look for a tspconfig.yaml under specification/{service}/ in azure-rest-api-specs
- Very specific: line 23
Check the tspconfig.yaml for @azure-tools/typespec-rust emitter configuration
- Distinctive: line 24
If no emitter configuration exists, stop and report an error indicating that the TypeSpec specification in Azure/azure-rest-api-specs must …
- Distinctive: line 29
Always use a specific commit SHA in the URL — never a branch or tag, which can move
- Very specific: line 33
Use the azsdk_package_generate_code MCP tool, or
- Very specific: line 37
Create clients.rs (or similar) for custom client constructors, authentication setup, and convenience methods
- Very specific: line 41
Add the new crate to the workspace members list in the root Cargo.toml
- Very specific: line 44
Write unit tests and integration tests (using #[recorded::test])
- Very specific: line 45
Add examples, a README.md, and a CHANGELOG.md
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Creating a New Crate
All new service crates must be generated from TypeSpec specifications in Azure/azure-rest-api-specs. Do not hand-write client libraries from scratch.
- Install tsp-client
Use the repository-pinned CLI; do not invoke a globally installed binary:
_TspClientDir="$(pwd)/eng/common/tsp-client" npm ci --prefix "$_TspClientDir"- Run commands with
npm exec --prefix "$_TspClientDir" --no -- tsp-client - See
eng/common/tsp-client/README.mdfor prerequisites and more context
- Find the TypeSpec spec
- Look for a
tspconfig.yamlunderspecification/{service}/in azure-rest-api-specs - Check the
tspconfig.yamlfor@azure-tools/typespec-rustemitter configuration - If no emitter configuration exists, stop and report an error indicating that the TypeSpec specification in Azure/azure-rest-api-specs must be updated before generating the client
- Look for a
- Initialize the crate
- From the repository root, run
npm exec --prefix "$_TspClientDir" --no -- tsp-client init --tsp-config {url} {url}is the GitHub URL to thetspconfig.yaml- Always use a specific commit SHA in the URL — never a branch or tag, which can move
- Example:
https://github.com/Azure/azure-rest-api-specs/blob/{commit-sha}/specification/{service}/{rp}/tspconfig.yaml
- From the repository root, run
- Generate the client
- Use the
azsdk_package_generate_codeMCP tool, or - From the crate directory, run
npm exec --prefix "$_TspClientDir" --no -- tsp-client update
- Use the
- Add hand-written wrappers
- Create
clients.rs(or similar) for custom client constructors, authentication setup, and convenience methods - Build on top of the generated code in
src/generated/
- Create
- Register the crate
- Add the new crate to the workspace
memberslist in the rootCargo.toml
- Add the new crate to the workspace
- Add tests, examples, and documentation
- Write unit tests and integration tests (using
#[recorded::test]) - Add examples, a
README.md, and aCHANGELOG.md
- Write unit tests and integration tests (using
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.

