cosmos-pre-commit-validation

cosmos-pre-commit-validation is a skill for Claude Code, Codex from Azure/azure-sdk-for-rust. It costs 35 tokens per session (1,194 once invoked), scanned A, original, MIT.

A focused set of pre-commit checks for Rust files in the Azure Cosmos SDK. Pre-commit checks catch problems before code is committed or reviewed.

In plain words
What is it for?
Use it to validate all Cosmos SDK changes or a specific crate, scanning either changed Rust files or every Rust file in scope.
Why use it?
It limits validation to the relevant changed files or selected crate, while avoiding generated files that external tools produce.

Skill for Claude CodeCodex

About the project

Azure SDK for Rust is a collection of Rust libraries, organized as separate crates, for interacting with Azure services. Rust developers use the crates and examples to build applications that work with Azure. The catalogue entries provide coding-agent skills, instructions, agents, and MCP integrations for working with the SDK.

Azure/azure-sdk-for-rust · 885 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/azure/azure-sdk-for-rust/cosmos-pre-commit-validation
Any agent
npx skills add Azure/azure-sdk-for-rust --skill cosmos-pre-commit-validation
Clone the repo
git clone --depth 1 https://github.com/Azure/azure-sdk-for-rust

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cosmos-pre-commit-validation

README.md
[![agentmods](https://agentmods.dev/badge/skills/azure/azure-sdk-for-rust/cosmos-pre-commit-validation.svg)](https://agentmods.dev/skills/azure/azure-sdk-for-rust/cosmos-pre-commit-validation)
Your own site
<a href="https://agentmods.dev/skills/azure/azure-sdk-for-rust/cosmos-pre-commit-validation"><img src="https://agentmods.dev/badge/skills/azure/azure-sdk-for-rust/cosmos-pre-commit-validation.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,194 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00035 $0.01194
Opus 5 $0.00017 $0.00597
Sonnet 5 $0.00007 $0.00239
Haiku 4.5 $0.00003 $0.00119

Measured 5d ago against content hash 6882a7ad5ed0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cosmos-pre-commit-validation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sdk/cosmos/.github/skills/cosmos-pre-commit-validation/SKILL.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cosmos SDK Pre-Commit Checks

When to use this skill

Use this skill when:

  • Reviewing or validating changes in the Cosmos SDK
  • Running pre-commit checks locally before pushing
  • Performing focused code review on sdk/cosmos/**

Behavior

Follow these steps strictly:

  1. Determine the target path:

    • If the scope argument is specified and is not equal (case-insensitive) to all or *, set the target path to sdk/cosmos/<scope> (for example, if scope is azure_data_cosmos, use sdk/cosmos/azure_data_cosmos as the target path).
    • Otherwise, set the target path to sdk/cosmos.
  2. Determine file scope:

    • If changed-only is true (the default), restrict scanning to .rs files that differ between the current local branch and main. Use git diff --name-only main -- <target path> (and include per-crate tests/ directories) to obtain the list. Only .rs files in the result set are scanned; all other files are skipped.
    • If changed-only is false, scan all .rs files under the target path(s).
    • In both modes, skip files in generated/ subdirectories — these are produced by external tools and must never be modified.
  3. Validate using the Pre-Completion Validation Checklist in sdk/cosmos/AGENTS.md:

    • Formatting checks
    • Build succeeds for affected crates
    • Clippy lints pass for affected crates, with warnings treated as errors (-D warnings) to match CI behavior. Run clippy with RUSTFLAGS=-D warnings set:
      • Bash: RUSTFLAGS='-D warnings' cargo clippy -p <crate> --all-features --all-targets
      • PowerShell: $env:RUSTFLAGS='-D warnings'; cargo clippy -p <crate> --all-features --all-targets; $env:RUSTFLAGS=$null
    • Re-run formatting after any auto-fix: if auto-fix is true and clippy or other tools modified files, re-run cargo fmt to ensure the auto-fixed code is properly formatted (e.g., cargo clippy --fix can leave trailing blank lines when removing unused imports).
    • Documentation builds successfully where applicable
    • Spell check (cspell): CI runs cspell on all changed files using the root config at .vscode/cspell.json; Cosmos-specific words are managed in ignoreWords in sdk/cosmos/.cspell.json. Run locally with: npx cspell lint --config sdk/cosmos/.cspell.json --no-must-find-files <target path>/** If auto-fix is true and unknown words are legitimate (e.g., API type names, technical terms), add them to ignoreWords in sdk/cosmos/.cspell.json.
    • Unit and emulator tests relevant to the touched modules and crates
    • CI-gated tests: Tests gated by test_category (e.g., emulator, multi-write) are always compiled but are ignored at runtime unless the corresponding cfg is set via RUSTFLAGS. This means cargo check --tests and cargo test will compile these tests without any special flags, so build errors are caught locally. RUSTFLAGS is only needed when you want to actually run the tests:
      • RUSTFLAGS='--cfg test_category="emulator"' cargo test -p azure_data_cosmos --features fault_injection,key_auth --tests
      • RUSTFLAGS='--cfg test_category="multi_write"' cargo test -p azure_data_cosmos --features fault_injection,key_auth --tests On Windows (PowerShell), set the env var first: $env:RUSTFLAGS='--cfg test_category="emulator"' then run the cargo test command, and clear it afterwards with $env:RUSTFLAGS=$null. These tests require a live Cosmos DB emulator or multi-region account to run. If scope targets a specific crate other than azure_data_cosmos, skip these checks.

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 96 lines · 35 tokens per session scan A 6882a7ad5ed0

Subscribe to this mod's changes

cosmos-pre-commit-validation is a skill published in the GitHub repository Azure/azure-sdk-for-rust (885 stars, last pushed today), licensed MIT. It adds 35 tokens to every session and 1,194 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

dpg-migration

Migration logic for Azure SDK for .NET data-plane libraries migrating from AutoRest/Swagger to TypeSpec-based generation. Uses MCP tools from the generator-agent server for automated deterministic fixes.

Azure/azure-sdk-for-net · 41 tokens

csharp-azure-spector-coverage-gaps

Discovers and implements gaps in Spector test coverage for the Azure C# HTTP client emitter. Use when asked to find missing Spector scenarios, add Spector test coverage, or implement a specific Spector spec for the Azure C# emitter. Can also compare coverage between the Azure dashboard and the Standard (TypeSpec core)…

Azure/azure-sdk-for-net · 78 tokens

auto-build-repair

Headless, bounded repair of custom-code build failures in an already-generated Azure SDK PR. Thin wrapper over the shared azure-sdk-mcp:azsdkcustomizedcodeupdate engine in custom-code-only scope (editScope: CustomCode); the skill owns the iterate-until-green loop, capped by a per-language maxIterations read from…

Azure/azure-sdk-for-net · 149 tokens

azure-sdk-mgmt-pr-review

Review Azure SDK management-plane pull requests, check naming conventions, API compatibility, and code quality.

Azure/azure-sdk-for-net · 26 tokens

mgmt-review-comment-resolution

Resolve review comments on Azure management-plane .NET SDK PRs. Handles renaming types/properties, changing property types, and other API surface adjustments by updating TypeSpec client.tsp and regenerating.

Azure/azure-sdk-for-net · 46 tokens

mitigate-breaking-changes

Patterns and techniques for mitigating breaking changes in Azure management-plane SDKs. Covers SDK-side customizations (partial classes, CodeGenType, CodeGenSuppress) and TypeSpec decorator customizations (clientName, access, markAsPageable, alternateType, hierarchyBuilding).

Azure/azure-sdk-for-net · 60 tokens