msbuild-antipatterns

Identify MSBuild anti-patterns in .props, .targets, and .csproj files.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill msbuild-antipatterns-1k-off
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: msbuild-antipatterns
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/msbuild-antipatterns
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill msbuild-antipatterns-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you identify common MSBuild mistakes that cause brittle, slow, or non-portable builds and then guides you to correct patterns directly in your project files.

Core Features & Use Cases

  • Detects frequent MSBuild anti-patterns: such as using <Exec> where built-in tasks exist, unquoted conditions, hardcoded absolute paths, redundant SDK default properties, and manual <Compile Include=...> in SDK-style projects.
  • Provides concrete BAD→GOOD fix recipes for each anti-pattern so you can apply safe transformations consistently across .csproj, .vbproj, .fsproj, .props, .targets, and .proj files.
  • Covers build hygiene and correctness topics like PrivateAssets for analyzer/tool packages, central package versioning, incremental build Inputs/Outputs, and evaluation-order pitfalls.

Quick Start

Ask the AI to scan your .csproj/.props/.targets files for MSBuild anti-patterns and output a list of specific BAD→GOOD transformations you can paste back into the project.

Frequently Asked Questions about msbuild-antipatterns

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

FAQPage Schema
What are common MSBuild anti-patterns in .csproj files?

Common MSBuild anti-patterns include using `<Exec>` where built-in tasks exist, unquoted conditions, hardcoded absolute paths, redundant SDK defaults, and manual `<Compile Include>` entries in SDK-style projects, all of which cause brittle or slow builds.

How do I fix unquoted MSBuild conditions and absolute paths in .props and .targets files?

You fix unquoted MSBuild conditions and absolute paths by applying concrete BAD→GOOD transformations, replacing hardcoded values with relative paths and wrapping condition expressions in quotes to ensure portable and deterministic builds.

Does this MSBuild cleanup approach work with .vbproj and .fsproj project files?

Yes, this MSBuild cleanup approach works across `.csproj`, `.vbproj`, `.fsproj`, `.props`, `.targets`, and `.proj` files, applying safe transformations consistently across all common .NET project file types.

What's the best way to configure PrivateAssets for analyzer packages in MSBuild?

The best way to configure PrivateAssets for analyzer and tool packages is to apply the correct BAD→GOOD remediation recipe, ensuring build hygiene and preventing unintended runtime dependency leakage in your .NET builds.

Why are my incremental builds failing due to missing Inputs and Outputs in MSBuild?

Incremental builds fail when MSBuild tasks lack proper `Inputs` and `Outputs` attributes, causing unnecessary rebuilds; fixing this evaluation-order hazard ensures tasks only run when dependencies actually change.

How do I resolve legacy HintPath references and central package version drift in dotnet builds?

You resolve legacy HintPath references and central package version drift by applying targeted remediation transformations that replace outdated references with centralized package versioning for deterministic .NET build contexts.