USE FOR
- "review Rust Azure SDK sample"
- "check Rust sample for best practices"
- "Azure SDK Rust code review"
- Reviewing credential handling in Azure SDK Rust samples
- Ownership patterns and async runtime review for Rust Azure SDK samples
- Error propagation and documentation compliance check for Rust Azure SDK samples
DO NOT USE FOR
- General Rust code review unrelated to Azure SDK samples
- Production application code review
- Azure service configuration
Context
Base template: Inherits from azure-sdk-sample-review for shared review patterns (credentials, error handling, documentation, infrastructure). This skill adds Rust-specific rules below.
Use this skill when reviewing Rust code samples for Azure SDKsintended for publication as Microsoft Azure samples. Focuses on Azure SDK-specific concerns: azure_* crates, DefaultAzureCredential, service-specific patterns, sample hygiene, documentation accuracy, infrastructure-as-code, azd integration, and Rust idioms (ownership, borrowing, error propagation, async runtimes, RAII cleanup).
âš ï¸ SDK Maturity Note: The Azure SDK for Rust is still evolving. Many crates are in preview/alpha. This skill focuses on stable patterns (auth, error handling, async, project structure). Always check crates.io and the Azure SDK for Rust GitHub repo for latest status.
Total rules: 66 (9 CRITICAL, 25 HIGH, 29 MEDIUM, 3 LOW)
Severity Legend
- CRITICAL: Security vulnerability or sample will not compile/run. Must fix before any publication.
- HIGH: Major quality issue that will confuse users or cause production failures. Fix before merge.
- MEDIUM: Best practice violation. Should fix before publication for maintainability.
- LOW: Polish item, nice-to-have improvement.
Quick Pre-Review Checklist (5-Minute Scan)
Blocker Issues (Auto-Reject)
These issues always block publication. Samples with any of these must be rejected immediately:
- Hardcoded secrets—Any production credentials, API keys, connection strings, or tokens in code
- Missing authentication—No auth implementation or uses insecure methods
- No error handling—Uses
unwrap() or expect() in main code paths, no Result returns
- Broken imports—Missing dependencies, incorrect crate names,
cargo check fails
- Security vulnerabilities—
cargo audit shows critical or high CVEs
- Missing LICENSE—No LICENSE file at ANY level of repo hierarchy (MIT required). âš ï¸ Check repo root before flagging.
- .env file committed—Live credentials in version control. âš ï¸ Verify with
git ls-files .env.
- Panics in sample code—Uses
unwrap(), expect(), or panic!() in non-test code paths without justification
Detailed Rules
Language-Specific References (Rust code examples)
| # |
Section |
Reference File |
| 1 |
Project Setup — Rust |
references/project-setup.md |
| 2 |
SDK Client Patterns — Rust |
references/sdk-client-patterns.md |
| 3 |
AI Services — Rust |
references/ai-services.md |
| 4 |
Data Services — Rust |
references/data-services.md |
| 5 |
Messaging — Rust |
references/messaging.md |
| 6 |
Key Vault — Rust |
references/keyvault.md |
| 7 |
Vector Search — Rust |
references/vector-search.md |
| 8 |
Error Handling — Rust |
references/error-handling.md |
| 9 |
Data Management — Rust |
references/data-management.md |
| 10 |
Sample Hygiene — Rust |
references/sample-hygiene.md |
| 11 |
Documentation — Rust |
references/documentation.md |
| 12 |
Infrastructure — Rust |
references/infrastructure.md |
| 13 |
azd — Rust |
references/azd.md |
| 14 |
Rust Idioms (Rust-unique) |
references/rust-idioms.md |
| — |
Comprehensive Checklist |
references/checklist.md |
Companion Skills
- azure-sdk-typescript-sample-review — TypeScript-specific Azure SDK patterns (template this skill was adapted from)
- azure-sdk-dotnet-sample-review — .NET 9/10 + Aspire Azure SDK patterns
- azure-sdk-python-sample-review — Python 3.9+ + async Azure SDK patterns
Summary
This skill enforces 66 rules for Azure SDK Rust sample quality covering: authentication (DefaultAzureCredential, managed identity, token refresh), Rust idioms (ownership, RAII, async/tokio, error propagation), data services (Cosmos DB, Azure SQL, Storage), AI services (OpenAI, embeddings), infrastructure (Bicep/AVM, azd), and documentation accuracy. Apply these patterns to ensure samples are secure, idiomatic, well-documented, and ready for publication.
References
References location: All reference files for this skill live inside the skill directory at .github/skills/data-plus-ai-sdk-rust-sample-review/. Paths like references/file.md resolve to .github/skills/data-plus-ai-sdk-rust-sample-review/references/file.md. Paths are relative to the skill folder, not the repo root.
1---2name: azure-sdk-rust-sample-review3description: Reviews Azure SDK Rust code samples for best practices, credential handling, ownership patterns, async runtime usage, error propagation, and documentation compliance. Trigger: "review Rust Azure SDK sample", "check Rust sample", "Azure SDK Rust review".4---56## USE FOR78- "review Rust Azure SDK sample"9- "check Rust sample for best practices"10- "Azure SDK Rust code review"11- Reviewing credential handling in Azure SDK Rust samples12- Ownership patterns and async runtime review for Rust Azure SDK samples13- Error propagation and documentation compliance check for Rust Azure SDK samples1415## DO NOT USE FOR1617- General Rust code review unrelated to Azure SDK samples18- Production application code review19- Azure service configuration2021## Context2223> **Base template:** Inherits from [azure-sdk-sample-review](../azure-sdk-sample-review/SKILL.md) for shared review patterns (credentials, error handling, documentation, infrastructure). This skill adds Rust-specific rules below.2425Use this skill when reviewing **Rust code samples** for Azure SDKsintended for publication as Microsoft Azure samples. Focuses on Azure SDK-specific concerns: `azure_*` crates, `DefaultAzureCredential`, service-specific patterns, sample hygiene, documentation accuracy, infrastructure-as-code, azd integration, and Rust idioms (ownership, borrowing, error propagation, async runtimes, RAII cleanup).2627> **âš ï¸ SDK Maturity Note:** The Azure SDK for Rust is still evolving. Many crates are in preview/alpha. This skill focuses on stable patterns (auth, error handling, async, project structure). Always check [crates.io](https://crates.io/search?q=azure_) and the [Azure SDK for Rust GitHub repo](https://github.com/Azure/azure-sdk-for-rust) for latest status.2829**Total rules: 66** (9 CRITICAL, 25 HIGH, 29 MEDIUM, 3 LOW)3031---3233## Severity Legend3435- **CRITICAL**: Security vulnerability or sample will not compile/run. Must fix before any publication.36- **HIGH**: Major quality issue that will confuse users or cause production failures. Fix before merge.37- **MEDIUM**: Best practice violation. Should fix before publication for maintainability.38- **LOW**: Polish item, nice-to-have improvement.3940---4142## Quick Pre-Review Checklist (5-Minute Scan)4344- [ ] **Cargo.toml**: Uses `azure_*` crates (not unofficial wrappers)45- [ ] **Authentication**: Uses `DefaultAzureCredential` (not connection strings or hardcoded keys)46- [ ] **.gitignore**: Exists and includes `.env`, `target/`47- [ ] **No secrets**: No hardcoded credentials, API keys, or tokens in code48- [ ] **README.md**: Exists with prerequisites, setup steps, and expected output49- [ ] **LICENSE**: MIT license file present (required for Azure Samples)50- [ ] **Security**: `cargo audit` passes with no critical/high vulnerabilities51- [ ] **Rust Edition**: `edition = "2021"` in Cargo.toml52- [ ] **Error handling**: Uses `Result<T, E>` and `?` operator (no `unwrap()` in main paths)53- [ ] **Resource cleanup**: Clients properly dropped (RAII pattern, no leaks)54- [ ] **Lock file**: Cargo.lock committed (for binary crates)55- [ ] **Clippy**: `cargo clippy` passes with no warnings56- [ ] **Imports work**: `cargo check` succeeds57- [ ] **Build succeeds**: `cargo build` completes without errors58- [ ] **Sample runs**: `cargo run` executes without panics5960---6162## Blocker Issues (Auto-Reject)6364These issues always block publication. Samples with any of these must be rejected immediately:65661. **Hardcoded secrets**—Any production credentials, API keys, connection strings, or tokens in code672. **Missing authentication**—No auth implementation or uses insecure methods683. **No error handling**—Uses `unwrap()` or `expect()` in main code paths, no `Result` returns694. **Broken imports**—Missing dependencies, incorrect crate names, `cargo check` fails705. **Security vulnerabilities**—`cargo audit` shows critical or high CVEs716. **Missing LICENSE**—No LICENSE file at ANY level of repo hierarchy (MIT required). âš ï¸ Check repo root before flagging.727. **.env file committed**—Live credentials in version control. âš ï¸ Verify with `git ls-files .env`.738. **Panics in sample code**—Uses `unwrap()`, `expect()`, or `panic!()` in non-test code paths without justification7475---7677## Detailed Rules787980### Language-Specific References (Rust code examples)8182| # | Section | Reference File |83|---|---------|---------------|84| 1 | Project Setup — Rust | [references/project-setup.md](references/project-setup.md) |85| 2 | SDK Client Patterns — Rust | [references/sdk-client-patterns.md](references/sdk-client-patterns.md) |86| 3 | AI Services — Rust | [references/ai-services.md](references/ai-services.md) |87| 4 | Data Services — Rust | [references/data-services.md](references/data-services.md) |88| 5 | Messaging — Rust | [references/messaging.md](references/messaging.md) |89| 6 | Key Vault — Rust | [references/keyvault.md](references/keyvault.md) |90| 7 | Vector Search — Rust | [references/vector-search.md](references/vector-search.md) |91| 8 | Error Handling — Rust | [references/error-handling.md](references/error-handling.md) |92| 9 | Data Management — Rust | [references/data-management.md](references/data-management.md) |93| 10 | Sample Hygiene — Rust | [references/sample-hygiene.md](references/sample-hygiene.md) |94| 11 | Documentation — Rust | [references/documentation.md](references/documentation.md) |95| 12 | Infrastructure — Rust | [references/infrastructure.md](references/infrastructure.md) |96| 13 | azd — Rust | [references/azd.md](references/azd.md) |97| 14 | Rust Idioms (Rust-unique) | [references/rust-idioms.md](references/rust-idioms.md) |98| — | Comprehensive Checklist | [references/checklist.md](references/checklist.md) |99100---101102## Companion Skills103104- **azure-sdk-typescript-sample-review** — TypeScript-specific Azure SDK patterns (template this skill was adapted from)105- **azure-sdk-dotnet-sample-review** — .NET 9/10 + Aspire Azure SDK patterns106- **azure-sdk-python-sample-review** — Python 3.9+ + async Azure SDK patterns107108---109110## Summary111112This skill enforces **66 rules** for Azure SDK Rust sample quality covering: authentication (DefaultAzureCredential, managed identity, token refresh), Rust idioms (ownership, RAII, async/tokio, error propagation), data services (Cosmos DB, Azure SQL, Storage), AI services (OpenAI, embeddings), infrastructure (Bicep/AVM, azd), and documentation accuracy. Apply these patterns to ensure samples are secure, idiomatic, well-documented, and ready for publication.113114## References115116> **References location:** All reference files for this skill live inside the skill directory at `.github/skills/data-plus-ai-sdk-rust-sample-review/`. Paths like `references/file.md` resolve to `.github/skills/data-plus-ai-sdk-rust-sample-review/references/file.md`. Paths are relative to the skill folder, not the repo root.117