Official agent skill

Msbuild

by dotnet in dotnet/skills

Use only for MSBuild failure investigation, build-performance analysis, or review of existing build XML/extension contracts.

OfficialMITAuto-check passedDevelopment

Install Msbuild

skills CLI
$ npx skills add dotnet/skills --skill msbuild -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dotnet/skills msbuild --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dotnet/skills/msbuild .claude/skills/msbuild && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
msbuild
GitHub stars
5.6k
Used in
1 other repo
Token cost
~2.2k tokens
SKILL.md length
957 words
Files
13 (incl. references)
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Use only for MSBuild failure investigation, build-performance analysis, or review of existing build XML/extension contracts.

  • Works in 3 steps: Troubleshoot build issues → Diagnose and improve build performance → Review build authoring
  • Tasks that involve Refactoring
  • SKILL.md covers Start with the task and evidence, 1. Troubleshoot build issues, 2. Diagnose and improve build… and 3. Review build authoring, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Msbuild is an agent skill from dotnet/skills, published by the product's own GitHub organization. Use only for MSBuild failure investigation, build-performance analysis, or review of existing build XML/extension contracts. A plan to convert a working legacy/non-SDK project to SDK style or migrate packages.config is a project-system migration, NOT a build-file review: do not activate, even to check scope. Framework/API upgrades are also excluded. Activate for advisory Import/Exists hook and NuGet packed-import questions even without a checkout or failed build; .csproj/.fsproj/.vbproj/.props/.targets…

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including reference files (for example `references/antipatterns/additional-antipatterns.md`, `references/antipatterns/incremental-build-inputs-outputs.md` and `references/antipatterns/private-assets.md`).

It sits in Development, covering Refactoring. It works with C# and .NET. The repository describes itself as: Repository for skills to assist AI coding agents with .NET and C. The licence is MIT.

When your agent uses it

  • Tasks that involve Refactoring

Example prompts

  • “/msbuild”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Troubleshoot build issues
  2. Diagnose and improve build performance
  3. Review build authoring

What it can do on your machine

Read from SKILL.md and the folder at commit 8d670fa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Msbuild loads about 2.2k tokens when it runs, and up to ~33k if it reads all its reference files. Until then it costs about 219 tokens; SKILL.md has 957 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~219
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~33k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dotnet/skills at commit 8d670fa, republished under its MIT licence (© dotnet). 957 words, ~2,248 tokens.

Download SKILL.mdSave it as .claude/skills/msbuild/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.
name
msbuild
description
Use only for MSBuild failure investigation, build-performance analysis, or review of existing build XML/extension contracts. A plan to convert a working legacy/non-SDK project to SDK style or migrate packages.config is a project-system migration, NOT a build-file review: do not activate, even to check scope. Framework/API upgrades are also excluded. Activate for advisory Import/Exists hook and NuGet packed-import questions even without a checkout or failed build; .csproj/.fsproj/.vbproj/.props/.targets conditions; custom-target inputs/outputs; .binlog capture/replay; failing dotnet build/restore/pack/publish or MSBuild-based test builds; slow evaluation, compilation, copying, or no-change builds; and controlled timing comparisons. Exclude SDK installation alone, C# refactoring, runtime profiling, assertions after successful builds, and non-MSBuild builds.
license
MIT

MSBuild troubleshooting

This is the entry skill. Choose troubleshooting, performance, or authoring review, then read only the relevant local references. The references retain the content and identities of the original MSBuild skills, with correctness fixes; they are not separate skills to activate.

Start with the task and evidence

For tasks that need a checkout, discover the relevant project/solution, shared build files, SDK selection, and repository build instructions in the current workspace. Preserve the original command, working directory, configuration, target framework, runtime identifier, global properties, and target. Ask only for consequential information that cannot be discovered.

An existing .binlog can be the only available artifact. Analyze it before requesting a new build; paths inside it do not prove a checkout exists locally. For a self-contained static review or advisory question, use the supplied XML and relevant references; do not require a checkout, restore, build, or binlog.

For a mixed request, fix correctness before measuring successful builds, and keep authoring review separate from a performance experiment. A failing test assertion after a successful build is not an MSBuild failure.

1. Troubleshoot build issues

Goal: identify the independent root causes and make the smallest repair, not a broad cleanup.

SituationReadAction
A build failed and a binary log existsbinlog-failure-analysisReplay the log with MSBuild; connect errors to the responsible project instance, target, and task. Separate root causes from cascading failures.
The failure needs evidence and no matching log existsbinlog-generation, then failure analysisCapture the original invocation once, verify the artifact, and analyze it.
A project/build file has incorrect conditions, items, properties, or output pathsmsbuild-antipatternsSelect the relevant catalog entries and check their exceptions before changing anything.
Imports or build hooks are missing, overwritten, or run in the wrong orderextension-pointsInspect the import contract, discovery order, and packed NuGet layout rather than hiding a required failure.
Outputs are stale or required work is skippedincremental-buildProve which input, output, timestamp, item, or condition makes the decision wrong. Correctness takes priority over speed.

After a repair, rerun the original failing scenario and check affected dependents. If only a log is available, provide an evidence-backed proposed fix and say it was not applied or rebuilt. Do not turn a targeted failure investigation into solution-wide authoring cleanup.

2. Diagnose and improve build performance

Goal: measure the reported scenario, identify its bottleneck, change one cause, and compare equivalent builds without losing required behavior.

  1. Reuse matching measurements. If they are missing, establish the relevant baseline before editing configuration; do not time a failed build as a successful baseline.
  2. Classify evaluation versus target/task execution. Inclusive target totals and dependency waits are not additive wall time or proof of CPU utilization.
  3. Follow the measured branch below. Do not apply every optimization in every reference.
  4. Repeat the same scenario, command, input change, and instrumentation. Report spread/noise and correctness checks; an isolated faster run is not proof of improvement.
SituationReadKeep distinct
No trustworthy before/after measurements, or a baseline/controlled optimization is requestedbuild-perf-baselineCold-output, warm changed-input, and no-change builds; restore/cache state; ordinary Build versus forced Rebuild.
The expensive work is not yet identified, or compiler/analyzer/reference/restore time dominatesbuild-perf-diagnosticsActual task cost versus orchestration waits, overlapping durations, and missing instrumentation.
Time is spent before target execution, in globs, imports, or property evaluationeval-performanceEvaluation versus execution; legitimate versus accidental project instances.
Content copies or output I/O dominatecopy-to-output-directoryCopy mode/version support, unchanged copies, and the intended handling of a modified destination.
A second unchanged build recompiles/regenerates, or incremental behavior is brokenincremental-buildExpected invalidation versus missing tracking; changed/added/removed inputs and missing outputs.

Stop when the suspected bottleneck is not supported by evidence, results fall within noise, or correctness regresses. Report missing measurements rather than manufacturing a complete baseline.

Show full SKILL.md (333 more words)Show less

3. Review build authoring

Goal: improve project/build-file structure and extension contracts while preserving behavior. This route means MSBuild authoring cleanup, not an implicit framework, package, language, or legacy project-system migration.

Requested changeReadPreserve
Review/clean up project files, shared properties, item declarations, or custom targetsmsbuild-antipatternsIntentional overrides, F# source order, required imports, package assets, and actual input/output contracts.
Review/improve hooks, imports, shared-file discovery, or NuGet build extensionsextension-pointsPrior hooks, evaluation order, direct/transitive consumer behavior, and the packed layout.
Restructure generation or copying as part of cleanupincremental-build and copy-to-output-directory, as applicableFirst-build and no-change behavior, invalidation, generated-item registration, and output completeness.

Record the existing contract before editing. Review only relevant catalog entries; a matching text pattern is not proof of a defect. Leave already-correct patterns unchanged. Validate the original configurations, relevant consumers, and affected incremental/pack/publish behavior.

Shared evidence and safety

  • For capture-only requests, use binlog-generation, report the new artifact and original exit code, and stop. For analysis, use MSBuild replay, never binary-file text parsing. Replay success and replay duration are not the recorded build's result or duration.
  • Resolve these files relative to this skill. Do not load the original plugin's skills or search other installations/checkouts. If a bundled reference is missing, allow one listing of references, report the gap, and do not pretend its guidance was followed.
  • Do not clean outputs/caches, stop shared build servers, disable diagnostics, change SDKs, or serialize builds as generic fixes. Scope any necessary destructive experiment to approved, owned outputs. Keep binary and replayed logs local unless sharing is authorized.
  • Distinguish recorded facts from hypotheses. Missing source, log detail, tools, or platform support must be reported explicitly, not replaced with assumed values or invented verification.

Completion

Return the selected task, the cause/bottleneck or authoring decision, supporting evidence, and the minimal change made or proposed. State when no change is needed. Give the exact verification and result, distinguishing successful, failed, and not-run checks; performance work also needs comparable measurements and uncertainty. Keep the response proportional to the task.

© dotnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 12 other files (references) in plugins/dotnet/skills/msbuild of dotnet/skills.

  • SKILL.md
  • references/antipatterns/additional-antipatterns.md
  • references/antipatterns/incremental-build-inputs-outputs.md
  • references/antipatterns/private-assets.md
  • references/binlog-failure-analysis.md
  • references/binlog-generation.md
  • references/build-perf-baseline.md
  • references/build-perf-diagnostics.md
  • references/copy-to-output-directory.md
  • references/eval-performance.md
  • references/extension-points.md
  • references/incremental-build.md
  • references/msbuild-antipatterns.md

Open the folder on GitHubat commit 8d670fa

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in dotnet/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Msbuild next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Msbuild compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Msbuild this skilldotnet/skills5.6k1 repos~2.2kAutomated safety check: PassMIT
Add Refactoringdotnet/roslynator3.5k—~946Automated safety check: PassCustom licence
Dynamo Dotnet ExpertDynamoDS/Dynamo2k—~909Automated safety check: PassApache-2.0
Deprecate Analyzer Or Refactoringdotnet/roslynator3.5k—~511Automated safety check: PassCustom licence
Okojo Test262akeit0/okojo160—~742Automated safety check: PassMIT
Dotnet10 Featuresrunceel/ReactiveProperty944—~2.7kAutomated safety check: PassMIT

Similar skills

  • Add Refactoring

    dotnet/roslynator

    Official

    A skill your agent uses when adding a new RR refactoring in roslynator, editing Refactorings.xml, registering in RefactoringContext, or when refactorings-testing.md shows XunitRefactoringVerifier —…

    3.5k GitHub stars~946 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Dynamo Dotnet Expert

    DynamoDS/Dynamo

    Write and review C/.NET code in Dynamo following Dynamo coding standards, modern C patterns, and repo conventions.

    2k GitHub stars~909 tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when obsoleting or retiring RCS, RR, or RCF in roslynator, replacing an analyzer with another id, or when tempted to use IsObsolete on an Analyzer entry — analyzers use…

    3.5k GitHub stars~511 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Okojo Test262

    akeit0/okojo

    Run and continue Okojo Test262 compliance work. An agent skill from akeit0/okojo.

    160 GitHub stars~742 tokensUpdated 16 days ago
    DevelopmentAuto-check passed
  • Dotnet10 Features

    runceel/ReactiveProperty

    Reference for the .NET 10 / C 14 features that are relevant to the ReactiveProperty repository.

    944 GitHub stars~2.7k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Refactor Analysis

    Samsung/TizenFX

    Automatically scans the TizenFX codebase on a rotating schedule to discover .NET 8 / C 12+ refactoring targets and register them as GitHub Issues.

    214 GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed

More from dotnet/skills

All 91 skills in this repo
  • Official

    Resolves .NET runtime frames in Apple .ips crash logs to function names, source files and line numbers using dSYM symbols, atos and the Microsoft symbol server.

    5.6k GitHub starsUsed in 1 repo~2.4k tokens
    Auto-check passed
  • Official

    Resolves native crash frames from .NET Android tombstones to function names, source files and line numbers using BuildIds, Microsoft's symbol server and llvm-symbolizer.

    5.6k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Official

    Scans C# and .NET code for about 50 performance anti-patterns and reports prioritized findings with concrete fixes, at a scan depth you choose.

    5.6k GitHub starsUsed in 3 repos~3.1k tokens
    Auto-check passed
  • Official

    Statically pairs source files with test files to list code that no test references, using Roslyn for C# or tree-sitter for many languages, with no build.

    5.6k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Microbenchmarking

    dotnet/skills

    Official

    Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks.

    5.6k GitHub starsUsed in 3 repos~3.3k tokens
    Auto-check passed
  • Official

    Makes .NET projects compatible with Native AOT and trimming by resolving IL trim and AOT analyzer warnings through annotations rather than suppressions.

    5.6k GitHub starsUsed in 2 repos~4.2k tokens
    Auto-check passed

Works with

Categories

Questions about Msbuild

What does Msbuild do?

Use only for MSBuild failure investigation, build-performance analysis, or review of existing build XML/extension contracts. Msbuild is an agent skill from dotnet/skills, published by the product's own GitHub organization. Use only for MSBuild failure investigation, build-performance analysis, or review of existing build XML/extension contracts.

When should I use Msbuild?

Msbuild fits situations like: tasks that involve Refactoring.

How do I install Msbuild in Claude Code?

Run `npx skills add dotnet/skills --skill msbuild -a claude-code`. Or copy the skill folder (plugins/dotnet/skills/msbuild in dotnet/skills) into .claude/skills/msbuild in your project. Claude Code loads it when a task matches its description.

How do I install Msbuild in Codex?

Run `npx skills add dotnet/skills --skill msbuild -a codex`. Or copy the skill folder (plugins/dotnet/skills/msbuild in dotnet/skills) into .agents/skills/msbuild in your project. Codex loads it when a task matches its description.

Can I use Msbuild in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dotnet/skills --skill msbuild -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/msbuild, .gemini/skills/msbuild, .github/skills/msbuild and .opencode/skills/msbuild in your project.

What does Msbuild need to run?

SKILL.md names no scripts, command-line tools or credentials: Msbuild is instructions for the agent only.

Does Msbuild access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Msbuild safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Msbuild use?

Msbuild is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Msbuild use?

About 2.2k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 30k tokens, read only when the agent opens those files.

What are the alternatives to Msbuild?

Skills that share tags, products or a category with Msbuild: Add Refactoring (dotnet/roslynator, 3.5k stars), Dynamo Dotnet Expert (DynamoDS/Dynamo, 2k stars), Deprecate Analyzer Or Refactoring (dotnet/roslynator, 3.5k stars) and Okojo Test262 (akeit0/okojo, 160 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Msbuild?

dotnet (a GitHub organization, an official publisher) maintains it in dotnet/skills, which has 5,568 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 7, 2026.

Source: dotnet/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.