agentleFS
MicrosoftKnown publishermicrosoft/microsoft-ui-xaml/.github/skills/build/SKILL.md

build

Skill8.5k starsChanged 2 months agoMITView on GitHub

Build the WinUI repository. Use when asked to build, compile, or rebuild the project after making code changes.

76 other projects use a version of this.

Trending

Quiet since August.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/microsoft-ui-xaml repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about microsoft/microsoft-ui-xaml

The biggest 5 of 24 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 24

Talked about on GitHub, Hacker News and Bluesky (24 times).

On GitHub · 12

7 more on GitHub

On Hacker News · 11

6 more on Hacker News

On Bluesky · 1

Used with

Projects with it also use incident, experiment and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • pvnarpSkill

    incident

    Guides incident response and post-mortem analysis. Covers triage, mitigation, root cause analysis, and prevention. Use when responding to active incidents, writing post-mortems, or improving incident processes.

    Also in 3 projects that use this

  • sunnnybalaSkill

    experiment

    Design and run ML experiments on cloud GPUs. Generates experiment code, runs on Modal, tracks results in JSONL. Use when asked to "run experiments", "train a model", "test this hypothesis", or "benchmark this approach". Proactively invoke when the user has a refined research idea and needs to validate it experimentally.

    Also in 3 projects that use this

  • SentrySkill

    spec

    Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.

    Also in 9 projects that use this

  • AnthropicSkill

    brief

    Generate contextual briefings for legal work — daily summary, topic research, or incident response. Use when starting your day and need a scan of legal-relevant items across email, calendar, and contracts, when researching a specific legal question across internal sources, or when a developing situation (data breach, litigation threat, regulatory inquiry) needs rapid context.

    Also in 5 projects that use this

  • AnasX7Skill

    improve

    Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.

    Also in 4 projects that use this

  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 17 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always prefix with .\initrun.ps1, this sets up critical environment variables and sanity-checks the environment

    line 22
  2. Very specific:

    Always pass /q for quiet output (errors only)

    line 23
  3. Very specific:

    Only use mux or a single project when the user asks for a specific component or when you know exactly which files changed.

    line 26
  4. Distinctive:

    When you see that error, run a full init for the needed flavor:

    line 33
  5. Very specific:

    After init completes, retry the original initrun.ps1 build command.

    line 44
  6. Distinctive:

    If you get build errors that seem to indicate missing dependencies, that might mean you don't have a fresh "init".

    line 46
  7. Very specific:

    Test areas: controls, foundation, framework, automation

    line 78
  8. Very specific:

    Use the /b flag in build.cmd which sets /m:2 (2 parallel processes):

    line 95
  9. Very specific:

    If /b still fails, close other memory-intensive applications (browsers, VS instances, etc.).

    line 99
  10. Distinctive:

    If it keeps failing, stale PCH files from a previous build with a different compiler version may be the cause.

    line 100
  11. Very specific:

    Fix: Do a clean build with /c:

    line 110
  12. Distinctive:

    Fix: No fix needed — this is normal behavior.

    line 129

“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Building WinUI

AI Agent Quick Start

# Always wrap commands with .\initrun.ps1 — it sets up the build environment automatically.
# Default flavor is amd64chk. Override with -Flavor.

.\initrun.ps1 .\build.cmd /q                            # full repo build (product + tests) — USE THIS BY DEFAULT
.\initrun.ps1 .\build.cmd /q product                    # product code only (no tests)
.\initrun.ps1 .\build.cmd /q mux                        # MUX only (Microsoft.UI.Xaml.dll)
.\initrun.ps1 msb /q "path\to\project.vcxproj"          # build a single project
.\initrun.ps1 -Flavor arm64fre .\build.cmd /q           # build for a different flavor

Rules:

  • Always prefix with .\initrun.ps1, this sets up critical environment variables and sanity-checks the environment
  • Always pass /q for quiet output (errors only)
  • Set initial_wait to at least 300 seconds — builds take 1-10+ minutes
  • When the user asks to "build the repo" or just "build" without specifying a target, use .\initrun.ps1 .\build.cmd /q (full build). Only use mux or a single project when the user asks for a specific component or when you know exactly which files changed.

First-Time Setup

A full init must be run once per flavor to download tools and NuGet packages. initrun.ps1 will fail with "Run a full init first" if this hasn't been done.

When you see that error, run a full init for the needed flavor:

.\init.ps1                # default: amd64chk
.\init.ps1 amd64fre       # specific flavor

Set initial_wait to at least 300 seconds — the first init downloads tools and restores NuGet packages.

Flavors: amd64chk, amd64fre, x86chk, x86fre, arm64chk, arm64fre (chk = debug, fre = release)

After init completes, retry the original initrun.ps1 build command.

If you get build errors that seem to indicate missing dependencies, that might mean you don't have a fresh "init".

Commands

CommandWhat it buildsTime
.\initrun.ps1 .\build.cmd /qEverything (product + tests)10+ min
.\initrun.ps1 .\build.cmd /q muxMicrosoft.UI.Xaml.dll only1-6 min
.\initrun.ps1 .\build.cmd /q productProduct code (no tests)5-10 min
.\initrun.ps1 .\build.cmd /q /cClean + full rebuild15+ min
.\initrun.ps1 msb /q "<project>"Single .vcxproj5s - 5 min

Flags (for .\build.cmd)

FlagEffect
/qQuiet — errors only, plus elapsed time
/bReduced parallelism (/m:2) — prevents PCH virtual memory exhaustion on limited-memory machines
/cClean build — deletes BuildOutput first. Use on first build or when switching flavors
/restoreNuGet restore before building
/fakeDry run — print commands without executing

What to Build After a Code Change

Files changed inBuild command
dxaml/xcp/** (source only).\initrun.ps1 msb /q "dxaml\xcp\dxaml\dllsrv\winrt\native\Microsoft.ui.xaml.vcxproj"
controls/dev/** or controls/idl/** (source only).\initrun.ps1 msb /q "controls\dev\dll\Microsoft.UI.Xaml.Controls.vcxproj"
dxaml/test/native/external/<area>/** (source only).\initrun.ps1 msb /q "dxaml\test\native\external\<area>\Microsoft.UI.Xaml.Tests.External.<Area>.vcxproj"
.vcxproj, .vcxitems, .props, .targets, NuGet deps.\initrun.ps1 .\build.cmd /q
Multiple areas or unsure.\initrun.ps1 .\build.cmd /q

Test areas: controls, foundation, framework, automation

Terminology

MUX = Microsoft.UI.Xaml.dll (core XAML runtime)

MUXC = Microsoft.UI.Xaml.Controls.dll

Troubleshooting

error C3859: Failed to create virtual memory for PCH / error C1076: compiler limit: internal heap limit reached

Symptom: Build fails with dozens of PCH (precompiled header) virtual memory errors across multiple .cpp files. This typically happens when building with the default /m:4 parallelism on machines with limited memory.

Root Cause: Multiple parallel cl.exe compiler instances each try to allocate large PCH memory regions, exhausting the process address space.

Fix:

  1. Use the /b flag in build.cmd which sets /m:2 (2 parallel processes):
    .\initrun.ps1 .\build.cmd /q /b
  2. If /b still fails, close other memory-intensive applications (browsers, VS instances, etc.).
  3. If it keeps failing, stale PCH files from a previous build with a different compiler version may be the cause. Do a clean build:
    .\initrun.ps1 .\build.cmd /q /c /b

error C1853: precompiled header file is from a different version of the compiler

Symptom: Build fails saying the .pch file is from a different compiler version.

Root Cause: Stale precompiled header files remain from a previous build with a different compiler (e.g., after a VS update).

Fix: Do a clean build with /c:

.\initrun.ps1 .\build.cmd /q /c /b

Missing Spectre mitigation libs

Symptom: Build errors about missing Spectre mitigation libraries from Visual Studio.

Fix: Tell the user to import the .vsconfig file from the repo root via Visual Studio Installer:

  1. Open Visual Studio Installer
  2. Click "More" → "Import configuration"
  3. Select <repo-root>\.vsconfig
  4. Install the missing components

DevEnvDir environment variable not set

Symptom: This message appears at the start of every initrun.ps1 command.

Root Cause: This is informational, not an error. initrun.ps1 automatically runs DevCmd.cmd to set up the VS environment.

Fix: No fix needed — this is normal behavior.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.