winui-wpf-migration

winui-wpf-migration is a skill for Claude Code from microsoft/winappCli. It costs 73 tokens per session (1,487 once invoked), scanned A, original, MIT.

A setup guide for the tools and Windows settings needed to build WinUI 3 desktop apps. It checks the .NET SDK, WinApp CLI, Developer Mode, and extra requirements for Native AOT and Windows Sandbox.

In plain words
What is it for?
Use it to inspect, install, or repair a WinUI 3 development toolchain and verify that the environment is ready for other WinUI tasks.
Why use it?
It finds missing or outdated prerequisites before they cause confusing build or testing errors. It installs or upgrades only what is needed and identifies changes that require user approval.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin.

Part of the winui plugin — 7 skills, 1 agent shipped together

Good fit Use it to inspect, install, or repair a WinUI 3 development toolchain and verify that the environment is ready for other WinUI tasks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/microsoft/winappcli/winui-wpf-migration
About the project

winapp CLI is a command-line tool for Windows application development that manages SDKs, app identity, manifests, certificates, packaging, and build tools. It helps developers using frameworks such as .NET, Win32, CMake, Electron, or Rust access Windows-native development capabilities. The catalogue add-ons provide agent workflows for using the CLI.

microsoft/winappCli · 1,314 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add microsoft/winappCli --skill winui-wpf-migration
Clone the repo
git clone --depth 1 https://github.com/microsoft/winappCli

Made for: Claude Code.

Or install winui, the plugin that ships this one along with the rest of its 7 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for winui-wpf-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/winappcli/winui-wpf-migration/github.svg)](https://agentmods.dev/skills/microsoft/winappcli/winui-wpf-migration)
Your own site
<a href="https://agentmods.dev/skills/microsoft/winappcli/winui-wpf-migration"><img src="https://agentmods.dev/badge/skills/microsoft/winappcli/winui-wpf-migration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for winui-wpf-migration

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoft/winappcli/winui-wpf-migration"><img src="https://agentmods.dev/badge/skills/microsoft/winappcli/winui-wpf-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,487 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.01487
Opus 5.5 $0.00029 $0.00595
Sonnet 5.5 $0.00015 $0.00297
Haiku 4.5 $0.00007 $0.00149

Measured 7d ago against content hash 50c58cdb73ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

winui-wpf-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/winui/agent-plugin/skills/winui-wpf-migration/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Migration Process

Use the WinApp CLI 0.7+ prerequisites and per-app analyzer setup in winui-dev-workflow. The normal SDK path needs .NET 8.0.100 or later and the SDK required by the target TFM; Native AOT additionally needs MSVC/Desktop C++ tools. Handle missing prerequisites as described there.

Step 1: Audit the WPF Source

Before writing code, inventory WPF-specific APIs:

# Find all WPF namespace usage
Select-String -Path (Get-ChildItem -Recurse -Filter "*.cs" | Where-Object { $_.FullName -notlike "*\obj\*" }) -Pattern "System\.Windows\." | Select-Object -Property Filename, LineNumber, Line

List: WPF controls used, custom MVVM framework, imaging APIs, threading patterns, Win32 interop.

Step 2: Create WinUI 3 Project and Align Namespaces
winapp new --name <AppName> --template winui-mvvm --template-version latest --use-defaults

Immediately set <RootNamespace> in .csproj to match the WPF namespace. Update x:Class in App.xaml, MainWindow.xaml and their code-behind files. Add the analyzer per winui-dev-workflow. Build to verify before porting any code.

Before implementing API replacements, restore the app project and check its exact references from the WinUI project directory, not the old WPF project or machine SDK:

winapp find-api DispatcherQueue --json --project-dir .
winapp find-api members DispatcherQueue --filter TryEnqueue --json --project-dir .
winapp find-api check-property ListView ItemsSource SelectionMode --json --project-dir .

Use winapp find-ui "<intent>" for usage samples; see winui-design for project selection and batch API checks.

Step 3: Replace Namespaces
WPF WinUI 3
System.Windows Microsoft.UI.Xaml
System.Windows.Controls Microsoft.UI.Xaml.Controls
System.Windows.Media Microsoft.UI.Xaml.Media
System.Windows.Input Microsoft.UI.Xaml.Input
System.Windows.Data Microsoft.UI.Xaml.Data
System.Windows.Threading.Dispatcher Microsoft.UI.Dispatching.DispatcherQueue
PresentationCore / PresentationFramework Remove entirely
Step 4: Replace Controls
WPF Control WinUI 3 Equivalent
DataGrid ListView with Grid column headers
WrapPanel ItemsRepeater + UniformGridLayout
TabControl TabView
StatusBar Grid row at bottom with TextBlock elements
Menu / MenuItem MenuBar / MenuBarItem / MenuFlyoutItem
ToolBar CommandBar
Expander (custom) Expander (built-in)
Step 5: Replace Threading
// WPF
Application.Current.Dispatcher.Invoke(() => { /* UI work */ });

// WinUI 3
dispatcherQueue.TryEnqueue(() => { /* UI work */ });

Get via DispatcherQueue.GetForCurrentThread(). No Application.Current.Dispatcher in WinUI 3.

Step 6: Replace Imaging

Critical: PresentationCore.dll and System.Windows.Media.Imaging crash the WinUI XAML compiler. This is an architectural incompatibility — no workaround exists.

  • Remove ALL System.Windows.Media.Imaging references at migration start
  • Replace with Windows.Graphics.Imaging (WinRT) or Microsoft.UI.Xaml.Media.Imaging.BitmapImage
  • Do NOT add <UseWPF>true</UseWPF> — it silently corrupts the build
  • If heavy imaging code exists, migrate it early (step 2, not step 7)
Step 7: Replace MVVM Framework

Delete custom ObservableObject/RelayCommand/DelegateCommand. Use CommunityToolkit.Mvvm:

  • INotifyPropertyChanged base → ObservableObject with [ObservableProperty] partial properties (fix MVVMTK0045; don't keep fields)
  • Custom RelayCommand → [RelayCommand] attribute
  • Prefer {x:Bind} for known types; keep runtime {Binding}/DisplayMemberPath where needed. See winui-packaging's references/sourcegen-patterns.md for binding modes, x:DataType, and AOT-safe runtime binding.
  • DynamicResource → {ThemeResource}
Step 8: Replace Resources
  • .resx → .resw (copy + rename to Strings\en-us\)
  • {x:Static} → x:Uid for localized strings
  • Properties.Resources.Key → ResourceLoader.GetString("Key")

Read the full file on GitHub · 112 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed · -27 tokens per session 50c58cdb73ba
  2. 9d ago First seen · 112 lines · 100 tokens per session scan A b8756a23a41d

Subscribe to this mod's changes

winui-wpf-migration is a skill published in the GitHub repository microsoft/winappCli (1,314 stars, last pushed today), licensed MIT. It adds 73 tokens to every session and 1,487 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-07.

Related

Other skills, from other repositories

claw-admin

Claw system administration: service management, IM connections, logs, cron, and workspace diagnostics. Use when the user asks to manage claw services, connect/disconnect IM platforms, view logs, or perform system-wide operations.

x-cmd/x-cmd · 48 tokens

x-nets

Enhanced netstat module with cached data and structured output. View network connections, routing tables, and interface statistics in interactive or TSV/CSV formats. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 69 tokens

x-theme

Change terminal command line prompt theme. Globally manage the display style of all x-cmd interactive components. Supports multiple theme vendors: theme, starship, ohmyposh. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 74 tokens

x-arp

Display ARP cache table with MAC vendor lookup and suspicious entry detection. Supports CSV, TSV, and TUI output. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 64 tokens

x-mankier

Search and browse man pages from ManKier.com. Command line interface for ManKier man page repository. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 62 tokens

x-osv

CLI for Google OSV database. Query vulnerabilities for packages, scan local projects for vulnerable dependencies. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill). Required Tool: Install osv-scanner for project scanning (see https://github.com/google/osv-scanner).

x-cmd/x-cmd · 72 tokens