Pre-commit validation checks for azure-sdk-for-net. Use this before committing or pushing changes to SDK packages. Runs dotnet format, exports public API listings, updates snippets, and regenerates code as needed.
npx skills add https://github.com/Azure/azure-sdk-for-net --skill pre-commit-checks
Run these checks after making changes to SDK packages under sdk/ and before staging, committing, or pushing. These steps may produce additional file changes that must be included in the commit.
> General rule: Steps 3–5 are conditional to save time, but if you are unsure whether a step is needed, always run it. It is better to run an unnecessary script than to miss a required regeneration.
git status --porcelain (or by combining git diff --name-only HEAD with git ls-files -o --exclude-standard) so that untracked (new) files are included.sdk/ (e.g., sdk/storage/... → storage, sdk/ai/... → ai).sdk/{ServiceDirectory}/{PackageName}/ paths.sdk/{service}/{package}/src/{Package}.csproj — this is used for GenerateCode.dotnet format (for every changed csproj)For every csproj that had files change beneath it — src, tests, samples, perf, stress, or any other project type — run:
dotnet format <path-to-changed.csproj>
Identify affected csproj files by looking at the full changed file list: include any project where either (a) there is a changed .cs file with that .csproj as its nearest parent, or (b) the .csproj itself changed, or files such as .props, .targets, or .md changed under that project. This fixes style/formatting issues and may modify .cs files.
dotnet build /t:GenerateCode (per src csproj)Exclusion: Skip this step entirely for the provisioning service directory. Provisioning libraries use their own generator and are not generated via TypeSpec/AutoRest.
Trigger condition — for each affected package's src csproj: Run this if ANY of the following files are in the changed file list:
sdk/{service}/{package}/src/Generated/**sdk/{service}/{package}/tsp-location.yamlsdk/{service}/{package}/src/autorest.md.cs file under sdk/{service}/{package}/src/ where a CodeGen* attribute was added, removed, or modified (e.g., CodeGenType, CodeGenModel, CodeGenClient, CodeGenMember, CodeGenSuppress, CodeGenSerialization, CodeGenVisibility). These attributes in custom (non-generated) code influence the generated output.Important: Do not manually edit files under src/Generated/. Changes to generated code should only come from running the GenerateCode target.
Command:
dotnet build sdk/{service}/{package}/src/{Package}.csproj /t:GenerateCode
This regenerates code from TypeSpec/AutoRest specs. It may modify files under src/Generated/.
Export-API.ps1 (per ServiceDirectory)Trigger condition — per ServiceDirectory: Run this if ANY of the following are true for ANY affected package within this ServiceDirectory:
.cs files under sdk/{service}/{package}/src/ for any package in this ServiceDirectory contain public API surface changes. To determine this, inspect the diffs for:public or protected types (class, interface, struct, enum, record).public or protected members (methods, properties, constructors, events, fields).internal → public)..cs files under src/ that contain public types.Skip Export-API if changes are limited to:
internal or private members only..csproj configuration changes.Command:
eng\scripts\Export-API.ps1 {ServiceDirectory}
This regenerates API listing files under sdk/{service}/{package}/api/*.cs. Uses dotnet build /t:ExportApi internally.
Note: Export-API operates at the ServiceDirectory level (not per-csproj), so run it once per affected ServiceDirectory.
Update-Snippets.ps1 (per ServiceDirectory)Trigger condition — for each affected ServiceDirectory: Run this if ANY of the following are true:
*.md files under sdk/{service}/ contain snippet references ( C# Snippet: ` markers)..cs files contain snippet regions (#region Snippet:).Command:
eng\scripts\Update-Snippets.ps1 {ServiceDirectory}
Note: Update-Snippets operates at the ServiceDirectory level (not per-csproj), so run it once per affected ServiceDirectory.
This runs snippet-generator to sync code snippets into markdown files. May modify *.md and *.cs files.
git status.Run the following steps in this order, respecting their scope (per package vs per ServiceDirectory):
dotnet format first — run on all changed csproj files (src, tests, etc.) for each affected package.GenerateCode second — per src csproj, regenerates from specs (may override format changes in Generated/) for each affected package.Export-API third — run once per affected ServiceDirectory, after all GenerateCode runs for packages in that ServiceDirectory are complete; captures the final public API surface after generation.Update-Snippets fourth — run once per affected ServiceDirectory, after Export-API; captures any snippet changes from all prior steps.When multiple packages/ServiceDirectories are affected, run steps 1–2 for each affected package, then steps 3–4 once per affected ServiceDirectory. Step 6 (verify) runs once at the end.
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Take azure/pre-commit-checks from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.