incremental-build

Diagnose and fix MSBuild incremental build failures using binlog analysis.

Updated Sep 22, 2026
One-click install
npx skills add https://github.com/bytecakelake/Nurse-Scheduler --skill incremental-build-bytecakelake
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: incremental-build
Source: https://github.com/bytecakelake/Nurse-Scheduler/tree/main/.agents/plugins/dotnet-msbuild/skills/incremental-build
Command: npx skills add https://github.com/bytecakelake/Nurse-Scheduler --skill incremental-build-bytecakelake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Subsequent builds rebuild everything even when nothing changed, wasting developer time. This Skill helps you find why MSBuild targets re-execute unnecessarily and restore fast no-op builds. ## Core Features & Use Cases - Rebuild Diagnosis: Analyze binary logs to find targets that ran instead of being skipped, including the exact input file whose timestamp triggered the rebuild. - Root Cause Coverage: Addresses 8 common causes including missing Inputs/Outputs on custom targets, volatile properties in output paths, unregistered FileWrites, and Visual Studio Fast Up-to-Date Check issues. - Custom Target Authoring: Provides patterns for writing incremental custom targets with stable output paths, FileWrites registration, and correct BeforeTargets hooks. - Use Case: Your dotnet build takes 2 minutes even after changing nothing. Capture two binlogs, search for "Building target completely" messages, identify the offending target, and add proper Inputs/Outputs to make it incremental. ## Quick Start Ask the AI to analyze why my second dotnet build rebuilds everything and help me make my custom targets incremental.

Frequently Asked Questions about incremental-build

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

FAQPage Schema
How do I find out why MSBuild rebuilds when nothing changed?▼

Build twice with binary logs using dotnet build /bl:first.binlog and /bl:second.binlog, then search the second log for "Building target completely" and "is newer than output" messages. These reveal which targets ran and which input file triggered the rebuild.

How to make a custom MSBuild target incremental?▼

Add both Inputs and Outputs attributes to the target so MSBuild compares file timestamps and skips it when outputs are newer. Register generated files in the FileWrites item group and write outputs to $(IntermediateOutputPath) for clean support.

Why does my project rebuild in Visual Studio but not on the command line?▼

Visual Studio uses its own Fast Up-to-Date Check separate from MSBuild's Inputs/Outputs mechanism, which can be wrong for custom targets or non-standard item types. Set DisableFastUpToDateCheck to true or enable verbose up-to-date check logging to diagnose.

What is the FileWrites item group in MSBuild?▼

FileWrites tracks files generated during the build so dotnet clean can remove them. Files created by custom targets but not registered accumulate across builds and can confuse incremental up-to-date checks.

When should I use Returns instead of Outputs on an MSBuild target?▼

Use Returns when you only need to pass items to calling targets without affecting incremental build checks. Outputs serves double duty as both the incremental timestamp comparison and the return value, while Returns only affects the return value.