extension-points

Diagnose and fix MSBuild import and hook patterns in build files.

Updated May 28, 2026
One-click install
npx skills add https://github.com/ojrojas/AgentsInstructions --skill extension-points
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extension-points
Source: https://github.com/ojrojas/AgentsInstructions/tree/main/.claude/skills/dotnet-msbuild/skills/extension-points
Command: npx skills add https://github.com/ojrojas/AgentsInstructions --skill extension-points

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps diagnose and fix MSBuild import and hook patterns, review and fix extension point anti-patterns, and make builds extensible for other projects.

Core Features & Use Cases

  • CustomBefore/CustomAfter Hooks: Learn about hooks for SDKs, NuGet packages, repos, and users to inject custom logic.
  • Wildcard Import Directories: Understand wildcard import directories and how they are sorted alphabetically.
  • Import Gating: Discover control properties that gate wildcard imports.
  • NuGet Package Build Extension Layout: Learn about the layout of NuGet package build extensions.
  • Source Tree vs Packed Layout: Distinguish between source and packed layouts in NuGet packages.
  • Import Guard Pattern: Understand the import guard pattern in .targets files.
  • Directory.Build Discovery: Learn about MSBuild's directory tree search for Directory.Build.props.
  • Creating Your Own Extension Point: Follow a guide to create custom extension points.
  • Common Pitfalls: Avoid common pitfalls like missing Exists() guards and overwriting properties.

Quick Start

Use the extension-points skill to review the MSBuild import patterns in your Directory.Build files and identify potential anti-patterns.

Frequently Asked Questions about extension-points

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use MSBuild custom hooks to inject build logic?

MSBuild custom hooks use CustomBefore and CustomAfter targets to inject build logic for SDKs, NuGet packages, repos, and users. This extends the build process without modifying core project files directly.

How does MSBuild Directory.Build discovery work?

MSBuild Directory.Build discovery searches up the directory tree from your project file to find Directory.Build.props. This mechanism centralizes build configuration and extension properties across multiple projects in a repository.

What are common MSBuild import anti-patterns and how do I fix them?

Common MSBuild import anti-patterns include missing Exists() guards on file imports and overwriting properties unintentionally. Fix these by implementing proper import gating and using the import guard pattern in your .targets files.

How do I create custom MSBuild extension points for NuGet packages?

Creating custom MSBuild extension points for NuGet packages requires designing the build extension layout and distinguishing between source tree and packed layouts. This makes builds extensible for other consuming projects.

How are wildcard import directories sorted in MSBuild?

Wildcard import directories in MSBuild are sorted alphabetically. Understanding this sorting behavior is crucial for controlling the order of imported files and ensuring correct build property precedence.

What are control properties for gating wildcard imports in MSBuild?

Import gating in MSBuild uses specific control properties to conditionally enable or disable wildcard imports. This prevents unexpected build extensions from loading and manages cross-project build dependencies.