[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75N5P1TQXQ475B2FG765AW5":3,"skill-same:01M75N5P1TQXQ475B2FG765AW5":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M75N5P1TQXQ475B2FG765AW5","msbuild-antipatterns",null,"DO NOT INVOKE when the primary request explicitly asks to convert, migrate, modernize, or rewrite a legacy\u002Fold-style project to SDK style; use msbuild-modernization. Migration prompts often mention ToolsVersion, explicit Compile\u002FReference entries, packages.config, or Microsoft.CSharp.targets, but merely reviewing or auditing a file that contains those patterns remains in scope here. USE FOR broad review, audit, lint, or maintainability\u002Fcorrectness checks of project\u002Fbuild files, including custom targets; prioritized cross-cutting findings; discrete anti-patterns; F# ordering\u002FFS0039; cross-platform paths; and focused Import safety verdicts. Review\u002Faudit is analysis-only unless fixes are requested. For concrete property\u002Fitem defects use property-patterns\u002Fitem-management; use target-authoring for implementation and extension-points for NuGet auto-import\u002Flayout discovery. Exclude non-MSBuild systems.","stanfish06\u002Fskillquarium","stanfish06","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93099613?v=4","01M75F1CK4ZW109ZK3T26VN52F","Zhiyuan","01M75F1CM53VH6F79DZ8GXKKES",12,"MIT","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmsbuild-antipatterns\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: msbuild-antipatterns\ndescription: \"DO NOT INVOKE when the primary request explicitly asks to convert, migrate, modernize, or rewrite a legacy\u002Fold-style project to SDK style; use msbuild-modernization. Migration prompts often mention ToolsVersion, explicit Compile\u002FReference entries, packages.config, or Microsoft.CSharp.targets, but merely reviewing or auditing a file that contains those patterns remains in scope here. USE FOR broad review, audit, lint, or maintainability\u002Fcorrectness checks of project\u002Fbuild files, including custom targets; prioritized cross-cutting findings; discrete anti-patterns; F# ordering\u002FFS0039; cross-platform paths; and focused Import safety verdicts. Review\u002Faudit is analysis-only unless fixes are requested. For concrete property\u002Fitem defects use property-patterns\u002Fitem-management; use target-authoring for implementation and extension-points for NuGet auto-import\u002Flayout discovery. Exclude non-MSBuild systems.\"\nlicense: MIT\n---\n\n# MSBuild Anti-Pattern Catalog\n\nA numbered catalog of common MSBuild anti-patterns. Each entry follows the format:\n\n- **Smell**: What to look for\n- **Why it's bad**: Impact on builds, maintainability, or correctness\n- **Fix**: Concrete transformation\n\nUse this catalog when scanning project files for improvements.\n\n## Review output contract\n\nFor review, audit, maintainability, or correctness-risk requests:\n\n1. Do not edit files unless the user explicitly asks for fixes.\n2. Return prioritized findings grounded in the supplied file, with impact and a targeted recommendation.\n3. Separate confirmed defects from conditional risks and already-correct patterns.\n4. Keep the final answer as the review; do not replace it with a terse summary of changes.\n\n---\n\n## AP-01: `\u003CExec>` for Operations That Have Built-in Tasks\n\n**Smell**: `\u003CExec Command=\"mkdir ...\" \u002F>`, `\u003CExec Command=\"copy ...\" \u002F>`, `\u003CExec Command=\"del ...\" \u002F>`\n\n**Why it's bad**: Built-in tasks are cross-platform, support incremental build, emit structured logging, and handle errors consistently. `\u003CExec>` is opaque to MSBuild.\n\n```xml\n\u003C!-- BAD -->\n\u003CTarget Name=\"PrepareOutput\">\n  \u003CExec Command=\"mkdir $(OutputPath)logs\" \u002F>\n  \u003CExec Command=\"copy config.json $(OutputPath)\" \u002F>\n  \u003CExec Command=\"del $(IntermediateOutputPath)*.tmp\" \u002F>\n\u003C\u002FTarget>\n\n\u003C!-- GOOD -->\n\u003CTarget Name=\"PrepareOutput\">\n  \u003CMakeDir Directories=\"$(OutputPath)logs\" \u002F>\n  \u003CCopy SourceFiles=\"config.json\" DestinationFolder=\"$(OutputPath)\" \u002F>\n  \u003CDelete Files=\"@(TempFiles)\" \u002F>\n\u003C\u002FTarget>\n```\n\n**Built-in task alternatives:**\n\n| Shell Command | MSBuild Task |\n|--------------|--------------|\n| `mkdir` | `\u003CMakeDir>` |\n| `copy` \u002F `cp` | `\u003CCopy>` |\n| `del` \u002F `rm` | `\u003CDelete>` |\n| `move` \u002F `mv` | `\u003CMove>` |\n| `echo text > file` | `\u003CWriteLinesToFile>` |\n| `touch` | `\u003CTouch>` |\n| `xcopy \u002Fs` | `\u003CCopy>` with item globs |\n\n---\n\n## AP-02: Unquoted Condition Expressions\n\n**Smell**: `Condition=\"$(Foo) == Bar\"` — either side of a comparison is unquoted.\n\n**Why it's bad**: If the property is empty or contains spaces\u002Fspecial characters, the condition evaluates incorrectly or throws a parse error. MSBuild requires single-quoted strings for reliable comparisons.\n\n```xml\n\u003C!-- BAD -->\n\u003CPropertyGroup Condition=\"$(Configuration) == Release\">\n  \u003COptimize>true\u003C\u002FOptimize>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- GOOD -->\n\u003CPropertyGroup Condition=\"'$(Configuration)' == 'Release'\">\n  \u003COptimize>true\u003C\u002FOptimize>\n\u003C\u002FPropertyGroup>\n```\n\n**Rule**: Always quote **both** sides of `==` and `!=` comparisons with single quotes.\n\n---\n\n## AP-03: Hardcoded Absolute Paths\n\n**Smell**: Paths like `C:\\tools\\`, `D:\\packages\\`, `\u002Fusr\u002Flocal\u002Fbin\u002F` in project files.\n\n**Why it's bad**: Breaks on other machines, CI environments, and other operating systems. Not relocatable.\n\n```xml\n\u003C!-- BAD -->\n\u003CPropertyGroup>\n  \u003CToolPath>C:\\tools\\mytool\\mytool.exe\u003C\u002FToolPath>\n\u003C\u002FPropertyGroup>\n\u003CImport Project=\"C:\\repos\\shared\\common.props\" \u002F>\n\n\u003C!-- GOOD -->\n\u003CPropertyGroup>\n  \u003CToolPath>$(MSBuildThisFileDirectory)tools\\mytool\\mytool.exe\u003C\u002FToolPath>\n\u003C\u002FPropertyGroup>\n\u003CImport Project=\"$(RepoRoot)eng\\common.props\" \u002F>\n```\n\n**Preferred path properties:**\n\n| Property | Meaning |\n|----------|---------|\n| `$(MSBuildThisFileDirectory)` | Directory of the current .props\u002F.targets file |\n| `$(MSBuildProjectDirectory)` | Directory of the .csproj |\n| `$([MSBuild]::GetDirectoryNameOfFileAbove(...))` | Walk up to find a marker file |\n| `$([MSBuild]::NormalizePath(...))` | Combine and normalize path segments |\n\n---\n\n## AP-04: Restating SDK Defaults\n\n**Smell**: Properties set to values that the .NET SDK already provides by default.\n\n**Why it's bad**: Adds noise, hides intentional overrides, and makes it harder to identify what's actually customized. When defaults change in newer SDKs, the redundant properties may silently pin old behavior.\n\n```xml\n\u003C!-- BAD: All of these are already the default -->\n\u003CPropertyGroup>\n  \u003COutputType>Library\u003C\u002FOutputType>\n  \u003CEnableDefaultItems>true\u003C\u002FEnableDefaultItems>\n  \u003CEnableDefaultCompileItems>true\u003C\u002FEnableDefaultCompileItems>\n  \u003CRootNamespace>MyLib\u003C\u002FRootNamespace>       \u003C!-- matches project name -->\n  \u003CAssemblyName>MyLib\u003C\u002FAssemblyName>         \u003C!-- matches project name -->\n  \u003CAppendTargetFrameworkToOutputPath>true\u003C\u002FAppendTargetFrameworkToOutputPath>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- GOOD: Only non-default values -->\n\u003CPropertyGroup>\n  \u003CTargetFramework>net8.0\u003C\u002FTargetFramework>\n\u003C\u002FPropertyGroup>\n```\n\n---\n\n## AP-05: Manual File Listing in SDK-Style Projects\n\n**Smell**: `\u003CCompile Include=\"File1.cs\" \u002F>`, `\u003CCompile Include=\"File2.cs\" \u002F>` in SDK-style projects.\n\n**Why it's bad**: SDK-style projects automatically glob `**\u002F*.cs` (and other file types). Explicit listing is redundant, creates merge conflicts, and new files may be accidentally missed if not added to the list.\n\n```xml\n\u003C!-- BAD -->\n\u003CItemGroup>\n  \u003CCompile Include=\"Program.cs\" \u002F>\n  \u003CCompile Include=\"Services\\MyService.cs\" \u002F>\n  \u003CCompile Include=\"Models\\User.cs\" \u002F>\n\u003C\u002FItemGroup>\n\n\u003C!-- GOOD: Remove entirely — SDK includes all .cs files by default.\n     Only use Remove\u002FExclude when you need to opt out: -->\n\u003CItemGroup>\n  \u003CCompile Remove=\"LegacyCode\\**\" \u002F>\n\u003C\u002FItemGroup>\n```\n\n**Exception**: Non-SDK-style (legacy) projects require explicit file includes. If migrating, see `msbuild-modernization` skill.\n\n**Exception (F# \u002F `.fsproj`)**: F# compilation is order-dependent — the compiler processes `\u003CCompile Include>` items sequentially and a file can only reference types\u002Fmodules declared in files listed above it. `.fsproj` files must therefore list every source file explicitly, in dependency order (utility\u002Fleaf modules at the top, the entry point such as `Program.fs` at the bottom). If a `.fsi` signature file is used, it must appear **immediately before** its companion `.fs` implementation file.\n\n---\n\n## AP-06: Using `\u003CReference>` with HintPath for NuGet Packages\n\n**Smell**: `\u003CReference Include=\"...\" HintPath=\"..\\packages\\SomePackage\\lib\\...\" \u002F>`\n\n**Why it's bad**: This is the legacy `packages.config` pattern. It doesn't support transitive dependencies, version conflict resolution, or automatic restore. The `packages\u002F` folder must be committed or restored separately.\n\n```xml\n\u003C!-- BAD -->\n\u003CItemGroup>\n  \u003CReference Include=\"Newtonsoft.Json\">\n    \u003CHintPath>..\\packages\\Newtonsoft.Json.13.0.3\\lib\\netstandard2.0\\Newtonsoft.Json.dll\u003C\u002FHintPath>\n  \u003C\u002FReference>\n\u003C\u002FItemGroup>\n\n\u003C!-- GOOD -->\n\u003CItemGroup>\n  \u003CPackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.3\" \u002F>\n\u003C\u002FItemGroup>\n```\n\n**Note**: `\u003CReference>` without HintPath is still valid for .NET Framework GAC assemblies like `WindowsBase`, `PresentationCore`, etc.\n\n---\n\n## AP-07: Missing `PrivateAssets=\"all\"` on Analyzer\u002FTool Packages\n\n**Smell**: `\u003CPackageReference Include=\"StyleCop.Analyzers\" Version=\"...\" \u002F>` without `PrivateAssets=\"all\"`.\n\n**Why it's bad**: Without `PrivateAssets=\"all\"`, analyzer and build-tool packages flow as transitive dependencies to consumers of your library. Consumers get unwanted analyzers or build-time tools they didn't ask for.\n\nSee [`references\u002Fprivate-assets.md`](references\u002Fprivate-assets.md) for BAD\u002FGOOD examples and the full list of packages that need this.\n\n---\n\n## AP-08: Copy-Pasted Properties Across Multiple .csproj Files\n\n**Smell**: The same `\u003CPropertyGroup>` block appears in 3+ project files.\n\n**Why it's bad**: Maintenance burden — a change must be made in every file. Inconsistencies creep in over time.\n\n```xml\n\u003C!-- BAD: Repeated in every .csproj -->\n\u003C!-- ProjectA.csproj, ProjectB.csproj, ProjectC.csproj all have: -->\n\u003CPropertyGroup>\n  \u003CNullable>enable\u003C\u002FNullable>\n  \u003CTreatWarningsAsErrors>true\u003C\u002FTreatWarningsAsErrors>\n  \u003CImplicitUsings>enable\u003C\u002FImplicitUsings>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- GOOD: Define once in Directory.Build.props at the repo\u002Fsrc root -->\n\u003C!-- Directory.Build.props -->\n\u003CProject>\n  \u003CPropertyGroup>\n    \u003CNullable>enable\u003C\u002FNullable>\n    \u003CTreatWarningsAsErrors>true\u003C\u002FTreatWarningsAsErrors>\n    \u003CImplicitUsings>enable\u003C\u002FImplicitUsings>\n  \u003C\u002FPropertyGroup>\n\u003C\u002FProject>\n```\n\nSee `directory-build-organization` skill for full guidance on structuring `Directory.Build.props` \u002F `Directory.Build.targets`.\n\n---\n\n## AP-09: Scattered Package Versions Without Central Package Management\n\n**Smell**: `\u003CPackageReference Include=\"X\" Version=\"1.2.3\" \u002F>` with different versions of the same package across projects.\n\n**Why it's bad**: Version drift — different projects use different versions of the same package, leading to runtime mismatches, unexpected behavior, or diamond dependency conflicts.\n\n```xml\n\u003C!-- BAD: Version specified in each project, can drift -->\n\u003C!-- ProjectA.csproj -->\n\u003CPackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.1\" \u002F>\n\u003C!-- ProjectB.csproj -->\n\u003CPackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.3\" \u002F>\n```\n\n**Fix:** Use Central Package Management. See [https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fnuget\u002Fconsume-packages\u002Fcentral-package-management](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fnuget\u002Fconsume-packages\u002Fcentral-package-management) for details.\n\n---\n\n## AP-10: Monolithic Targets (Too Much in One Target)\n\n**Smell**: A single `\u003CTarget>` with 50+ lines doing multiple unrelated things.\n\n**Why it's bad**: Can't skip individual steps via incremental build, hard to debug, hard to extend, and the target name becomes meaningless.\n\n```xml\n\u003C!-- BAD -->\n\u003CTarget Name=\"PrepareRelease\" BeforeTargets=\"Build\">\n  \u003CWriteLinesToFile File=\"version.txt\" Lines=\"$(Version)\" Overwrite=\"true\" \u002F>\n  \u003CCopy SourceFiles=\"LICENSE\" DestinationFolder=\"$(OutputPath)\" \u002F>\n  \u003CExec Command=\"signtool sign \u002Ff cert.pfx $(OutputPath)*.dll\" \u002F>\n  \u003CMakeDir Directories=\"$(OutputPath)docs\" \u002F>\n  \u003CCopy SourceFiles=\"@(DocFiles)\" DestinationFolder=\"$(OutputPath)docs\" \u002F>\n  \u003C!-- ... 30 more lines ... -->\n\u003C\u002FTarget>\n\n\u003C!-- GOOD: Single-responsibility targets -->\n\u003CTarget Name=\"WriteVersionFile\" BeforeTargets=\"CoreCompile\"\n        Inputs=\"$(MSBuildProjectFile)\" Outputs=\"$(IntermediateOutputPath)version.txt\">\n  \u003CWriteLinesToFile File=\"$(IntermediateOutputPath)version.txt\" Lines=\"$(Version)\" Overwrite=\"true\" \u002F>\n\u003C\u002FTarget>\n\n\u003CTarget Name=\"CopyLicense\" AfterTargets=\"Build\">\n  \u003CCopy SourceFiles=\"LICENSE\" DestinationFolder=\"$(OutputPath)\" SkipUnchangedFiles=\"true\" \u002F>\n\u003C\u002FTarget>\n\n\u003CTarget Name=\"SignAssemblies\" AfterTargets=\"Build\" DependsOnTargets=\"CopyLicense\"\n        Condition=\"'$(SignAssemblies)' == 'true'\">\n  \u003CExec Command=\"signtool sign \u002Ff cert.pfx %(AssemblyFiles.Identity)\" \u002F>\n\u003C\u002FTarget>\n```\n\n---\n\n## AP-11: Custom Targets Missing `Inputs` and `Outputs`\n\n**Smell**: `\u003CTarget Name=\"MyTarget\" BeforeTargets=\"Build\">` with no `Inputs` \u002F `Outputs` attributes.\n\n**Why it's bad**: The target runs on every build, even when nothing changed. This defeats incremental build and slows down no-op builds.\n\nSee [`references\u002Fincremental-build-inputs-outputs.md`](references\u002Fincremental-build-inputs-outputs.md) for BAD\u002FGOOD examples and the full pattern including FileWrites registration.\n\nSee `incremental-build` skill for deep guidance on Inputs\u002FOutputs, FileWrites, and up-to-date checks.\n\n---\n\n## AP-12: Setting Defaults in .targets Instead of .props\n\n**Smell**: `\u003CPropertyGroup>` with default values inside a `.targets` file.\n\n**Why it's bad**: `.targets` files are imported late (after project files). By the time they set defaults, other `.targets` files may have already used the empty\u002Fundefined value. `.props` files are imported early and are the correct place for defaults.\n\n```xml\n\u003C!-- BAD: custom.targets -->\n\u003CPropertyGroup>\n  \u003CMyToolVersion>2.0\u003C\u002FMyToolVersion>\n\u003C\u002FPropertyGroup>\n\u003CTarget Name=\"RunMyTool\">\n  \u003CExec Command=\"mytool --version $(MyToolVersion)\" \u002F>\n\u003C\u002FTarget>\n\n\u003C!-- GOOD: Split into .props (defaults) + .targets (logic) -->\n\u003C!-- custom.props (imported early) -->\n\u003CPropertyGroup>\n  \u003CMyToolVersion Condition=\"'$(MyToolVersion)' == ''\">2.0\u003C\u002FMyToolVersion>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- custom.targets (imported late) -->\n\u003CTarget Name=\"RunMyTool\">\n  \u003CExec Command=\"mytool --version $(MyToolVersion)\" \u002F>\n\u003C\u002FTarget>\n```\n\n**Rule**: `.props` = defaults and settings (evaluated early). `.targets` = build logic and targets (evaluated late).\n\n---\n\n## AP-13: Import Without `Exists()` Guard\n\n**Smell**: `\u003CImport Project=\"some-file.props\" \u002F>` without a `Condition=\"Exists('...')\"` check.\n\n**Why it's bad**: If the file doesn't exist (not yet created, wrong path, deleted), the build fails with a confusing error. Optional imports should always be guarded.\n\n```xml\n\u003C!-- BAD -->\n\u003CImport Project=\"$(RepoRoot)eng\\custom.props\" \u002F>\n\n\u003C!-- GOOD: Guard optional imports -->\n\u003CImport Project=\"$(RepoRoot)eng\\custom.props\" Condition=\"Exists('$(RepoRoot)eng\\custom.props')\" \u002F>\n\n\u003C!-- ALSO GOOD: Sdk attribute imports don't need guards (they're required by design) -->\n\u003CProject Sdk=\"Microsoft.NET.Sdk\">\n```\n\n**Exception — required imports**: Imports that are *required* for the build to work correctly should fail fast — don't guard those. Guard imports that are optional or environment-specific (e.g., local developer overrides, CI-specific settings).\n\n**Exception — NuGet package forwarders**: `.props`\u002F`.targets` files inside a NuGet package's per-TFM `build\u002F` or `buildTransitive\u002F` folder routinely import a sibling file under `buildTransitive\u002F\u003Ctfm>\u002F…` without an `Exists()` guard. These are a **package contract**: the target file is guaranteed to be present in the restored package, even if it doesn't appear in the source tree at that relative path. The package layout is typically produced by:\n\n- A custom `.nuspec` with per-TFM `\u003Cfile>` entries — e.g. `\u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>` — that copy files from a single source folder (such as `buildTransitive\u002Fcommon\u002F`) into per-TFM subfolders at pack time, or\n- `\u003CNone Update=\"...\">` \u002F `\u003CContent Include=\"...\">` items in the `.csproj` with a per-TFM `\u003CPackagePath>` (e.g. `\u003CPackagePath>buildTransitive\u002Fnet8.0\u002F\u003C\u002FPackagePath>`), declared once per target TFM, or\n- SDK conventions (e.g. `IncludeBuildOutput`, `BuildOutputTargetFolder`) that place built outputs under `build\u002F\u003Ctfm>\u002F`.\n\nBefore flagging an unguarded `\u003CImport>` inside a `build\u002F` or `buildTransitive\u002F` folder, **resolve it against the packed layout** — read every `*.nuspec` in the project directory **and its immediate parent directory** (shared nuspecs are common in mono-repos; do not walk further up), and any `\u003CPackagePath>` metadata on `\u003CNone>`\u002F`\u003CContent>` items in the `.csproj`. Only flag if the target path is missing from **both** the source tree *and* the projected package layout. The `dotnet-msbuild\u002Fextension-points` skill — *Source tree vs packed layout* — documents the full cross-check procedure.\n\n**Forwarding `buildTransitive\u002F` → `build\u002F`:** forward through the sibling `build\u002F*.props` \u002F `build\u002F*.targets` file (not directly to `buildMultiTargeting\u002F`); when `build\u002F` is per-TFM (`build\u002F\u003Ctfm>\u002F`), include the TFM segment derived from the file's own folder (not `$(TargetFramework)`), or transitive consumers hit `MSB4019`. See the `extension-points` skill — *Forwarding chain* — for the rule and derivation expression.\n\n---\n\n## AP-14: Backslashes in Paths — Where It Matters\n\n**Smell**: Backslash path separators in `.props`\u002F`.targets` files meant to run cross-platform.\n\n**Where this is a real bug (🔴 Error)** — paths that MSBuild does **not** route through its path normalizer:\n\n- Raw shell strings inside `\u003CExec Command=\"...\\tools\\foo.exe ...\" \u002F>` — passed verbatim to `bash`\u002F`sh` on Unix, which treats `\\` as an escape.\n- Backslash-delimited paths inside CDATA blocks, embedded in source files written by `\u003CWriteLinesToFile>`, or constructed for non-MSBuild consumers (custom scripts, response files, environment variables).\n- Paths handed to custom tasks that call OS file APIs directly without going through MSBuild path utilities.\n\n**Where this is only a style preference (🔵 Style)** — paths that go through MSBuild's evaluator (`\u003CImport Project=\"...\">`, file-path properties consumed by built-in tasks like `\u003CCopy>`\u002F`\u003CMakeDir>`\u002F`\u003CDelete>`, item `Include=`\u002F`Exclude=` globs):\n\nMSBuild's evaluator normalizes `\\` → `\u002F` on Unix-like systems before resolving the path. See `FileUtilities.MaybeAdjustFilePath` and `ConvertToUnixSlashes` in [`microsoft\u002Fmsbuild` `src\u002FFramework\u002FFileUtilities.cs`](https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fmsbuild\u002Fblob\u002Fmain\u002Fsrc\u002FFramework\u002FFileUtilities.cs). So `\u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\build\\common.props\" \u002F>` resolves correctly on Linux\u002FmacOS today. Forward slashes are still **preferred for consistency**, but the import will not break and existing backslash-style imports should not be flagged as 🔴 **Error**.\n\n```xml\n\u003C!-- 🔴 Error: \\ in raw shell string breaks on Linux\u002FmacOS -->\n\u003CExec Command=\"$(MSBuildThisFileDirectory)tools\\release\\sign.exe $(OutputPath)\" \u002F>\n\n\u003C!-- 🔵 Style: \\ in Import is normalized on Unix, but \u002F is nicer -->\n\u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\build\\common.props\" \u002F>\n\n\u003C!-- ✅ Recommended in new code -->\n\u003CImport Project=\"$(MSBuildThisFileDirectory)..\u002F..\u002Fbuild\u002Fcommon.props\" \u002F>\n```\n\n**Verification rule**: Before flagging a backslash path as 🔴 **Error**, ask *\"does this string flow through MSBuild's evaluator, or is it handed verbatim to a non-MSBuild consumer?\"* Only the second case is a correctness defect.\n\n**Note**: `$(MSBuildThisFileDirectory)` already ends with a platform-appropriate separator, so `$(MSBuildThisFileDirectory)tools\u002Fmytool` works on both platforms.\n\n---\n\n## AP-15: Unconditional Property Override in Multiple Scopes\n\n**Smell**: A property set unconditionally in both `Directory.Build.props` and a `.csproj` — last write wins silently.\n\n**Why it's bad**: Hard to trace which value is actually used. Makes the build fragile and confusing for anyone reading the project files.\n\n```xml\n\u003C!-- BAD: Directory.Build.props sets it, csproj silently overrides -->\n\u003C!-- Directory.Build.props -->\n\u003CPropertyGroup>\n  \u003COutputPath>bin\\custom\\\u003C\u002FOutputPath>\n\u003C\u002FPropertyGroup>\n\u003C!-- MyProject.csproj -->\n\u003CPropertyGroup>\n  \u003COutputPath>bin\\other\\\u003C\u002FOutputPath>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- GOOD: Use a condition so overrides are intentional -->\n\u003C!-- Directory.Build.props -->\n\u003CPropertyGroup>\n  \u003COutputPath Condition=\"'$(OutputPath)' == ''\">bin\\custom\\\u003C\u002FOutputPath>\n\u003C\u002FPropertyGroup>\n\u003C!-- MyProject.csproj can now intentionally override or leave the default -->\n```\n\n---\n\nFor additional anti-patterns (AP-16 through AP-23) and a quick-reference checklist, see [additional-antipatterns.md](references\u002Fadditional-antipatterns.md).\n","# MSBuild Anti-Pattern Catalog\n\nA numbered catalog of common MSBuild anti-patterns. Each entry follows the format:\n\n- **Smell**: What to look for\n- **Why it's bad**: Impact on builds, maintainability, or correctness\n- **Fix**: Concrete transformation\n\nUse this catalog when scanning project files for improvements.\n\n## Review output contract\n\nFor review, audit, maintainability, or correctness-risk requests:\n\n1. Do not edit files unless the user explicitly asks for fixes.\n2. Return prioritized findings grounded in the supplied file, with impact and a targeted recommendation.\n3. Separate confirmed defects from conditional risks and already-correct patterns.\n4. Keep the final answer as the review; do not replace it with a terse summary of changes.\n\n---\n\n## AP-01: `\u003CExec>` for Operations That Have Built-in Tasks\n\n**Smell**: `\u003CExec Command=\"mkdir ...\" \u002F>`, `\u003CExec Command=\"copy ...\" \u002F>`, `\u003CExec Command=\"del ...\" \u002F>`\n\n**Why it's bad**: Built-in tasks are cross-platform, support incremental build, emit structured logging, and handle errors consistently. `\u003CExec>` is opaque to MSBuild.\n\n```xml\n\u003C!-- BAD -->\n\u003CTarget Name=\"PrepareOutput\">\n  \u003CExec Command=\"mkdir $(OutputPath)logs\" \u002F>\n  \u003CExec Command=\"copy config.json $(OutputPath)\" \u002F>\n  \u003CExec Command=\"del $(IntermediateOutputPath)*.tmp\" \u002F>\n\u003C\u002FTarget>\n\n\u003C!-- GOOD -->\n\u003CTarget Name=\"PrepareOutput\">\n  \u003CMakeDir Directories=\"$(OutputPath)logs\" \u002F>\n  \u003CCopy SourceFiles=\"config.json\" DestinationFolder=\"$(OutputPath)\" \u002F>\n  \u003CDelete Files=\"@(TempFiles)\" \u002F>\n\u003C\u002FTarget>\n```\n\n**Built-in task alternatives:**\n\n| Shell Command | MSBuild Task |\n|--------------|--------------|\n| `mkdir` | `\u003CMakeDir>` |\n| `copy` \u002F `cp` | `\u003CCopy>` |\n| `del` \u002F `rm` | `\u003CDelete>` |\n| `move` \u002F `mv` | `\u003CMove>` |\n| `echo text > file` | `\u003CWriteLinesToFile>` |\n| `touch` | `\u003CTouch>` |\n| `xcopy \u002Fs` | `\u003CCopy>` with item globs |\n\n---\n\n## AP-02: Unquoted Condition Expressions\n\n**Smell**: `Condition=\"$(Foo) == Bar\"` — either side of a comparison is unquoted.\n\n**Why it's bad**: If the property is empty or contains spaces\u002Fspecial characters, the condition evaluates incorrectly or throws a parse error. MSBuild requires single-quoted strings for reliable comparisons.\n\n```xml\n\u003C!-- BAD -->\n\u003CPropertyGroup Condition=\"$(Configuration) == Release\">\n  \u003COptimize>true\u003C\u002FOptimize>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- GOOD -->\n\u003CPropertyGroup Condition=\"'$(Configuration)' == 'Release'\">\n  \u003COptimize>true\u003C\u002FOptimize>\n\u003C\u002FPropertyGroup>\n```\n\n**Rule**: Always quote **both** sides of `==` and `!=` comparisons with single quotes.\n\n---\n\n## AP-03: Hardcoded Absolute Paths\n\n**Smell**: Paths like `C:\\tools\\`, `D:\\packages\\`, `\u002Fusr\u002Flocal\u002Fbin\u002F` in project files.\n\n**Why it's bad**: Breaks on other machines, CI environments, and other operating systems. Not relocatable.\n\n```xml\n\u003C!-- BAD -->\n\u003CPropertyGroup>\n  \u003CToolPath>C:\\tools\\mytool\\mytool.exe\u003C\u002FToolPath>\n\u003C\u002FPropertyGroup>\n\u003CImport Project=\"C:\\repos\\shared\\common.props\" \u002F>\n\n\u003C!-- GOOD -->\n\u003CPropertyGroup>\n  \u003CToolPath>$(MSBuildThisFileDirectory)tools\\mytool\\mytool.exe\u003C\u002FToolPath>\n\u003C\u002FPropertyGroup>\n\u003CImport Project=\"$(RepoRoot)eng\\common.props\" \u002F>\n```\n\n**Preferred path properties:**\n\n| Property | Meaning |\n|----------|---------|\n| `$(MSBuildThisFileDirectory)` | Directory of the current .props\u002F.targets file |\n| `$(MSBuildProjectDirectory)` | Directory of the .csproj |\n| `$([MSBuild]::GetDirectoryNameOfFileAbove(...))` | Walk up to find a marker file |\n| `$([MSBuild]::NormalizePath(...))` | Combine and normalize path segments |\n\n---\n\n## AP-04: Restating SDK Defaults\n\n**Smell**: Properties set to values that the .NET SDK already provides by default.\n\n**Why it's bad**: Adds noise, hides intentional overrides, and makes it harder to identify what's actually customized. When defaults change in newer SDKs, the redundant properties may silently pin old behavior.\n\n```xml\n\u003C!-- BAD: All of these are already the default -->\n\u003CPropertyGroup>\n  \u003COutputType>Library\u003C\u002FOutputType>\n  \u003CEnableDefaultItems>true\u003C\u002FEnableDefaultItems>\n  \u003CEnableDefaultCompileItems>true\u003C\u002FEnableDefaultCompileItems>\n  \u003CRootNamespace>MyLib\u003C\u002FRootNamespace>       \u003C!-- matches project name -->\n  \u003CAssemblyName>MyLib\u003C\u002FAssemblyName>         \u003C!-- matches project name -->\n  \u003CAppendTargetFrameworkToOutputPath>true\u003C\u002FAppendTargetFrameworkToOutputPath>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- GOOD: Only non-default values -->\n\u003CPropertyGroup>\n  \u003CTargetFramework>net8.0\u003C\u002FTargetFramework>\n\u003C\u002FPropertyGroup>\n```\n\n---\n\n## AP-05: Manual File Listing in SDK-Style Projects\n\n**Smell**: `\u003CCompile Include=\"File1.cs\" \u002F>`, `\u003CCompile Include=\"File2.cs\" \u002F>` in SDK-style projects.\n\n**Why it's bad**: SDK-style projects automatically glob `**\u002F*.cs` (and other file types). Explicit listing is redundant, creates merge conflicts, and new files may be accidentally missed if not added to the list.\n\n```xml\n\u003C!-- BAD -->\n\u003CItemGroup>\n  \u003CCompile Include=\"Program.cs\" \u002F>\n  \u003CCompile Include=\"Services\\MyService.cs\" \u002F>\n  \u003CCompile Include=\"Models\\User.cs\" \u002F>\n\u003C\u002FItemGroup>\n\n\u003C!-- GOOD: Remove entirely — SDK includes all .cs files by default.\n     Only use Remove\u002FExclude when you need to opt out: -->\n\u003CItemGroup>\n  \u003CCompile Remove=\"LegacyCode\\**\" \u002F>\n\u003C\u002FItemGroup>\n```\n\n**Exception**: Non-SDK-style (legacy) projects require explicit file includes. If migrating, see `msbuild-modernization` skill.\n\n**Exception (F# \u002F `.fsproj`)**: F# compilation is order-dependent — the compiler processes `\u003CCompile Include>` items sequentially and a file can only reference types\u002Fmodules declared in files listed above it. `.fsproj` files must therefore list every source file explicitly, in dependency order (utility\u002Fleaf modules at the top, the entry point such as `Program.fs` at the bottom). If a `.fsi` signature file is used, it must appear **immediately before** its companion `.fs` implementation file.\n\n---\n\n## AP-06: Using `\u003CReference>` with HintPath for NuGet Packages\n\n**Smell**: `\u003CReference Include=\"...\" HintPath=\"..\\packages\\SomePackage\\lib\\...\" \u002F>`\n\n**Why it's bad**: This is the legacy `packages.config` pattern. It doesn't support transitive dependencies, version conflict resolution, or automatic restore. The `packages\u002F` folder must be committed or restored separately.\n\n```xml\n\u003C!-- BAD -->\n\u003CItemGroup>\n  \u003CReference Include=\"Newtonsoft.Json\">\n    \u003CHintPath>..\\packages\\Newtonsoft.Json.13.0.3\\lib\\netstandard2.0\\Newtonsoft.Json.dll\u003C\u002FHintPath>\n  \u003C\u002FReference>\n\u003C\u002FItemGroup>\n\n\u003C!-- GOOD -->\n\u003CItemGroup>\n  \u003CPackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.3\" \u002F>\n\u003C\u002FItemGroup>\n```\n\n**Note**: `\u003CReference>` without HintPath is still valid for .NET Framework GAC assemblies like `WindowsBase`, `PresentationCore`, etc.\n\n---\n\n## AP-07: Missing `PrivateAssets=\"all\"` on Analyzer\u002FTool Packages\n\n**Smell**: `\u003CPackageReference Include=\"StyleCop.Analyzers\" Version=\"...\" \u002F>` without `PrivateAssets=\"all\"`.\n\n**Why it's bad**: Without `PrivateAssets=\"all\"`, analyzer and build-tool packages flow as transitive dependencies to consumers of your library. Consumers get unwanted analyzers or build-time tools they didn't ask for.\n\nSee [`references\u002Fprivate-assets.md`](references\u002Fprivate-assets.md) for BAD\u002FGOOD examples and the full list of packages that need this.\n\n---\n\n## AP-08: Copy-Pasted Properties Across Multiple .csproj Files\n\n**Smell**: The same `\u003CPropertyGroup>` block appears in 3+ project files.\n\n**Why it's bad**: Maintenance burden — a change must be made in every file. Inconsistencies creep in over time.\n\n```xml\n\u003C!-- BAD: Repeated in every .csproj -->\n\u003C!-- ProjectA.csproj, ProjectB.csproj, ProjectC.csproj all have: -->\n\u003CPropertyGroup>\n  \u003CNullable>enable\u003C\u002FNullable>\n  \u003CTreatWarningsAsErrors>true\u003C\u002FTreatWarningsAsErrors>\n  \u003CImplicitUsings>enable\u003C\u002FImplicitUsings>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- GOOD: Define once in Directory.Build.props at the repo\u002Fsrc root -->\n\u003C!-- Directory.Build.props -->\n\u003CProject>\n  \u003CPropertyGroup>\n    \u003CNullable>enable\u003C\u002FNullable>\n    \u003CTreatWarningsAsErrors>true\u003C\u002FTreatWarningsAsErrors>\n    \u003CImplicitUsings>enable\u003C\u002FImplicitUsings>\n  \u003C\u002FPropertyGroup>\n\u003C\u002FProject>\n```\n\nSee `directory-build-organization` skill for full guidance on structuring `Directory.Build.props` \u002F `Directory.Build.targets`.\n\n---\n\n## AP-09: Scattered Package Versions Without Central Package Management\n\n**Smell**: `\u003CPackageReference Include=\"X\" Version=\"1.2.3\" \u002F>` with different versions of the same package across projects.\n\n**Why it's bad**: Version drift — different projects use different versions of the same package, leading to runtime mismatches, unexpected behavior, or diamond dependency conflicts.\n\n```xml\n\u003C!-- BAD: Version specified in each project, can drift -->\n\u003C!-- ProjectA.csproj -->\n\u003CPackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.1\" \u002F>\n\u003C!-- ProjectB.csproj -->\n\u003CPackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.3\" \u002F>\n```\n\n**Fix:** Use Central Package Management. See [https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fnuget\u002Fconsume-packages\u002Fcentral-package-management](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fnuget\u002Fconsume-packages\u002Fcentral-package-management) for details.\n\n---\n\n## AP-10: Monolithic Targets (Too Much in One Target)\n\n**Smell**: A single `\u003CTarget>` with 50+ lines doing multiple unrelated things.\n\n**Why it's bad**: Can't skip individual steps via incremental build, hard to debug, hard to extend, and the target name becomes meaningless.\n\n```xml\n\u003C!-- BAD -->\n\u003CTarget Name=\"PrepareRelease\" BeforeTargets=\"Build\">\n  \u003CWriteLinesToFile File=\"version.txt\" Lines=\"$(Version)\" Overwrite=\"true\" \u002F>\n  \u003CCopy SourceFiles=\"LICENSE\" DestinationFolder=\"$(OutputPath)\" \u002F>\n  \u003CExec Command=\"signtool sign \u002Ff cert.pfx $(OutputPath)*.dll\" \u002F>\n  \u003CMakeDir Directories=\"$(OutputPath)docs\" \u002F>\n  \u003CCopy SourceFiles=\"@(DocFiles)\" DestinationFolder=\"$(OutputPath)docs\" \u002F>\n  \u003C!-- ... 30 more lines ... -->\n\u003C\u002FTarget>\n\n\u003C!-- GOOD: Single-responsibility targets -->\n\u003CTarget Name=\"WriteVersionFile\" BeforeTargets=\"CoreCompile\"\n        Inputs=\"$(MSBuildProjectFile)\" Outputs=\"$(IntermediateOutputPath)version.txt\">\n  \u003CWriteLinesToFile File=\"$(IntermediateOutputPath)version.txt\" Lines=\"$(Version)\" Overwrite=\"true\" \u002F>\n\u003C\u002FTarget>\n\n\u003CTarget Name=\"CopyLicense\" AfterTargets=\"Build\">\n  \u003CCopy SourceFiles=\"LICENSE\" DestinationFolder=\"$(OutputPath)\" SkipUnchangedFiles=\"true\" \u002F>\n\u003C\u002FTarget>\n\n\u003CTarget Name=\"SignAssemblies\" AfterTargets=\"Build\" DependsOnTargets=\"CopyLicense\"\n        Condition=\"'$(SignAssemblies)' == 'true'\">\n  \u003CExec Command=\"signtool sign \u002Ff cert.pfx %(AssemblyFiles.Identity)\" \u002F>\n\u003C\u002FTarget>\n```\n\n---\n\n## AP-11: Custom Targets Missing `Inputs` and `Outputs`\n\n**Smell**: `\u003CTarget Name=\"MyTarget\" BeforeTargets=\"Build\">` with no `Inputs` \u002F `Outputs` attributes.\n\n**Why it's bad**: The target runs on every build, even when nothing changed. This defeats incremental build and slows down no-op builds.\n\nSee [`references\u002Fincremental-build-inputs-outputs.md`](references\u002Fincremental-build-inputs-outputs.md) for BAD\u002FGOOD examples and the full pattern including FileWrites registration.\n\nSee `incremental-build` skill for deep guidance on Inputs\u002FOutputs, FileWrites, and up-to-date checks.\n\n---\n\n## AP-12: Setting Defaults in .targets Instead of .props\n\n**Smell**: `\u003CPropertyGroup>` with default values inside a `.targets` file.\n\n**Why it's bad**: `.targets` files are imported late (after project files). By the time they set defaults, other `.targets` files may have already used the empty\u002Fundefined value. `.props` files are imported early and are the correct place for defaults.\n\n```xml\n\u003C!-- BAD: custom.targets -->\n\u003CPropertyGroup>\n  \u003CMyToolVersion>2.0\u003C\u002FMyToolVersion>\n\u003C\u002FPropertyGroup>\n\u003CTarget Name=\"RunMyTool\">\n  \u003CExec Command=\"mytool --version $(MyToolVersion)\" \u002F>\n\u003C\u002FTarget>\n\n\u003C!-- GOOD: Split into .props (defaults) + .targets (logic) -->\n\u003C!-- custom.props (imported early) -->\n\u003CPropertyGroup>\n  \u003CMyToolVersion Condition=\"'$(MyToolVersion)' == ''\">2.0\u003C\u002FMyToolVersion>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- custom.targets (imported late) -->\n\u003CTarget Name=\"RunMyTool\">\n  \u003CExec Command=\"mytool --version $(MyToolVersion)\" \u002F>\n\u003C\u002FTarget>\n```\n\n**Rule**: `.props` = defaults and settings (evaluated early). `.targets` = build logic and targets (evaluated late).\n\n---\n\n## AP-13: Import Without `Exists()` Guard\n\n**Smell**: `\u003CImport Project=\"some-file.props\" \u002F>` without a `Condition=\"Exists('...')\"` check.\n\n**Why it's bad**: If the file doesn't exist (not yet created, wrong path, deleted), the build fails with a confusing error. Optional imports should always be guarded.\n\n```xml\n\u003C!-- BAD -->\n\u003CImport Project=\"$(RepoRoot)eng\\custom.props\" \u002F>\n\n\u003C!-- GOOD: Guard optional imports -->\n\u003CImport Project=\"$(RepoRoot)eng\\custom.props\" Condition=\"Exists('$(RepoRoot)eng\\custom.props')\" \u002F>\n\n\u003C!-- ALSO GOOD: Sdk attribute imports don't need guards (they're required by design) -->\n\u003CProject Sdk=\"Microsoft.NET.Sdk\">\n```\n\n**Exception — required imports**: Imports that are *required* for the build to work correctly should fail fast — don't guard those. Guard imports that are optional or environment-specific (e.g., local developer overrides, CI-specific settings).\n\n**Exception — NuGet package forwarders**: `.props`\u002F`.targets` files inside a NuGet package's per-TFM `build\u002F` or `buildTransitive\u002F` folder routinely import a sibling file under `buildTransitive\u002F\u003Ctfm>\u002F…` without an `Exists()` guard. These are a **package contract**: the target file is guaranteed to be present in the restored package, even if it doesn't appear in the source tree at that relative path. The package layout is typically produced by:\n\n- A custom `.nuspec` with per-TFM `\u003Cfile>` entries — e.g. `\u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>` — that copy files from a single source folder (such as `buildTransitive\u002Fcommon\u002F`) into per-TFM subfolders at pack time, or\n- `\u003CNone Update=\"...\">` \u002F `\u003CContent Include=\"...\">` items in the `.csproj` with a per-TFM `\u003CPackagePath>` (e.g. `\u003CPackagePath>buildTransitive\u002Fnet8.0\u002F\u003C\u002FPackagePath>`), declared once per target TFM, or\n- SDK conventions (e.g. `IncludeBuildOutput`, `BuildOutputTargetFolder`) that place built outputs under `build\u002F\u003Ctfm>\u002F`.\n\nBefore flagging an unguarded `\u003CImport>` inside a `build\u002F` or `buildTransitive\u002F` folder, **resolve it against the packed layout** — read every `*.nuspec` in the project directory **and its immediate parent directory** (shared nuspecs are common in mono-repos; do not walk further up), and any `\u003CPackagePath>` metadata on `\u003CNone>`\u002F`\u003CContent>` items in the `.csproj`. Only flag if the target path is missing from **both** the source tree *and* the projected package layout. The `dotnet-msbuild\u002Fextension-points` skill — *Source tree vs packed layout* — documents the full cross-check procedure.\n\n**Forwarding `buildTransitive\u002F` → `build\u002F`:** forward through the sibling `build\u002F*.props` \u002F `build\u002F*.targets` file (not directly to `buildMultiTargeting\u002F`); when `build\u002F` is per-TFM (`build\u002F\u003Ctfm>\u002F`), include the TFM segment derived from the file's own folder (not `$(TargetFramework)`), or transitive consumers hit `MSB4019`. See the `extension-points` skill — *Forwarding chain* — for the rule and derivation expression.\n\n---\n\n## AP-14: Backslashes in Paths — Where It Matters\n\n**Smell**: Backslash path separators in `.props`\u002F`.targets` files meant to run cross-platform.\n\n**Where this is a real bug (🔴 Error)** — paths that MSBuild does **not** route through its path normalizer:\n\n- Raw shell strings inside `\u003CExec Command=\"...\\tools\\foo.exe ...\" \u002F>` — passed verbatim to `bash`\u002F`sh` on Unix, which treats `\\` as an escape.\n- Backslash-delimited paths inside CDATA blocks, embedded in source files written by `\u003CWriteLinesToFile>`, or constructed for non-MSBuild consumers (custom scripts, response files, environment variables).\n- Paths handed to custom tasks that call OS file APIs directly without going through MSBuild path utilities.\n\n**Where this is only a style preference (🔵 Style)** — paths that go through MSBuild's evaluator (`\u003CImport Project=\"...\">`, file-path properties consumed by built-in tasks like `\u003CCopy>`\u002F`\u003CMakeDir>`\u002F`\u003CDelete>`, item `Include=`\u002F`Exclude=` globs):\n\nMSBuild's evaluator normalizes `\\` → `\u002F` on Unix-like systems before resolving the path. See `FileUtilities.MaybeAdjustFilePath` and `ConvertToUnixSlashes` in [`microsoft\u002Fmsbuild` `src\u002FFramework\u002FFileUtilities.cs`](https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fmsbuild\u002Fblob\u002Fmain\u002Fsrc\u002FFramework\u002FFileUtilities.cs). So `\u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\build\\common.props\" \u002F>` resolves correctly on Linux\u002FmacOS today. Forward slashes are still **preferred for consistency**, but the import will not break and existing backslash-style imports should not be flagged as 🔴 **Error**.\n\n```xml\n\u003C!-- 🔴 Error: \\ in raw shell string breaks on Linux\u002FmacOS -->\n\u003CExec Command=\"$(MSBuildThisFileDirectory)tools\\release\\sign.exe $(OutputPath)\" \u002F>\n\n\u003C!-- 🔵 Style: \\ in Import is normalized on Unix, but \u002F is nicer -->\n\u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\build\\common.props\" \u002F>\n\n\u003C!-- ✅ Recommended in new code -->\n\u003CImport Project=\"$(MSBuildThisFileDirectory)..\u002F..\u002Fbuild\u002Fcommon.props\" \u002F>\n```\n\n**Verification rule**: Before flagging a backslash path as 🔴 **Error**, ask *\"does this string flow through MSBuild's evaluator, or is it handed verbatim to a non-MSBuild consumer?\"* Only the second case is a correctness defect.\n\n**Note**: `$(MSBuildThisFileDirectory)` already ends with a platform-appropriate separator, so `$(MSBuildThisFileDirectory)tools\u002Fmytool` works on both platforms.\n\n---\n\n## AP-15: Unconditional Property Override in Multiple Scopes\n\n**Smell**: A property set unconditionally in both `Directory.Build.props` and a `.csproj` — last write wins silently.\n\n**Why it's bad**: Hard to trace which value is actually used. Makes the build fragile and confusing for anyone reading the project files.\n\n```xml\n\u003C!-- BAD: Directory.Build.props sets it, csproj silently overrides -->\n\u003C!-- Directory.Build.props -->\n\u003CPropertyGroup>\n  \u003COutputPath>bin\\custom\\\u003C\u002FOutputPath>\n\u003C\u002FPropertyGroup>\n\u003C!-- MyProject.csproj -->\n\u003CPropertyGroup>\n  \u003COutputPath>bin\\other\\\u003C\u002FOutputPath>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- GOOD: Use a condition so overrides are intentional -->\n\u003C!-- Directory.Build.props -->\n\u003CPropertyGroup>\n  \u003COutputPath Condition=\"'$(OutputPath)' == ''\">bin\\custom\\\u003C\u002FOutputPath>\n\u003C\u002FPropertyGroup>\n\u003C!-- MyProject.csproj can now intentionally override or leave the default -->\n```\n\n---\n\nFor additional anti-patterns (AP-16 through AP-23) and a quick-reference checklist, see [additional-antipatterns.md](references\u002Fadditional-antipatterns.md).\n",{"name":5,"license":15,"description":7},"master","49e49abf2f670d429e0b7e2c0349739c3fdd5cbe","skills\u002Fmsbuild-antipatterns",5,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium","https:\u002F\u002Fgithub.com\u002Fstanfish06","https:\u002F\u002Fwww.stanfish.dev\u002F","2026-11-14 21:31:37",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add stanfish06\u002Fskillquarium --skill msbuild-antipatterns",{"tool":38,"command":39},"bunx","bunx skills add stanfish06\u002Fskillquarium --skill msbuild-antipatterns",{"tool":41,"command":42},"pnpm","pnpm dlx skills add stanfish06\u002Fskillquarium --skill msbuild-antipatterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmsbuild-antipatterns\u002FSKILL.md",true,[46,52,56],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fadditional-antipatterns.md","REFERENCE","参考文档",19271,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmsbuild-antipatterns\u002Freferences\u002Fadditional-antipatterns.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fincremental-build-inputs-outputs.md",1561,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmsbuild-antipatterns\u002Freferences\u002Fincremental-build-inputs-outputs.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fprivate-assets.md",1041,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmsbuild-antipatterns\u002Freferences\u002Fprivate-assets.md",[61,68,77,84,91,98],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M76ZJTRVA456GD7K8Y3EP82H","zarr-python","Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3\u002FGCS storage, and NumPy\u002FDask\u002FXarray integration. Use for array layout, bounded I\u002FO, format migration, or scientific metadata preservation.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":73,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M76ZJQZ15Q1HKC5V85NHE325","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M76ZJ8ASZ4QYQ70Y6SBA4Z4S","xarray","N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF\u002FGRIB\u002FZarr files, climate\u002Fweather\u002Foceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fxarray\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M76ZHFBXD6VXPQ02VCEG202B","writing-mstest-tests","Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M76ZDFDF4N88RH6HSYGS7GP2","wgs-prs","End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core\u002Fsarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti\u002FTv and Het\u002FHom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwgs-prs\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M76ZCC1SC68J42QK4MDC8RCG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[]]