[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699E2S5MTRRGW5E7GQ3HZ6F":3,"skill-same:01M699E2S5MTRRGW5E7GQ3HZ6F":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":17,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M699E2S5MTRRGW5E7GQ3HZ6F","extension-points","MSBuild 扩展点追踪","Trace MSBuild hook\u002Fimport discovery and NuGet packed assets; not a single Import\u002FExists safety verdict, props\u002Ftargets placement or target incrementality.","追踪 MSBuild 钩子\u002F导入发现机制及 NuGet 打包资源；不用于单个 Import\u002FExists 安全判定、props\u002Ftargets 放置位置或目标增量构建判定。","microsoft\u002Ftestfx","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M699C71CJ91B5WZ3AXG3GG2M",1059,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fextension-points\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44],"extension points","extension","msbuild","nuget","Safety","discovery","trace","assets","verdict","import","targets","hook","single","incrementality","2026-11-10 10:12:30",false,"---\nname: extension-points\ndescription: \"Trace MSBuild hook\u002Fimport discovery and NuGet packed assets; not a single Import\u002FExists safety verdict, props\u002Ftargets placement or target incrementality.\"\nlicense: MIT\n---\n\n# MSBuild Extension Points\n\n## Scope and routing\n\nOwn MSBuild import and hook discovery. USE FOR: CustomBefore\u002FCustomAfter hooks, ordered wildcard and NuGet auto-imports, control properties, build\u002FbuildTransitive packed layout, package ID and file-name matching, per-TFM forwarders, and tracing why assets or hooks are missing, broken, or replaced. An import guard remains in scope when it is one defect in a broader hook\u002Fimport flow. DO NOT USE for a focused safety verdict on whether one specific Import needs Exists or is an intentionally unguarded package contract; use msbuild-antipatterns. NEVER INVOKE when imports and hook placement already work and the request is only target Inputs\u002FOutputs, incremental skipping, or FileWrites clean tracking; use incremental-build or target-authoring. Exclude props-versus-targets placement and non-MSBuild systems.\n\nHow the MSBuild pipeline provides hooks for SDKs, NuGet packages, repos, and users to inject custom logic.\n\n## CustomBefore \u002F CustomAfter Hooks\n\nEvery major `.targets` file defines import hooks:\n\n```xml\n\u003CPropertyGroup>\n  \u003CCustomBeforeMicrosoftCommonTargets Condition=\"'$(CustomBeforeMicrosoftCommonTargets)' == ''\">\n    $(MSBuildExtensionsPath)\\v$(MSBuildToolsVersion)\\Custom.Before.Microsoft.Common.targets\n  \u003C\u002FCustomBeforeMicrosoftCommonTargets>\n\u003C\u002FPropertyGroup>\n\n\u003CImport Project=\"$(CustomBeforeMicrosoftCommonTargets)\"\n    Condition=\"'$(CustomBeforeMicrosoftCommonTargets)' != '' and Exists('$(CustomBeforeMicrosoftCommonTargets)')\"\u002F>\n\u003C!-- ... core targets ... -->\n\u003CImport Project=\"$(CustomAfterMicrosoftCommonTargets)\"\n    Condition=\"'$(CustomAfterMicrosoftCommonTargets)' != '' and Exists('$(CustomAfterMicrosoftCommonTargets)')\"\u002F>\n```\n\n### Rules\n\n- Default path includes version (`v$(MSBuildToolsVersion)`) for side-by-side installations.\n- Always check `Exists()`. The file may not be present on every machine.\n- **Append** to the property (don't overwrite) to chain multiple hooks:\n\n```xml\n\u003CPropertyGroup>\n  \u003CCustomBeforeMicrosoftCommonTargets>\n    $(CustomBeforeMicrosoftCommonTargets);$(MSBuildThisFileDirectory)MyExtension.targets\n  \u003C\u002FCustomBeforeMicrosoftCommonTargets>\n\u003C\u002FPropertyGroup>\n```\n\n## Wildcard Import Directories\n\nMSBuild imports all files in extension directories, sorted alphabetically:\n\n```xml\n\u003CImport Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Imports\\Microsoft.Common.props\\ImportBefore\\*\"\n    Condition=\"'$(ImportByWildcardBeforeMicrosoftCommonProps)' == 'true'\n               and Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Imports\\Microsoft.Common.props\\ImportBefore')\" \u002F>\n```\n\n### Key paths\n\n| Property | Resolves to | Scope |\n|---|---|---|\n| `$(MSBuildUserExtensionsPath)` | `%APPDATA%\\Microsoft\\MSBuild` | Per-user |\n| `$(MSBuildExtensionsPath)` | MSBuild install directory | Machine-wide |\n| `$(MSBuildProjectExtensionsPath)` | `obj\u002F` directory | Per-project (NuGet) |\n\nName files with numeric prefixes for ordering: `01-first.props`, `02-second.props`.\n\n## Import Gating — Control Properties\n\nEvery wildcard import is gated by a boolean property:\n\n```xml\n\u003CPropertyGroup>\n  \u003CImportByWildcardBeforeMicrosoftCommonProps\n      Condition=\"'$(ImportByWildcardBeforeMicrosoftCommonProps)' == ''\">true\u003C\u002FImportByWildcardBeforeMicrosoftCommonProps>\n  \u003CImportDirectoryBuildProps\n      Condition=\"'$(ImportDirectoryBuildProps)' == ''\">true\u003C\u002FImportDirectoryBuildProps>\n\u003C\u002FPropertyGroup>\n```\n\n### Available control properties\n\n| Property | What it disables |\n|---|---|\n| `ImportDirectoryBuildProps` | Directory.Build.props auto-discovery |\n| `ImportDirectoryBuildTargets` | Directory.Build.targets auto-discovery |\n| `ImportProjectExtensionProps` | NuGet-generated `*.props` in obj\u002F |\n| `ImportProjectExtensionTargets` | NuGet-generated `*.targets` in obj\u002F |\n| `ImportByWildcardBefore*` | Machine-level ImportBefore extensions |\n| `ImportByWildcardAfter*` | Machine-level ImportAfter extensions |\n\n## NuGet Package Build Extension Layout\n\nNuGet packages inject build logic via `build\u002F` or `buildTransitive\u002F` folders:\n\n```text\nMyPackage\u002F\n  build\u002F\n    MyPackage.props      ← imported via *.props wildcard\n    MyPackage.targets    ← imported via *.targets wildcard\n  buildTransitive\u002F\n    MyPackage.props      ← imported by transitive consumers\n    MyPackage.targets\n```\n\n### Rules\n\n- File names **must match the package ID** exactly.\n- `build\u002F` affects direct consumers only. `buildTransitive\u002F` affects the entire dependency chain.\n- Props are imported early (before the project), targets are imported late (after the project).\n\n### Forwarding chain: `buildTransitive\u002F` → `build\u002F` → shared\n\nForward `buildTransitive\u002F*.props` and `buildTransitive\u002F*.targets` through their sibling `build\u002F*.props` \u002F `build\u002F*.targets` files (chain `buildTransitive → build → shared`) instead of importing `buildMultiTargeting\u002F` directly. This keeps `build\u002F` as the single source of truth with a clear ownership chain, so transitive consumers stay in sync with direct consumers instead of the two layouts drifting apart.\n\nWhen `build\u002F` is packed **per-TFM** (`build\u002F\u003Ctfm>\u002F`, via `TfmSpecificPackageFile`, a per-TFM `\u003CPackagePath>`, or SDK conventions) while `buildMultiTargeting\u002F` is not, a `buildTransitive\u002F\u003Ctfm>\u002F` forwarder **must include the TFM segment** — dropping it resolves to a non-existent package-root `build\u002FMyPackage.props` and fails transitive consumers with **`MSB4019`**. Derive the segment from the file's own folder, never `$(TargetFramework)` (NuGet nearest-match can serve a `net10.0` consumer the `net9.0` folder, so `$(TargetFramework)` may name a folder that was never restored):\n\n```xml\n\u003C!-- buildTransitive\u002F\u003Ctfm>\u002FMyPackage.props -->\n\u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\build\\$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)'))))\\MyPackage.props\" \u002F>\n```\n\n## Source Tree vs Packed Layout\n\nWhen reviewing a NuGet build-extension package, the **source layout** in the repository can legitimately differ from the **packed layout** inside the produced `.nupkg`. This is a common source of false-positive \"import points at a missing file\" findings.\n\nThree packaging mechanisms reshape the layout at pack time:\n\n1. **`.nuspec` `\u003Cfile src=… target=…>` mappings** — copy a single source file into multiple per-TFM targets:\n\n   ```xml\n   \u003C!-- Source tree has ONE shared file:\n          buildTransitive\\common\\MyAdapter.props\n        Pack rewrites it to per-TFM targets inside the .nupkg:\n          buildTransitive\\net462\\MyAdapter.props\n          buildTransitive\\net8.0\\MyAdapter.props\n          buildTransitive\\net9.0\\MyAdapter.props -->\n   \u003Cfiles>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net462\\MyAdapter.props\" \u002F>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net9.0\\MyAdapter.props\" \u002F>\n   \u003C\u002Ffiles>\n   ```\n\n   In the `\u003Cfile>` element, a `target` ending in `\\` is treated as a folder (filename preserved from `src`); a `target` ending in a filename renames the file.\n\n2. **`.csproj` `\u003CPackagePath>` metadata** on `\u003CNone Update=…>` or `\u003CContent Include=…>` items — same effect via SDK pack. Use one item per destination to keep the mapping unambiguous:\n\n   ```xml\n   \u003CItemGroup>\n     \u003CNone Include=\"buildTransitive\\common\\MyAdapter.props\" Pack=\"true\" PackagePath=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>\n     \u003CNone Include=\"buildTransitive\\common\\MyAdapter.props\" Pack=\"true\" PackagePath=\"buildTransitive\\net9.0\\MyAdapter.props\" \u002F>\n   \u003C\u002FItemGroup>\n   ```\n\n   NuGet\u002FSDK pack also accepts a semicolon-separated list (`PackagePath=\"buildTransitive\\net8.0\\;buildTransitive\\net9.0\\\"`) to fan one source out to multiple destinations, but the multi-item form above is harder to misread.\n\n3. **SDK conventions** — `IncludeBuildOutput`, `BuildOutputTargetFolder`, `IncludeContentInPack` automatically place built outputs under `lib\u002F\u003Ctfm>\u002F` or `build\u002F\u003Ctfm>\u002F`.\n\n### Implication for reviewers\n\nA forwarder like the following inside a packed `build\u002Fnet462\u002F` folder is **not** a \"missing-file\" bug, even if the source tree has no `buildTransitive\u002Fnet462\u002F` directory:\n\n```xml\n\u003C!-- In packed build\u002Fnet462\u002FMyAdapter.props -->\n\u003CProject>\n  \u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\buildTransitive\\net462\\MyAdapter.props\" \u002F>\n\u003C\u002FProject>\n```\n\nBefore flagging an unguarded `\u003CImport>` inside a `build\u002F\u003Ctfm>\u002F` or `buildTransitive\u002F\u003Ctfm>\u002F` folder:\n\n1. Look for `*.nuspec` in the project directory and its immediate parent directory (do not walk further up). Read every `\u003Cfile target=…>` whose `target` matches the imported path.\n2. Read the `.csproj` for `\u003CPackagePath>` metadata on `\u003CNone>`\u002F`\u003CContent>` items.\n3. Only flag the import if the target path is missing from **both** the source tree *and* the projected package layout.\n\nSee also `msbuild-antipatterns` AP-13 (\"NuGet package forwarders\" exception).\n\n## Import Guard Pattern\n\nThe `.targets` file ensures `.props` was imported using a guard property:\n\n```xml\n\u003C!-- End of Microsoft.Common.props -->\n\u003CPropertyGroup>\n  \u003CMicrosoftCommonPropsHasBeenImported>true\u003C\u002FMicrosoftCommonPropsHasBeenImported>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- Top of Microsoft.Common.CurrentVersion.targets -->\n\u003CImport Project=\"Microsoft.Common.props\"\n    Condition=\"'$(MicrosoftCommonPropsHasBeenImported)' != 'true'\" \u002F>\n```\n\nThis handles projects that only import `.targets`.\n\n## Directory.Build Discovery\n\nMSBuild walks up the directory tree to find the nearest `Directory.Build.props`:\n\n```xml\n\u003C_DirectoryBuildPropsBasePath>\n  $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', 'Directory.Build.props'))\n\u003C\u002F_DirectoryBuildPropsBasePath>\n```\n\nOnly the **nearest** file is discovered. Nested hierarchies must explicitly import parents:\n\n```xml\n\u003C!-- src\u002FDirectory.Build.props -->\n\u003CPropertyGroup>\n  \u003C_ParentPropsPath>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\u002F'))\u003C\u002F_ParentPropsPath>\n\u003C\u002FPropertyGroup>\n\u003CImport Project=\"$(_ParentPropsPath)\" Condition=\"'$(_ParentPropsPath)' != ''\" \u002F>\n```\n\n## Creating Your Own Extension Point\n\n```xml\n\u003C!-- MySDK.targets -->\n\u003CProject>\n  \u003CImport Project=\"MySDK.props\" Condition=\"'$(MySDKPropsImported)' != 'true'\" \u002F>\n\n  \u003CPropertyGroup>\n    \u003CCustomBeforeMySDK Condition=\"'$(CustomBeforeMySDK)' == ''\">$(MSBuildProjectDirectory)\\MySDK.Before.targets\u003C\u002FCustomBeforeMySDK>\n    \u003CCustomAfterMySDK Condition=\"'$(CustomAfterMySDK)' == ''\">$(MSBuildProjectDirectory)\\MySDK.After.targets\u003C\u002FCustomAfterMySDK>\n  \u003C\u002FPropertyGroup>\n\n  \u003CImport Project=\"$(CustomBeforeMySDK)\" Condition=\"Exists('$(CustomBeforeMySDK)')\" \u002F>\n\n  \u003CPropertyGroup>\n    \u003CMySDKBuildDependsOn>BeforeMySDKBuild;CoreMySDKBuild;AfterMySDKBuild\u003C\u002FMySDKBuildDependsOn>\n  \u003C\u002FPropertyGroup>\n  \u003CTarget Name=\"MySDKBuild\" DependsOnTargets=\"$(MySDKBuildDependsOn)\" \u002F>\n  \u003CTarget Name=\"BeforeMySDKBuild\" \u002F>\n  \u003CTarget Name=\"AfterMySDKBuild\" \u002F>\n  \u003CTarget Name=\"CoreMySDKBuild\">\n    \u003C!-- implementation -->\n  \u003C\u002FTarget>\n\n  \u003CImport Project=\"$(CustomAfterMySDK)\" Condition=\"Exists('$(CustomAfterMySDK)')\" \u002F>\n\u003C\u002FProject>\n```\n\n## Common Pitfalls\n\n- **Missing `Exists()` on optional imports** causes build failures when files are absent. **Exception**: imports inside published `build\u002F\u003Ctfm>\u002F` and `buildTransitive\u002F\u003Ctfm>\u002F` folders of a NuGet package are a package contract — the target is guaranteed by the packed layout (see \"Source Tree vs Packed Layout\" above). Don't guard them and don't flag them.\n- **Overwriting Custom* properties** drops prior hooks. Append with `;` separator.\n- **NuGet package file names not matching package ID** silently skips the import.\n- **Nested Directory.Build.props** without parent import loses repo-root settings.\n","# MSBuild Extension Points\n\n## Scope and routing\n\nOwn MSBuild import and hook discovery. USE FOR: CustomBefore\u002FCustomAfter hooks, ordered wildcard and NuGet auto-imports, control properties, build\u002FbuildTransitive packed layout, package ID and file-name matching, per-TFM forwarders, and tracing why assets or hooks are missing, broken, or replaced. An import guard remains in scope when it is one defect in a broader hook\u002Fimport flow. DO NOT USE for a focused safety verdict on whether one specific Import needs Exists or is an intentionally unguarded package contract; use msbuild-antipatterns. NEVER INVOKE when imports and hook placement already work and the request is only target Inputs\u002FOutputs, incremental skipping, or FileWrites clean tracking; use incremental-build or target-authoring. Exclude props-versus-targets placement and non-MSBuild systems.\n\nHow the MSBuild pipeline provides hooks for SDKs, NuGet packages, repos, and users to inject custom logic.\n\n## CustomBefore \u002F CustomAfter Hooks\n\nEvery major `.targets` file defines import hooks:\n\n```xml\n\u003CPropertyGroup>\n  \u003CCustomBeforeMicrosoftCommonTargets Condition=\"'$(CustomBeforeMicrosoftCommonTargets)' == ''\">\n    $(MSBuildExtensionsPath)\\v$(MSBuildToolsVersion)\\Custom.Before.Microsoft.Common.targets\n  \u003C\u002FCustomBeforeMicrosoftCommonTargets>\n\u003C\u002FPropertyGroup>\n\n\u003CImport Project=\"$(CustomBeforeMicrosoftCommonTargets)\"\n    Condition=\"'$(CustomBeforeMicrosoftCommonTargets)' != '' and Exists('$(CustomBeforeMicrosoftCommonTargets)')\"\u002F>\n\u003C!-- ... core targets ... -->\n\u003CImport Project=\"$(CustomAfterMicrosoftCommonTargets)\"\n    Condition=\"'$(CustomAfterMicrosoftCommonTargets)' != '' and Exists('$(CustomAfterMicrosoftCommonTargets)')\"\u002F>\n```\n\n### Rules\n\n- Default path includes version (`v$(MSBuildToolsVersion)`) for side-by-side installations.\n- Always check `Exists()`. The file may not be present on every machine.\n- **Append** to the property (don't overwrite) to chain multiple hooks:\n\n```xml\n\u003CPropertyGroup>\n  \u003CCustomBeforeMicrosoftCommonTargets>\n    $(CustomBeforeMicrosoftCommonTargets);$(MSBuildThisFileDirectory)MyExtension.targets\n  \u003C\u002FCustomBeforeMicrosoftCommonTargets>\n\u003C\u002FPropertyGroup>\n```\n\n## Wildcard Import Directories\n\nMSBuild imports all files in extension directories, sorted alphabetically:\n\n```xml\n\u003CImport Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Imports\\Microsoft.Common.props\\ImportBefore\\*\"\n    Condition=\"'$(ImportByWildcardBeforeMicrosoftCommonProps)' == 'true'\n               and Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Imports\\Microsoft.Common.props\\ImportBefore')\" \u002F>\n```\n\n### Key paths\n\n| Property | Resolves to | Scope |\n|---|---|---|\n| `$(MSBuildUserExtensionsPath)` | `%APPDATA%\\Microsoft\\MSBuild` | Per-user |\n| `$(MSBuildExtensionsPath)` | MSBuild install directory | Machine-wide |\n| `$(MSBuildProjectExtensionsPath)` | `obj\u002F` directory | Per-project (NuGet) |\n\nName files with numeric prefixes for ordering: `01-first.props`, `02-second.props`.\n\n## Import Gating — Control Properties\n\nEvery wildcard import is gated by a boolean property:\n\n```xml\n\u003CPropertyGroup>\n  \u003CImportByWildcardBeforeMicrosoftCommonProps\n      Condition=\"'$(ImportByWildcardBeforeMicrosoftCommonProps)' == ''\">true\u003C\u002FImportByWildcardBeforeMicrosoftCommonProps>\n  \u003CImportDirectoryBuildProps\n      Condition=\"'$(ImportDirectoryBuildProps)' == ''\">true\u003C\u002FImportDirectoryBuildProps>\n\u003C\u002FPropertyGroup>\n```\n\n### Available control properties\n\n| Property | What it disables |\n|---|---|\n| `ImportDirectoryBuildProps` | Directory.Build.props auto-discovery |\n| `ImportDirectoryBuildTargets` | Directory.Build.targets auto-discovery |\n| `ImportProjectExtensionProps` | NuGet-generated `*.props` in obj\u002F |\n| `ImportProjectExtensionTargets` | NuGet-generated `*.targets` in obj\u002F |\n| `ImportByWildcardBefore*` | Machine-level ImportBefore extensions |\n| `ImportByWildcardAfter*` | Machine-level ImportAfter extensions |\n\n## NuGet Package Build Extension Layout\n\nNuGet packages inject build logic via `build\u002F` or `buildTransitive\u002F` folders:\n\n```text\nMyPackage\u002F\n  build\u002F\n    MyPackage.props      ← imported via *.props wildcard\n    MyPackage.targets    ← imported via *.targets wildcard\n  buildTransitive\u002F\n    MyPackage.props      ← imported by transitive consumers\n    MyPackage.targets\n```\n\n### Rules\n\n- File names **must match the package ID** exactly.\n- `build\u002F` affects direct consumers only. `buildTransitive\u002F` affects the entire dependency chain.\n- Props are imported early (before the project), targets are imported late (after the project).\n\n### Forwarding chain: `buildTransitive\u002F` → `build\u002F` → shared\n\nForward `buildTransitive\u002F*.props` and `buildTransitive\u002F*.targets` through their sibling `build\u002F*.props` \u002F `build\u002F*.targets` files (chain `buildTransitive → build → shared`) instead of importing `buildMultiTargeting\u002F` directly. This keeps `build\u002F` as the single source of truth with a clear ownership chain, so transitive consumers stay in sync with direct consumers instead of the two layouts drifting apart.\n\nWhen `build\u002F` is packed **per-TFM** (`build\u002F\u003Ctfm>\u002F`, via `TfmSpecificPackageFile`, a per-TFM `\u003CPackagePath>`, or SDK conventions) while `buildMultiTargeting\u002F` is not, a `buildTransitive\u002F\u003Ctfm>\u002F` forwarder **must include the TFM segment** — dropping it resolves to a non-existent package-root `build\u002FMyPackage.props` and fails transitive consumers with **`MSB4019`**. Derive the segment from the file's own folder, never `$(TargetFramework)` (NuGet nearest-match can serve a `net10.0` consumer the `net9.0` folder, so `$(TargetFramework)` may name a folder that was never restored):\n\n```xml\n\u003C!-- buildTransitive\u002F\u003Ctfm>\u002FMyPackage.props -->\n\u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\build\\$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)'))))\\MyPackage.props\" \u002F>\n```\n\n## Source Tree vs Packed Layout\n\nWhen reviewing a NuGet build-extension package, the **source layout** in the repository can legitimately differ from the **packed layout** inside the produced `.nupkg`. This is a common source of false-positive \"import points at a missing file\" findings.\n\nThree packaging mechanisms reshape the layout at pack time:\n\n1. **`.nuspec` `\u003Cfile src=… target=…>` mappings** — copy a single source file into multiple per-TFM targets:\n\n   ```xml\n   \u003C!-- Source tree has ONE shared file:\n          buildTransitive\\common\\MyAdapter.props\n        Pack rewrites it to per-TFM targets inside the .nupkg:\n          buildTransitive\\net462\\MyAdapter.props\n          buildTransitive\\net8.0\\MyAdapter.props\n          buildTransitive\\net9.0\\MyAdapter.props -->\n   \u003Cfiles>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net462\\MyAdapter.props\" \u002F>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net9.0\\MyAdapter.props\" \u002F>\n   \u003C\u002Ffiles>\n   ```\n\n   In the `\u003Cfile>` element, a `target` ending in `\\` is treated as a folder (filename preserved from `src`); a `target` ending in a filename renames the file.\n\n2. **`.csproj` `\u003CPackagePath>` metadata** on `\u003CNone Update=…>` or `\u003CContent Include=…>` items — same effect via SDK pack. Use one item per destination to keep the mapping unambiguous:\n\n   ```xml\n   \u003CItemGroup>\n     \u003CNone Include=\"buildTransitive\\common\\MyAdapter.props\" Pack=\"true\" PackagePath=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>\n     \u003CNone Include=\"buildTransitive\\common\\MyAdapter.props\" Pack=\"true\" PackagePath=\"buildTransitive\\net9.0\\MyAdapter.props\" \u002F>\n   \u003C\u002FItemGroup>\n   ```\n\n   NuGet\u002FSDK pack also accepts a semicolon-separated list (`PackagePath=\"buildTransitive\\net8.0\\;buildTransitive\\net9.0\\\"`) to fan one source out to multiple destinations, but the multi-item form above is harder to misread.\n\n3. **SDK conventions** — `IncludeBuildOutput`, `BuildOutputTargetFolder`, `IncludeContentInPack` automatically place built outputs under `lib\u002F\u003Ctfm>\u002F` or `build\u002F\u003Ctfm>\u002F`.\n\n### Implication for reviewers\n\nA forwarder like the following inside a packed `build\u002Fnet462\u002F` folder is **not** a \"missing-file\" bug, even if the source tree has no `buildTransitive\u002Fnet462\u002F` directory:\n\n```xml\n\u003C!-- In packed build\u002Fnet462\u002FMyAdapter.props -->\n\u003CProject>\n  \u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\buildTransitive\\net462\\MyAdapter.props\" \u002F>\n\u003C\u002FProject>\n```\n\nBefore flagging an unguarded `\u003CImport>` inside a `build\u002F\u003Ctfm>\u002F` or `buildTransitive\u002F\u003Ctfm>\u002F` folder:\n\n1. Look for `*.nuspec` in the project directory and its immediate parent directory (do not walk further up). Read every `\u003Cfile target=…>` whose `target` matches the imported path.\n2. Read the `.csproj` for `\u003CPackagePath>` metadata on `\u003CNone>`\u002F`\u003CContent>` items.\n3. Only flag the import if the target path is missing from **both** the source tree *and* the projected package layout.\n\nSee also `msbuild-antipatterns` AP-13 (\"NuGet package forwarders\" exception).\n\n## Import Guard Pattern\n\nThe `.targets` file ensures `.props` was imported using a guard property:\n\n```xml\n\u003C!-- End of Microsoft.Common.props -->\n\u003CPropertyGroup>\n  \u003CMicrosoftCommonPropsHasBeenImported>true\u003C\u002FMicrosoftCommonPropsHasBeenImported>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- Top of Microsoft.Common.CurrentVersion.targets -->\n\u003CImport Project=\"Microsoft.Common.props\"\n    Condition=\"'$(MicrosoftCommonPropsHasBeenImported)' != 'true'\" \u002F>\n```\n\nThis handles projects that only import `.targets`.\n\n## Directory.Build Discovery\n\nMSBuild walks up the directory tree to find the nearest `Directory.Build.props`:\n\n```xml\n\u003C_DirectoryBuildPropsBasePath>\n  $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', 'Directory.Build.props'))\n\u003C\u002F_DirectoryBuildPropsBasePath>\n```\n\nOnly the **nearest** file is discovered. Nested hierarchies must explicitly import parents:\n\n```xml\n\u003C!-- src\u002FDirectory.Build.props -->\n\u003CPropertyGroup>\n  \u003C_ParentPropsPath>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\u002F'))\u003C\u002F_ParentPropsPath>\n\u003C\u002FPropertyGroup>\n\u003CImport Project=\"$(_ParentPropsPath)\" Condition=\"'$(_ParentPropsPath)' != ''\" \u002F>\n```\n\n## Creating Your Own Extension Point\n\n```xml\n\u003C!-- MySDK.targets -->\n\u003CProject>\n  \u003CImport Project=\"MySDK.props\" Condition=\"'$(MySDKPropsImported)' != 'true'\" \u002F>\n\n  \u003CPropertyGroup>\n    \u003CCustomBeforeMySDK Condition=\"'$(CustomBeforeMySDK)' == ''\">$(MSBuildProjectDirectory)\\MySDK.Before.targets\u003C\u002FCustomBeforeMySDK>\n    \u003CCustomAfterMySDK Condition=\"'$(CustomAfterMySDK)' == ''\">$(MSBuildProjectDirectory)\\MySDK.After.targets\u003C\u002FCustomAfterMySDK>\n  \u003C\u002FPropertyGroup>\n\n  \u003CImport Project=\"$(CustomBeforeMySDK)\" Condition=\"Exists('$(CustomBeforeMySDK)')\" \u002F>\n\n  \u003CPropertyGroup>\n    \u003CMySDKBuildDependsOn>BeforeMySDKBuild;CoreMySDKBuild;AfterMySDKBuild\u003C\u002FMySDKBuildDependsOn>\n  \u003C\u002FPropertyGroup>\n  \u003CTarget Name=\"MySDKBuild\" DependsOnTargets=\"$(MySDKBuildDependsOn)\" \u002F>\n  \u003CTarget Name=\"BeforeMySDKBuild\" \u002F>\n  \u003CTarget Name=\"AfterMySDKBuild\" \u002F>\n  \u003CTarget Name=\"CoreMySDKBuild\">\n    \u003C!-- implementation -->\n  \u003C\u002FTarget>\n\n  \u003CImport Project=\"$(CustomAfterMySDK)\" Condition=\"Exists('$(CustomAfterMySDK)')\" \u002F>\n\u003C\u002FProject>\n```\n\n## Common Pitfalls\n\n- **Missing `Exists()` on optional imports** causes build failures when files are absent. **Exception**: imports inside published `build\u002F\u003Ctfm>\u002F` and `buildTransitive\u002F\u003Ctfm>\u002F` folders of a NuGet package are a package contract — the target is guaranteed by the packed layout (see \"Source Tree vs Packed Layout\" above). Don't guard them and don't flag them.\n- **Overwriting Custom* properties** drops prior hooks. Append with `;` separator.\n- **NuGet package file names not matching package ID** silently skips the import.\n- **Nested Directory.Build.props** without parent import loses repo-root settings.\n",{"name":5,"license":16,"description":7},"main","f8f2bfd77819bb789d4736ce7db4a567a37fcf7e",".agents\u002Fskills\u002Fextension-points",315,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-14 14:01:43",{"source":9,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add microsoft\u002Ftestfx --skill extension-points",{"tool":65,"command":66},"bunx","bunx skills add microsoft\u002Ftestfx --skill extension-points",{"tool":68,"command":69},"pnpm","pnpm dlx skills add microsoft\u002Ftestfx --skill extension-points","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fextension-points\u002FSKILL.md",true,[],[74,101,134,159,182,209],{"skillNo":75,"name":76,"nameZh":17,"description":77,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":45},"01M70GYY0AV0JGMTHE2CN6TNYK","dotnet-breaking-changes","Use before changing .NET\u002FC# code whose callers you do not control: a NuGet library, or a repo with PublicAPI.Shipped\u002FUnshipped.txt, ApiCompat, multiple TargetFrameworks, InternalsVisibleTo, or generated (.g.cs) partials. Green builds miss silent breaks from optional parameters, parameter names, sealing, const values, nullability, and #if. USE FOR: \"without breaking existing callers\"; adding a public method, overload, optional parameter, or interface member to a shipped library; renaming a public method or an internal helper a friend assembly uses; consolidating duplicated logic; changing a signature, nullability, default, or attribute; adding a target framework; RS0016\u002FRS0017 or ApiCompat errors; \"is this PR breaking?\". For a rename, extract, or merge, also invoke csharp-refactoring. DO NOT USE FOR: an executable whose callers all live in one project; renaming a local variable or private member, even in a shipped library; formatting; framework\u002FSDK\u002FNuGet upgrades (use dotnet-upgrade).","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdotnet-breaking-changes\u002FSKILL.md",[],[81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100],"dotnet","dotnet breaking changes","changes","green","project","default","local","errors","interface","generated","upgrade","invoke","you","code","refactoring","merge","rename","library","live","assembly",{"skillNo":102,"name":103,"nameZh":104,"description":105,"descriptionZh":106,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":107,"categories":108,"keywords":115,"publishedAt":45},"01M699HHE9DTZWAMPB1ZR7ZKSW","testfx-test-value-evidence","TestFx 测试值证据应用","Apply the vendored test-value-evidence skill with TestFx toolchain, assertion, parallel-safety, packed-consumer, and review conventions. Use when implementing or reviewing behavior-changing TestFx PRs or commits, including source-only changes.","结合 TestFx 工具链、断言、并行安全、打包消费者（packed-consumer）和评审约定，应用项目内置的 test-value-evidence 技能。在实现或评审会改变行为的 TestFx PR 或提交时使用，包括仅修改源代码的变更。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftestfx-test-value-evidence\u002FSKILL.md",[109,112],{"categoryNo":110,"categoryName":111,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":113,"categoryName":114,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,83,132,35,133],"test","testfx test value evidence","test value evidence","evidence","value","review","parallel","toolchain","commits","implementing","prs","only","use","when","apply","with","behavior","conventions",{"skillNo":135,"name":136,"nameZh":137,"description":138,"descriptionZh":139,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":140,"categories":141,"keywords":144,"publishedAt":45},"01M699HEYWH1B9XGNBFY8J2FZS","testfx-parallel-safety-preflight","TestFx 并行安全预检","Check concurrency and isolation before implementing or refactoring TestFx tests, lifecycle code, helpers, shared-state declarations, or production paths those tests exercise. Use before narrowing DoNotParallelize or ResourceLock, changing parallelization settings, or introducing asynchronous workers; repeat against the final diff.","在实现或重构 TestFx 测试、生命周期代码、辅助函数、共享状态声明，或这些测试所覆盖的生产代码路径之前，检查并发性与隔离性。在缩小 DoNotParallelize 或 ResourceLock 的使用范围、更改并行化设置或引入异步工作线程之前使用；并针对最终 diff 重复检查。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftestfx-parallel-safety-preflight\u002FSKILL.md",[142,143],{"categoryNo":110,"categoryName":111,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":113,"categoryName":114,"taxonomyType":28,"taxonomyTypeDesc":29},[145,35,146,122,147,148,125,149,94,150,95,151,152,153,154,155,156,157,128,158],"testfx parallel safety preflight","preflight","shared","asynchronous","exercise","concurrency","paths","isolation","helpers","diff","parallelization","lifecycle","tests","workers",{"skillNo":160,"name":161,"nameZh":162,"description":163,"descriptionZh":164,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":165,"categories":166,"keywords":169,"publishedAt":45},"01M699HC61ZV9GJ2C8JV03951G","testfx-localization-validation","TestFx 本地化校验","Validate generated TestFx localization catalogs, resource IDs, placeholders and locked tokens. Use for RESX\u002FXLF changes, OneLoc PRs, localization build failures, duplicate targets or units, and orphaned translation entries.","验证生成的 TestFx 本地化目录、资源 ID、占位符和锁定标记。适用于 RESX\u002FXLF 变更、OneLoc PR、本地化构建失败、重复的目标文本或翻译单元，以及孤立的翻译条目。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftestfx-localization-validation\u002FSKILL.md",[167,168],{"categoryNo":110,"categoryName":111,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":113,"categoryName":114,"taxonomyType":28,"taxonomyTypeDesc":29},[170,171,172,173,174,175,176,177,178,126,90,128,179,180,83,41,181],"testfx localization validation","validation","localization","validate","translation","ids","for","tokens","entries","units","duplicate","build",{"skillNo":183,"name":184,"nameZh":185,"description":186,"descriptionZh":187,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":188,"categories":189,"keywords":192,"publishedAt":45},"01M699H9J2NWQXE4BDT6R0FH7S","testfx-acceptance-validation","TestFx 验收验证","Validate TestFx shipping paths and capable CI execution using packed consumers, package\u002Fcache provenance, exact exits and artifacts, and selected-versus-executed test evidence. Use for acceptance regressions, package\u002FMSBuild\u002Flauncher\u002Fprotocol changes, or skipped-only CI results; not for unrelated unit-only or documentation changes.","使用打包后的消费者、包与缓存来源、精确的退出码和产物，以及选中测试与实际执行测试的证据，验证 TestFx 的交付路径及有效的 CI 执行。适用于验收回归、包\u002FMSBuild\u002F启动器\u002F协议变更，或仅有跳过测试的 CI 结果；不适用于无关的纯单元测试或文档变更。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftestfx-acceptance-validation\u002FSKILL.md",[190,191],{"categoryNo":110,"categoryName":111,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":113,"categoryName":114,"taxonomyType":28,"taxonomyTypeDesc":29},[193,194,171,116,33,119,195,196,197,127,198,128,199,200,201,202,203,204,205,206,207,208,151,176],"testfx acceptance validation","acceptance","launcher","ci","execution","package","cache","artifacts","provenance","documentation","unrelated","shipping","results","protocol","unit","ci results",{"skillNo":210,"name":211,"nameZh":212,"description":213,"descriptionZh":214,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":215,"categories":216,"keywords":221,"publishedAt":45},"01M699H70BB999BT4F627T1PHE","session-delivery-hygiene","会话交付规范管控","Gate local-session scope, persistent delivery, live PR state, integration provenance, and owned cleanup. Use before implementing guidance changes, changing or pushing PR work, diagnosing package\u002Foutput mismatches, or handing off implementation.","把控本地会话范围、持久化交付、实时 PR 状态、集成来源以及责任范围内的清理工作。在实施指导变更、修改或推送 PR、诊断包与产物不匹配，或交接实现工作之前使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsession-delivery-hygiene\u002FSKILL.md",[217,218],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":219,"categoryName":220,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[222,223,224,225,226,125,87,227,228,99,229,198,128,201,230,231,83,232,233,234],"session delivery hygiene","delivery","session","hygiene","scope","cleanup","work","pr","output","state","integration","guidance","gate"]