agentleFS
Microsoft AzureKnown publisherAzure/azure-sdk-for-rust/.github/skills/create-crate/SKILL.md

create-crate

Skill887 starsChanged 29 days agoMITView on GitHub

Create a new Azure SDK crate from a TypeSpec specification.

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
  1. Distinctive:

    All new service crates must be generated from TypeSpec specifications in Azure/azure-rest-api-specs.

    line 8
  2. Distinctive:

    Use the repository-pinned CLI.

    line 11
  3. Very specific:

    Run commands with npm exec --prefix "$_TspClientDir" --no -- tsp-client

    line 18
  4. Very specific:

    Look for a tspconfig.yaml under specification/{service}/ in azure-rest-api-specs

    line 22
  5. Very specific:

    Check the tspconfig.yaml for @azure-tools/typespec-rust emitter configuration

    line 23
  6. Distinctive:

    If no emitter configuration exists, stop and report an error indicating that the TypeSpec specification in Azure/azure-rest-api-specs must …

    line 24
  7. Distinctive:

    Always use a specific commit SHA in the URL — never a branch or tag, which can move

    line 29
  8. Very specific:

    Use the azsdk_package_generate_code MCP tool, or

    line 33
  9. Very specific:

    Create clients.rs (or similar) for custom client constructors, authentication setup, and convenience methods

    line 37
  10. Very specific:

    Add the new crate to the workspace members list in the root Cargo.toml

    line 41
  11. Very specific:

    Write unit tests and integration tests (using #[recorded::test])

    line 44
  12. Very specific:

    Add examples, a README.md, and a CHANGELOG.md

    line 45

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

  1. 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.md for prerequisites and more context
  2. Find the TypeSpec spec
    • Look for a tspconfig.yaml under specification/{service}/ in azure-rest-api-specs
    • Check the tspconfig.yaml for @azure-tools/typespec-rust emitter 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
  3. 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 the tspconfig.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
  4. Generate the client
    • Use the azsdk_package_generate_code MCP tool, or
    • From the crate directory, run npm exec --prefix "$_TspClientDir" --no -- tsp-client update
  5. 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/
  6. Register the crate
    • Add the new crate to the workspace members list in the root Cargo.toml
  7. Add tests, examples, and documentation
    • Write unit tests and integration tests (using #[recorded::test])
    • Add examples, a README.md, and a CHANGELOG.md

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.