msbuild-antipatterns

msbuild-antipatterns is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 184 tokens per session (4,630 once invoked), scanned A, a copy of msbuild-antipatterns, MIT.

A catalogue of common mistakes in MSBuild project and build files. It shows what each pattern looks like, why it causes problems, and how to replace it with a safer approach.

In plain words
What is it for?
Use it to review .csproj, .vbproj, .fsproj, .props, and .targets files and replace fragile shell commands or other anti-patterns.
Why use it?
It helps uncover build-file problems that make projects slower, harder to maintain, or inconsistent across systems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review .csproj, .vbproj, .fsproj, .props, and .targets files and replace fragile shell commands or other anti-patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/msbuild-antipatterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add managedcode/dotnet-skills --skill msbuild-antipatterns
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for msbuild-antipatterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/msbuild-antipatterns/github.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/msbuild-antipatterns)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/msbuild-antipatterns"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/msbuild-antipatterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for msbuild-antipatterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/msbuild-antipatterns"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/msbuild-antipatterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 184 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,630 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00184 $0.04630
Opus 5.5 $0.00074 $0.01852
Sonnet 5.5 $0.00037 $0.00926
Haiku 4.5 $0.00018 $0.00463

Measured 1mo ago against content hash 9bd1780bd671, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

msbuild-antipatterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to msbuild-antipatterns — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Tools/Official-DotNet-MSBuild/skills/msbuild-antipatterns/SKILL.md · 419 lines

How it starts

The opening of the file, as written. The whole thing — 419 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MSBuild Anti-Pattern Catalog

A numbered catalog of common MSBuild anti-patterns. Each entry follows the format:

  • Smell: What to look for
  • Why it's bad: Impact on builds, maintainability, or correctness
  • Fix: Concrete transformation

Use this catalog when scanning project files for improvements.

Review output contract

For review, audit, maintainability, or correctness-risk requests:

  1. Do not edit files unless the user explicitly asks for fixes.
  2. Return prioritized findings grounded in the supplied file, with impact and a targeted recommendation.
  3. Separate confirmed defects from conditional risks and already-correct patterns.
  4. Keep the final answer as the review; do not replace it with a terse summary of changes.

AP-01: <Exec> for Operations That Have Built-in Tasks

Smell: <Exec Command="mkdir ..." />, <Exec Command="copy ..." />, <Exec Command="del ..." />

Why it's bad: Built-in tasks are cross-platform, support incremental build, emit structured logging, and handle errors consistently. <Exec> is opaque to MSBuild.

<!-- BAD -->
<Target Name="PrepareOutput">
  <Exec Command="mkdir $(OutputPath)logs" />
  <Exec Command="copy config.json $(OutputPath)" />
  <Exec Command="del $(IntermediateOutputPath)*.tmp" />
</Target>

<!-- GOOD -->
<Target Name="PrepareOutput">
  <MakeDir Directories="$(OutputPath)logs" />
  <Copy SourceFiles="config.json" DestinationFolder="$(OutputPath)" />
  <Delete Files="@(TempFiles)" />
</Target>

Built-in task alternatives:

Shell Command MSBuild Task
mkdir <MakeDir>
copy / cp <Copy>
del / rm <Delete>
move / mv <Move>
echo text > file <WriteLinesToFile>
touch <Touch>
xcopy /s <Copy> with item globs

AP-02: Unquoted Condition Expressions

Smell: Condition="$(Foo) == Bar" — either side of a comparison is unquoted.

Why it's bad: If the property is empty or contains spaces/special characters, the condition evaluates incorrectly or throws a parse error. MSBuild requires single-quoted strings for reliable comparisons.

Read the full file on GitHub · 419 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +9 lines · +42 tokens per session 9bd1780bd671
  2. 2mo ago First seen · 410 lines · 142 tokens per session scan A 08b36b41196b

Subscribe to this mod's changes

msbuild-antipatterns is a skill published in the GitHub repository managedcode/dotnet-skills (527 stars, last pushed 16d ago), licensed MIT. It adds 184 tokens to every session and 4,630 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to msbuild-antipatterns, differing in 0 lines, and is treated as a copy.

Related

msbuild-antipatterns compared with skills from other repositories

msbuild-antipatterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
msbuild-antipatternsmanagedcode/dotnet-skillsSkill52716d agoMITA184Claude Code, Codex
windbg-kernel-lock-deadlock-triagemicrosoft/win-dev-skillsSkill52113d agoMITA56Claude Code
fuzzy-selectingSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A25Claude Code, Codex
rust-developmentnavikt/copilotSkill65yesterdayMITA27Claude Code, Codex
spring-boot-scaffoldnavikt/copilotSkill65yesterdayMITA32Claude Code, Codex
tlc-discovertech-leads-club/agent-skillsSkill7.2k3d agononeA76Claude Code, Codex
repo-baseline-auditnavikt/copilotSkill65yesterdayMITA122Claude Code, Codex