extension-points

Diagnose and implement MSBuild import hooks, wildcard imports, and NuGet build extension layouts.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill extension-points-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extension-points
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/extension-points
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill extension-points-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? MSBuild builds break or silently skip custom logic when import hooks are misconfigured: missing Exists() guards fail fresh clones, overwritten CustomBefore/CustomAfter properties drop prior hooks, and NuGet package extensions are ignored when file names don't match the package ID. This Skill provides the patterns to diagnose and fix these extension point issues. ## Core Features & Use Cases - Import Hook Patterns: Explains CustomBefore/CustomAfter hooks, wildcard import directories with alphabetic ordering, and import gating via control properties like ImportDirectoryBuildProps. - NuGet Build Extensions: Covers build/ vs buildTransitive/ layouts, package ID file naming rules, and how .nuspec file mappings and PackagePath metadata reshape source trees at pack time. - Review Guidance: Helps reviewers avoid false positives when packed NuGet layouts legitimately differ from source trees, and shows how to create custom extension points with guard properties. - Use Case: A repo's Directory.Build.props works locally but fails on fresh clones because an optional import lacks an Exists() guard. Use this Skill to identify the anti-pattern and apply the correct guarded import pattern. ## Quick Start Review my Directory.Build.props and NuGet package build folder for MSBuild extension point anti-patterns and fix any missing Exists() guards or overwritten CustomBefore properties.

Frequently Asked Questions about extension-points

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

FAQPage Schema
How do I inject custom targets into the MSBuild pipeline?

Use CustomBefore/CustomAfter hook properties like CustomBeforeMicrosoftCommonTargets, appending your file path with a semicolon separator rather than overwriting. Always guard the import with an Exists() check so builds don't fail when the file is absent.

How do NuGet packages add build logic with build and buildTransitive folders?

NuGet imports .props and .targets files from a package's build/ folder for direct consumers, and from buildTransitive/ for the entire dependency chain. File names must exactly match the package ID or the import is silently skipped.

Why does my MSBuild import fail on a fresh clone but work locally?

The import likely lacks an Exists() guard on an optional file that isn't present on every machine. Add Condition="Exists('$(YourImportPath)')" so the build skips the import instead of failing when the file is missing.

Why is my NuGet package's .targets file not being imported?

The most common cause is the file name not matching the package ID exactly, which causes NuGet to silently skip the import. Also verify the file sits in build/ or buildTransitive/ inside the packed .nupkg, not just the source tree.

When should I not flag an unguarded import in a NuGet package?

Imports inside packed build/<tfm>/ or buildTransitive/<tfm>/ folders are a package contract guaranteed by the packed layout, so they don't need Exists() guards. Check .nuspec file mappings and PackagePath metadata before flagging them as missing-file bugs.

How do I disable Directory.Build.props auto-import in MSBuild?

Set the ImportDirectoryBuildProps control property to false to disable auto-discovery. Similar gates exist: ImportDirectoryBuildTargets, ImportProjectExtensionProps, ImportProjectExtensionTargets, and ImportByWildcardBefore/After properties.