agentleFS
Microsoft AzureKnown publisherAzure/typespec-rust/AGENTS.md

typespec-rust

AGENTS.md8 starsChanged 8 months agoMITView on GitHub

This repository contains the TypeSpec Rust emitter (@azure-tools/typespec-rust), a TypeScript-based code generator that produces Rust SDK client code from TypeSpec API specifications. It is a Microsoft open-source project. Always run commands from the packages/typespec-rust directory unless stated otherwise. The CI pipeline (Azure DevOps, defined in eng/pipelines/ci.yml) runs these checks on every PR: Always replicate these checks locally before opening a PR. The following skills are available under .github/skills/ and should be used for common workflows:

  • Installs packages

We split this AGENTS.md into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is 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.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always run commands from the packages/typespec-rust directory unless stated otherwise.

    line 16
  2. Distinctive:

    All files must end with a newline character.

    line 46
  3. Distinctive:

    Always replicate these checks locally before opening a PR.

    line 62
  4. Distinctive:

    Run all linting, build, and test steps before submitting (use the validate skill).

    line 76
  5. Distinctive:

    Keep PRs focused on a single change or feature.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md
<!-- cspell:words tcgcadapter MSRV -->

AGENTS.md

Project Summary

This repository contains the TypeSpec Rust emitter (@azure-tools/typespec-rust), a TypeScript-based code generator that produces Rust SDK client code from TypeSpec API specifications. It is a Microsoft open-source project.

Prerequisites

  • Node.js >= 20.0.0
  • pnpm (version specified in packageManager field of package.json; do not use npm or yarn)
  • Rust at the minimum supported Rust version (MSRV) with clippy and rustfmt components (components are configured in rust-toolchain.toml)

Setup

Always run commands from the packages/typespec-rust directory unless stated otherwise.

cd packages/typespec-rust
pnpm install
pnpm build
  • pnpm build compiles TypeScript to dist/.
  • pnpm watch runs the compiler in watch mode for iterative development.

Repository Layout

  • /packages/typespec-rust/ — Main TypeScript emitter package (the only package)
  • /packages/typespec-rust/src/ — TypeScript emitter source code
    • src/codegen/ — Rust code generation logic
    • src/codemodel/ — Internal code model representation
    • src/tcgcadapter/ — TypeSpec Client Generator Core adapter
    • src/emitter.ts — Emitter entry point
  • /packages/typespec-rust/test/ — Generated Rust test crates and TypeScript unit tests
    • test/spector/ — Integration test crates generated from spector specs
    • test/sdk/ — SDK test crates
    • test/other/ — Targeted test crates
    • test/tsp/ — TypeSpec files used to generate test/other and test/sdk content
  • /eng/pipelines/ — Azure DevOps CI/CD pipeline definitions
  • /.vscode/cspell.json — Spell checking configuration
  • /rust-toolchain.toml — Rust toolchain components (clippy, rustfmt)

Coding Standards

  • All files must end with a newline character.
  • The emitter automatically runs cargo fmt post-codegen if the Rust toolset is installed.
  • Spell checking from the repo root: cspell -c .vscode/cspell.json . must succeed before committing.

CI Pipeline

The CI pipeline (Azure DevOps, defined in eng/pipelines/ci.yml) runs these checks on every PR:

  1. Build TypeScript emitter
  2. ESLint on TypeScript code
  3. TypeScript unit tests with coverage
  4. Regenerate all test crates and verify no uncommitted changes
  5. Build all generated Rust crates
  6. Clippy on generated Rust code
  7. Spector integration tests

Always replicate these checks locally before opening a PR.

Skills

The following skills are available under .github/skills/ and should be used for common workflows:

  • build — Build the TypeSpec Rust emitter from source. Run after cloning, pulling changes, or modifying TypeScript source files.
  • test — Run TypeScript unit tests and Rust integration tests. Use to verify emitter correctness after code changes.
  • lint — Run all linting (ESLint, Clippy) and spell checking. Run before committing to catch issues early.
  • regenerate — Regenerate Rust test crates from TypeSpec specifications. Run after modifying emitter source or TypeSpec files under test/tsp/.
  • validate — Run the full CI validation workflow locally. Use as a final check before submitting a PR to ensure all pipeline steps will pass.

PR Guidelines

  • Run all linting, build, and test steps before submitting (use the validate skill).
  • Keep PRs focused on a single change or feature.
  • Regenerate test crates and commit the updated generated code if the emitter output changes (use the regenerate skill).

Download now (ZIP)

  • 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 28,693 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 repository5 other files it gives its agents.

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.