Command Palette

Search for a command to run...

Назад к скиллам
скилл № 17289

find-repeated-work-within-one-build

Use ONLY for auditing executed-task counts or batching/hoisting costs within ONE MSBuild invocation: per-project Exec, duplicate dependency builds, per-item…

БесплатноБез исполняемых скриптов
dotnetот dotnet★ 6 430 звёзд на GitHub

Установить find-repeated-work-within-one-build в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Find Repeated Work Within One Build

MSBuild runs targets once per project instance. Work that does not depend on the project, but sits in Directory.Build.targets or a shared target, therefore runs once per project: a git rev-parse in 40 projects is 40 process launches. A project built with different global properties is a different instance, so a shared library can compile several times in one build. The binlog's N calls column shows both. This skill finds the repeats, separates them from work that is legitimately per project, and removes only what is safe to remove.

When to Use

  • The same Exec or task (version stamping, tool probes, file generation) runs in every project
  • Target or Task Performance Summary shows a call count far above the number of projects that need the work
  • The same project executes its build targets repeatedly under global-property sets that do not change its outputs
  • An Exec spawns one process per item in a list
  • A "run once per build" guard (Exists check, flag property) still runs repeatedly or fails with file-in-use errors under -m

When Not to Use

  • Targets that run again on a second, unchanged build: use incremental-build
  • Slow evaluation before any target runs: use eval-performance
  • Required project variants colliding in shared bin/obj directories: use check-bin-obj-clash
  • Idle nodes or a serial dependency chain: use build-parallelism
  • NuGet restore repeated across separate dotnet restore, dotnet build and dotnet test commands: use eliminate-redundant-restores
  • Unranked "why is my build slow": start with build-perf-baseline, then build-perf-diagnostics

Workflow

Step 1: Count executions

Use a supplied performance summary with execution counts as valid input; a raw binlog is not required. If the user cannot run the build or forbids execution or new logs, work from the summary and repository files. Mark unavailable timing or overlap evidence unknown and proposed fixes not validated; do not execute a build or collect another log.

If neither usable execution counts nor a binlog is supplied, capture one only when build execution is available and permitted. Use the binlog-generation skill: add /bl:{} to the original MSBuild invocation, preserving its configuration, global properties, parallelism and restore behavior. In PowerShell, quote the complete switch as '-bl:{}'. If a script drives the build, instrument its underlying MSBuild invocation rather than replace it with a different build command. Confirm the binlog exists and record its path. If capture is not permitted, report the missing evidence instead of running the build.

For an available binlog, prefer the bundled binlog MCP server (Microsoft.AITools.BinlogMcp, exposed under the binlog MCP namespace). Discover its available tools and query project, target and task execution counts and timings from that binlog. Do not read the binary file as text.

If MCP is unavailable or its tools do not expose execution counts, replay the captured binlog to a text performance summary and read the N calls column of the Target and Task Performance Summaries and the Project Performance Summary:

dotnet msbuild build.binlog -noconlog "-flp:v=diag;logfile=full.log;performancesummary"

Count required distinct computations, not just consumers. Derive the expected count separately for each kind of work: Csc normally runs once per project and target framework, whereas copy-local work scales with files and can run in several targets. Project count times TFMs is not a universal ceiling for every task; leave an unsupported expected count unknown rather than claiming that a larger count is redundant. A multi-targeted project can legitimately show one outer build plus one inner build per TFM, so four project calls for three TFMs are not automatically duplicates. Account for required TFMs and global properties before investigating extra instances.

An invariant tool-version or revision probe needs one computation per equivalent input scope, even when several projects consume its result. A target condition restricting it to a subset of projects does not make the result per-project. Confirm that inputs, working directories, relevant properties and output semantics are equivalent; identical command text alone does not prove invariance. In particular, fresh per-project signing identities are intentionally nondeterministic: do not cache, reuse or share one identity across projects or builds. Keep each required execution unless a documented tool mode can produce all the distinct results without changing the contract.

Step 2: Classify each candidate

Pattern Signal Fix Never
Invariant per-project Exec or task (commit hash, tool version, generated file) Multiple consumers need the same deterministic result under equivalent inputs Compute it once outside the per-project targets: the build script passes -p:Name=value, or a p
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл find-repeated-work-within-one-build?

Use ONLY for auditing executed-task counts or batching/hoisting costs within ONE MSBuild invocation: per-project Exec, duplicate dependency builds, per-item generators, run-once races. NEVER load for evaluation-only global-property variants with once-only target/task execution, idle-node/serial-chain investigations, second/unchanged builds, restores across commands, required-variant bin/obj collisions or unranked slowness. Do not load to check scope or replace an unavailable specialist; answer directly.

Как установить скилл find-repeated-work-within-one-build?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл find-repeated-work-within-one-build запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить find-repeated-work-within-one-build с