build-parallelism
MSBuildのビルド並列化とマルチプロジェクトのスケジューリング最適化をガイドするスキルです。全CPUコアが活用されていないビルド、`-m`フラグを使っても改善しない問題、`/graph`によるグラフビルドモードの評価、プロジェクト依存関係トポロジの把握など、MSBuild/.NETビルド環境での並列化チューニングが必要な場面で使用してください。`/maxcpucount`の設定、グラフビルドによるスケジューリング改善、`BuildInParallel`オプション、不要な`ProjectReference`の削減、ソリューションフィルター(`.slnf`)を活用したサブセットビルドをカバーします。単一プロジェクトのビルドや、インクリメンタルビルドの問題・プロジェクト内コンパイル速度の問題には使用しないでください。
description の原文を見る
Guide for optimizing MSBuild build parallelism and multi-project scheduling. Only activate in MSBuild/.NET build context. USE FOR: builds not utilizing all CPU cores, speeding up multi-project solutions, evaluating graph build mode (/graph), build time not improving with -m flag, understanding project dependency topology. Note: /maxcpucount default is 1 (sequential) — always use -m for parallel builds. Covers /maxcpucount, graph build for better scheduling and isolation, BuildInParallel on MSBuild task, reducing unnecessary ProjectReferences, solution filters (.slnf) for building subsets. DO NOT USE FOR: single-project builds, incremental build issues (use incremental-build), compilation slowness within a project (use build-perf-diagnostics), non-MSBuild build systems. INVOKES: dotnet build -m, dotnet build /graph, binlog analysis.
SKILL.md 本文
MSBuild Parallelism Model
/maxcpucount(or-m): number of worker nodes (processes)- Default: 1 node (sequential!). Always use
-mfor parallel builds - Recommended:
-mwithout a number = use all logical processors - Each node builds one project at a time
- Projects are scheduled based on dependency graph
Project Dependency Graph
- MSBuild builds projects in dependency order (topological sort)
- Critical path: longest chain of dependent projects determines minimum build time
- Bottleneck: if project A depends on B, C, D and B takes 60s while C and D take 5s, B is the bottleneck
- Diagnosis: replay binlog to diagnostic log with
performancesummaryand check Project Performance Summary — shows per-project time; grep fornode.*assignedto check scheduling - Wide graphs (many independent projects) parallelize well; deep graphs (long chains) don't
Graph Build Mode (/graph)
dotnet build /graphormsbuild /graph- What it changes: MSBuild constructs the full project dependency graph BEFORE building
- Benefits: better scheduling, avoids redundant evaluations, enables isolated builds
- Limitations: all projects must use
<ProjectReference>(no programmatic MSBuild task references) - When to use: large solutions with many projects, CI builds
- When NOT to use: projects that dynamically discover references at build time
Optimizing Project References
- Reduce unnecessary
<ProjectReference>— each adds to the dependency chain - Use
<ProjectReference ... SkipGetTargetFrameworkProperties="true">to avoid extra evaluations <ProjectReference ... ReferenceOutputAssembly="false">for build-order-only dependencies- Consider if a ProjectReference should be a PackageReference instead (pre-built NuGet)
- Use
solution filters(.slnf) to build subsets of the solution
BuildInParallel
<MSBuild Projects="@(ProjectsToBuild)" BuildInParallel="true" />in custom targets- Without
BuildInParallel="true", MSBuild task batches projects sequentially - Ensure
/maxcpucount> 1 for this to have effect
Multi-threaded MSBuild Tasks
- Individual tasks can run multi-threaded within a single project build
- Tasks implementing
IMultiThreadableTaskcan run on multiple threads - Tasks must declare thread-safety via
[MSBuildMultiThreadableTask]
Analyzing Parallelism with Binlog
Step-by-step:
- Replay the binlog:
dotnet msbuild build.binlog -noconlog -fl -flp:v=diag;logfile=full.log;performancesummary - Check Project Performance Summary at the end of
full.log - Ideal: build time should be much less than sum of project times (parallelism)
- If build time ≈ sum of project times: too many serial dependencies, or one slow project blocking others
grep 'Target Performance Summary' -A 30 full.log→ find the bottleneck targets- Consider splitting large projects or optimizing the critical path
CI/CD Parallelism Tips
- Use
-min CI (many CI runners have multiple cores) - Consider splitting solution into build stages for extreme parallelism
- Use build caching (NuGet lock files, deterministic builds) to avoid rebuilding unchanged projects
dotnet build /graphworks well with structured CI pipelines
ライセンス: MIT(寛容ライセンスのため全文を引用しています) · 原本リポジトリ
詳細情報
- 作者
- dotnet
- リポジトリ
- dotnet/skills
- ライセンス
- MIT
- 最終更新
- 不明
Source: https://github.com/dotnet/skills / ライセンス: MIT
関連スキル
newsblur-cli
ターミナルからNewsBlurを管理できます。フィードの閲覧、ストーリーの検索、記事の保存・共有、インテリジェンス分類器の学習、新しいフィードの発見、ワークフローの自動化がNewsBlur CLIで実現します。ユーザーがNewsBlurアカウントを操作したい場合、フィードの確認、購読管理、またはニュース読み込みに関するスクリプト構築時に活用してください。
caveman-compress
自然言語のメモリファイル(CLAUDE.md、todos、preferences)を「原始人形式」に圧縮し、入力トークンを削減します。技術的な内容、コード、URL、構造はすべて保持したまま圧縮します。圧縮版が元のファイルを上書きし、人間が読める形のバックアップはFILE.original.mdとして保存されます。トリガー:/caveman-compress FILEPATH または「compress memory file」
find-skills
日本語の意図から Agent Skills を発見する。「楽天SEOのスキル探して」「PDFを処理したい」「データ分析を自動化したい」などの日本語リクエストに対応。Claude Code (CLI)、Codex、Gemini CLI、claude.ai (Web) いずれでも動作。日本最大の Agent Skills データベース「Agent Skills by ALSEL」(11,000件超、全件日本語化、ダウンロード可能スキル8,600件超) から、ユーザーの意図に合うスキルを推薦・インストール案内する。
planning-and-task-breakdown
仕事を順序立てたタスクに分割します。仕様書や要件が明確にあり、実装可能なタスクに分解する必要がある場合に利用してください。タスクが大きすぎて着手しづらい場合、スコープを見積もる必要がある場合、または並列で作業を進められる場合に活用できます。
docx
このスキルは、ユーザーがWord文書(.docxファイル)を作成、読み込み、編集、操作したいときに使用します。以下の場合に実行してください:「Word文書」「.docx」などの記述、または目次・見出し・ページ番号・レターヘッドなどのフォーマットを含む専門的な文書の作成リクエスト。また、.docxファイルのコンテンツ抽出・再編成、文書への画像挿入・置換、Word形式での検索置換、変更履歴やコメント機能の使用、コンテンツを整形したWord文書への変換の場合も対象です。ユーザーが「レポート」「メモ」「手紙」「テンプレート」などの成果物をWord形式または.docxファイルで求める場合はこのスキルを使用してください。PDF、スプレッドシート、Google Docs、文書作成と無関係なコーディングタスクには使用しないでください。
idea-refine
アイデアを反復的に改善します。構造化された発散的思考と収束的思考を通じて、アイデアを洗練させることができます。「idea-refine」または「ideate」を使用してトリガーします。