item-management

Diagnoses and fixes MSBuild item group patterns including batching, transforms, and Include/Remove/Update semantics.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/Netcodr81/kinetic-reports --skill item-management-netcodr81
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: item-management
Source: https://github.com/Netcodr81/kinetic-reports/tree/main/.github/skills/item-management
Command: npx skills add https://github.com/Netcodr81/kinetic-reports --skill item-management-netcodr81

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? MSBuild project files often suffer from subtle item group bugs: duplicate file warnings from SDK globbing, targets running more times than expected due to cross-product batching, and misuse of Include versus Update on SDK-globbed items. This Skill provides canonical patterns from Microsoft.Common.CurrentVersion.targets to diagnose and correct these issues. ## Core Features & Use Cases - Include/Remove/Update Semantics: Explains when to add items, subtract items via set operations, or modify metadata on existing items without re-adding them. - Batching and Transforms: Covers %(Metadata) batching at target and task level, per-item filtering with Condition, and @(Item->'expression') transforms for path mapping. - Pitfall Diagnosis: Identifies cross-product batching (O(N×M) executions), generated files polluting the source tree, and missing FileWrites registration that breaks dotnet clean. - Use Case: A developer sees CS2002 duplicate file warnings after adding generated .cs files. The Skill explains that SDK globbing already includes the files and shows how to write generated output to $(IntermediateOutputPath) and register it in @(FileWrites). ## Quick Start Review my .csproj file and fix the duplicate Compile item warnings and the target that runs once per configuration instead of once total.

Frequently Asked Questions about item-management

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

FAQPage Schema
How do I fix CS2002 duplicate file warnings in MSBuild?▼

CS2002 warnings occur when SDK globbing already includes files that you also add explicitly with Include. Remove the redundant Include, or use Update to modify metadata on the SDK-globbed items instead of re-adding them.

What is the difference between Include, Remove, and Update in MSBuild?▼

Include adds new items to a group, Remove subtracts items matching a pattern, and Update modifies metadata on items already in the group. Update never adds items, so it is the correct choice for SDK-globbed items.

Why does my MSBuild target run more times than expected?▼

Referencing %(Metadata) from two different item groups in the same expression creates cross-product batching, causing O(N×M) executions. Reference one group via batching and pass the other through a property instead.

How do I make generated files work with dotnet clean?▼

Every file created during a target must be added to the @(FileWrites) item group so dotnet clean can remove it. Also write generated files to $(IntermediateOutputPath) rather than the source tree to avoid glob duplication.

When should I not use this item management guidance?▼

This guidance covers item groups only, not target chain architecture, property patterns, or incremental build design. It also does not apply to non-MSBuild build systems such as CMake or Bazel.