/winui-setup
Install and verify the prerequisites the win-dev-skills WinUI 3 toolchain depends on — .NET SDK 10, the WinApp CLI, the WinUI 3 .NET templates, and Developer Mode. Use when setting up a new machine, after a Windows reset, or when another winui skill reports a missing
$ npx -y skills add microsoft/win-dev-skills --skill winui-setup --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/winui-setup
Context preview
The summary Claude sees to decide when to auto-load this skill.
Install and verify the prerequisites the win-dev-skills WinUI 3 toolchain depends on — .NET SDK 10, the WinApp CLI, the WinUI 3 .NET templates, and Developer Mode. Use when setting up a new machine, after a Windows reset, or when another winui skill reports a missing
SKILL.md
winui-setup.SKILL.mdname: winui-setup
description: "Install and verify the prerequisites the win-dev-skills WinUI 3 toolchain depends on — .NET SDK 10, the WinApp CLI, the WinUI 3 .NET templates, and Developer Mode. Use when setting up a new machine, after a Windows reset, or when another winui skill reports a missing prerequisite (e.g., `winapp` not found, `dotnet` not found, the WinUI 3 templates are missing, or Developer Mode is off)."
disable-model-invocation: true
Purpose
Install and verify the prerequisites every other `winui-*` skill assumes are already present on the machine.
This skill is **idempotent** — every step checks first, skips if already satisfied, prints `[OK] already installed` and moves on. Re-running on a fully set-up machine is a fast no-op.
Steps
The first thing to do is **batch all detection up front** — run every check in parallel/together so you can show the user the full picture before installing anything. Then install only what's missing.
Detect everything
Run all of these together; collect the results:
# .NET SDK — accept any installed SDK >= 8.0
$dotnetSdks = (& dotnet --list-sdks 2>$null) -replace ' \[.*$',''
$dotnetOk = $dotnetSdks | ForEach-Object { [version]($_ -split '-')[0] } |
Where-Object { $_.Major -ge 8 } | Select-Object -First 1
# WinApp CLI — needs to be present AND >= 0.3
$winappVersion = $null
$winappOk = $false
$winappCmd = Get-Command winapp -ErrorAction SilentlyContinue
if ($winappCmd) {
$raw = (& winapp --version 2>$null) -as [string]
if ($raw) {
$base = ($raw -split '-')[0] # strip "-prerelease.N" if present
try {
$winappVersion = [version]$base
$winappOk = $winappVersion -ge [version]'0.3'
} catch {}
}
}
# WinUI 3 templates
$templatesOk = [bool](dotnet new list winui 2>$null | Select-String 'winui-mvvm' -Quiet)
# Developer Mode
$devModeOk = ((Get-ItemProperty `
-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' `
-Name AllowDevelopmentWithoutDevLicense -ErrorAction SilentlyContinue
).AllowDevelopmentWithoutDevLicense) -eq 1Print a one-shot status table so the user sees what you're about to do:
.NET SDK ≥ 8 ✅ found 10.0.100 (or ❌ missing — will install Microsoft.DotNet.SDK.10)
WinApp CLI ⚠ found 0.3.1 — will upgrade to latest
(or ❌ missing/too old — will install Microsoft.WinAppCLI)
WinUI 3 templates ✅ found — will reinstall to make sure they're at latest
Developer Mode ❌ disabled — needs admin to enable> **Always upgrade WinApp CLI and the WinUI templates** even when they're already present — they ship breaking changes between releases and the rest of the `winui-*` skills assume latest. The minimum bar is "WinApp CLI ≥ 0.3 and templates installed at all"; the goal is "both at latest".
Install what's missing
Skip anything already-OK from detection. The remaining steps:
.NET SDK (only if no SDK ≥ 8.0 was found)
winget install --id Microsoft.DotNet.SDK.10 --exact --silent --accept-package-agreements --accept-source-agreements
`.NET 8.0` is the floor. If the user already has 8.0, 9.0, or 10.0 installed (any patch), the requirement is met — do not install another SDK side-by-side.
WinApp CLI — install if missing/old, then always upgrade
If `$winappOk` is false (missing or `< 0.3`), install it. Then **always** run `winget upgrade` regardless, so even already-present installs get bumped to latest:
# Install only if missing or too old
winget install --id Microsoft.WinAppCLI --exact --silent --accept-package-agreements --accept-source-agreements
# Always — upgrade to latest (no-op if already at latest)
winget upgrade --id Microsoft.WinAppCLI --exact --silent --accept-package-agreements --accept-source-agreements
Refresh `$env:Path`
If you installed the .NET SDK or anything else via winget in this session, **refresh PATH** so subsequent steps can find the new tools. Without this, `dotnet new install` will fail with "command not found" even though the SDK is on disk:
$env:Path = [Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [Environment]::GetEnvironmentVariable('Path','User')WinUI 3 .NET templates — always reinstall to get latest
Run this every time, whether or not `$templatesOk` was true. `dotnet new install` against an already-installed template package upgrades it in place to the latest version:
dotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates
Developer Mode (ask the user first!)
Developer Mode is the DWORD `AllowDevelopmentWithoutDevLicense` under `HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock`. Setting it requires admin, which means a UAC prompt will pop up. **Do not just trigger UAC out of nowhere — ask the user first** so they're not surprised by the elevation prompt. Use language like:
> Developer Mode is currently disabled. Enabling it requires a one-time admin elevation (a UAC prompt will appear). Would you like me to enable it now? (yes / no / I'll do it later)
Only if the user agrees, re-elevate **only this step** via UAC:
Start-Process powershell -Verb RunAs -ArgumentList @(
'-NoProfile','-Command',
"New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' -Force | Out-Null; " +
"Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' " +
"-Name AllowDevelopmentWithoutDevLicense -Type DWord -Value 1"
) -Wait
If the user declines (either says no, or accepts but then dismisses the UAC prompt), do not abort the whole skill. Print the literal command above so they can run it later from an elevated PowerShell, and continue to the summary.
Final summary — always print this
After everything, print a single-table summary so the user knows exactly what changed:
Read more
name: winui-setup description: "Install and verify the prerequisites the win-dev-skills WinUI 3 toolchain depends on — .NET SDK 10, the WinApp CLI, the WinUI 3 .NET templates, and Developer Mode. Use when setting up a new machine, after a Windows reset, or when another winui skill reports a missing prerequisite (e.g., `winapp` not found, `dotnet` not found, the WinUI 3 templates are missing, or Developer Mode is off)." disable-model-invocation: true
Purpose
Install and verify the prerequisites every other `winui-*` skill assumes are already present on the machine.
This skill is **idempotent** — every step checks first, skips if already satisfied, prints `[OK] already installed` and moves on. Re-running on a fully set-up machine is a fast no-op.
Steps
The first thing to do is **batch all detection up front** — run every check in parallel/together so you can show the user the full picture before installing anything. Then install only what's missing.
Detect everything
Run all of these together; collect the results:
# .NET SDK — accept any installed SDK >= 8.0
$dotnetSdks = (& dotnet --list-sdks 2>$null) -replace ' \[.*$',''
$dotnetOk = $dotnetSdks | ForEach-Object { [version]($_ -split '-')[0] } |
Where-Object { $_.Major -ge 8 } | Select-Object -First 1
# WinApp CLI — needs to be present AND >= 0.3
$winappVersion = $null
$winappOk = $false
$winappCmd = Get-Command winapp -ErrorAction SilentlyContinue
if ($winappCmd) {
$raw = (& winapp --version 2>$null) -as [string]
if ($raw) {
$base = ($raw -split '-')[0] # strip "-prerelease.N" if present
try {
$winappVersion = [version]$base
$winappOk = $winappVersion -ge [version]'0.3'
} catch {}
}
}
# WinUI 3 templates
$templatesOk = [bool](dotnet new list winui 2>$null | Select-String 'winui-mvvm' -Quiet)
# Developer Mode
$devModeOk = ((Get-ItemProperty `
-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' `
-Name AllowDevelopmentWithoutDevLicense -ErrorAction SilentlyContinue
).AllowDevelopmentWithoutDevLicense) -eq 1Print a one-shot status table so the user sees what you're about to do:
.NET SDK ≥ 8 ✅ found 10.0.100 (or ❌ missing — will install Microsoft.DotNet.SDK.10)
WinApp CLI ⚠ found 0.3.1 — will upgrade to latest
(or ❌ missing/too old — will install Microsoft.WinAppCLI)
WinUI 3 templates ✅ found — will reinstall to make sure they're at latest
Developer Mode ❌ disabled — needs admin to enable> **Always upgrade WinApp CLI and the WinUI templates** even when they're already present — they ship breaking changes between releases and the rest of the `winui-*` skills assume latest. The minimum bar is "WinApp CLI ≥ 0.3 and templates installed at all"; the goal is "both at latest".
Install what's missing
Skip anything already-OK from detection. The remaining steps:
.NET SDK (only if no SDK ≥ 8.0 was found)
winget install --id Microsoft.DotNet.SDK.10 --exact --silent --accept-package-agreements --accept-source-agreements
`.NET 8.0` is the floor. If the user already has 8.0, 9.0, or 10.0 installed (any patch), the requirement is met — do not install another SDK side-by-side.
WinApp CLI — install if missing/old, then always upgrade
If `$winappOk` is false (missing or `< 0.3`), install it. Then **always** run `winget upgrade` regardless, so even already-present installs get bumped to latest:
# Install only if missing or too old winget install --id Microsoft.WinAppCLI --exact --silent --accept-package-agreements --accept-source-agreements # Always — upgrade to latest (no-op if already at latest) winget upgrade --id Microsoft.WinAppCLI --exact --silent --accept-package-agreements --accept-source-agreements
Refresh `$env:Path`
If you installed the .NET SDK or anything else via winget in this session, **refresh PATH** so subsequent steps can find the new tools. Without this, `dotnet new install` will fail with "command not found" even though the SDK is on disk:
$env:Path = [Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [Environment]::GetEnvironmentVariable('Path','User')WinUI 3 .NET templates — always reinstall to get latest
Run this every time, whether or not `$templatesOk` was true. `dotnet new install` against an already-installed template package upgrades it in place to the latest version:
dotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates
Developer Mode (ask the user first!)
Developer Mode is the DWORD `AllowDevelopmentWithoutDevLicense` under `HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock`. Setting it requires admin, which means a UAC prompt will pop up. **Do not just trigger UAC out of nowhere — ask the user first** so they're not surprised by the elevation prompt. Use language like:
> Developer Mode is currently disabled. Enabling it requires a one-time admin elevation (a UAC prompt will appear). Would you like me to enable it now? (yes / no / I'll do it later)
Only if the user agrees, re-elevate **only this step** via UAC:
Start-Process powershell -Verb RunAs -ArgumentList @( '-NoProfile','-Command', "New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' -Force | Out-Null; " + "Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' " + "-Name AllowDevelopmentWithoutDevLicense -Type DWord -Value 1" ) -Wait
If the user declines (either says no, or accepts but then dismisses the UAC prompt), do not abort the whole skill. Print the literal command above so they can run it later from an elevated PowerShell, and continue to the summary.
Final summary — always print this
After everything, print a single-table summary so the user knows exactly what changed:
A GitHub Copilot, Claude Code, and OpenAI Codex plugin for building native Windows apps with WinUI 3 and the Windows App SDK to cover the end-to-end inner loop: scaffold → design → build → run → test → package → ship.
Repo: microsoft/win-dev-skills
Other skills on win-dev-skills.
- /winui-code-review
Code quality review for WinUI 3 apps — MVVM compliance, x:Bind correctness, accessibility, theming, security, and performance. Use before committing to catch issues that the compiler and UI tests won't find.
Open skill - /winui-design
Use when designing, reviewing, or fixing WinUI 3: layout planning, control choice, Fluent Design alignment, Light/Dark/High Contrast theming, typography, spacing, brushes, accessibility, and XAML data-binding design. Load before authoring new XAML, reviewing UI PRs, migrating
Open skill - /winui-dev-workflow
Build and run workflow for WinUI 3 apps — project creation, BuildAndRun.ps1 script, winapp run, error diagnosis, and prerequisites. Use when building, running, or fixing build errors in a WinUI 3 project.
Open skill - /winui-packaging
MSIX packaging, code signing, and distribution for WinUI 3 apps — build for release, certificate generation (winapp cert generate), certificate trust, code signing (winapp sign), self-contained deployment, CI/CD with GitHub Actions, and Microsoft Store submission. Use when
Open skill - /winui-session-report
Analyze the current or a recent agent session (GitHub Copilot CLI or Claude Code) and generate a diagnostic report. Use when asking for session feedback, debugging agent behavior, or reviewing what happened during a build session.
Open skill - /winui-ui-testing
Automated UI testing for Windows desktop apps — generate a batch test script with the `winapp ui` UI Automation harness, run all tests in one pass, read results. Covers element assertions, interactions, value checking (TextBox, ComboBox, ToggleSwitch), keyboard shortcuts and
Open skill

