extension-points
Guide for MSBuild extensibility: CustomBefore/CustomAfter hooks, wildcard imports with alphabetic ordering, import gating with control properties, NuGet package build extension layout (build/buildTransitive), and the MicrosoftCommonPropsHasBeenImported guard. USE FOR: diagnosing and fixing MSBuild import and hook patterns, reviewing and fixing extension point anti-patterns in Directory.Build files, fixing missing Exists() guards on imports that break fresh clones, fixing NuGet package hooks being silently dropped instead of appended, making build targets extensible for other projects, injectin
npx skills add dotnet/skills --skill extension-points --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# MSBuild Extension Points How the MSBuild pipeline provides hooks for SDKs, NuGet packages, repos, and users to inject custom logic. ## CustomBefore / CustomAfter Hooks Every major `.targets` file defines import hooks: ```xml <PropertyGroup> <CustomBeforeMicrosoftCommonTargets Condition="'$(CustomBeforeMicrosoftCommonTargets)' == ''"> $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.Microsoft.Common.targets </CustomBeforeMicrosoftCommonTargets> </PropertyGroup> <Import Project="$(CustomBeforeMicrosoftCommonTargets)" Condition="'$(CustomBeforeMicrosoftCommonTargets)' != '' and Exists('$(CustomBeforeMicrosoftCommonTargets)')"/> <!-- ... core targets ... --> <Import Project="$(CustomAfterMicrosoftCommonTargets)" Condition="'$(CustomAfterMicrosoftCommonTargets)' != '' and Exists('$(CustomAfterMicrosoftCommonTargets)')"/> ``` ### Rules - Default path includes version (`v$(MSBuildToolsVersion)`) for side-by-side installations. - Always check `Exists()`. The file may not be present on every machine. - **Append** to the property (don't overwrite) to chain multiple hooks: ```xml <PropertyGroup> <CustomBeforeMicrosoftCommonTargets> $(CustomBeforeMicrosoftCommonTargets);$(MSBui
- CustomBefore / CustomAfter Hooks
- Rules
- Wildcard Import Directories
- Key paths
- Import Gating — Control Properties
- Available control properties
- NuGet Package Build Extension Layout
- Forwarding chain: buildTransitive/ → build/ → shared
- Source Tree vs Packed Layout
- Implication for reviewers
- Import Guard Pattern
- Directory.Build Discovery
- Creating Your Own Extension Point
- Common Pitfalls
What does the extension-points skill do?
Guide for MSBuild extensibility: CustomBefore/CustomAfter hooks, wildcard imports with alphabetic ordering, import gating with control properties, NuGet package build extension layout (build/buildTransitive), and the MicrosoftCommonPropsHasBeenImported guard. USE FOR: diagnosing and fixing MSBuild import and hook patterns, reviewing and fixing extension point anti-patterns in Directory.Build files, fixing missing Exists() guards on imports that break fresh clones, fixing NuGet package hooks being silently dropped instead of appended, making build targets extensible for other projects, injectin
How do I install it?
Run `npx skills add dotnet/skills --skill extension-points --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
