/winui:winui-wpf-migrationfrom winui
Migrates WPF desktop apps to WinUI 3, covering project files, XAML, MVVM, resources, windowing, imaging, installers, and tests. Use for WPF ports and migration regressions.
Ships in winui. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Port WPF code to WinUI 3 while preserving the application's behavior, deployment, stored data, and external contracts.
System.Windows.* APIs to WinUI 3.Use winui-design for control samples, winui-dev-workflow for project setup and build/run commands, and winui-packaging when packaging is in scope. Keep the target project's versions, deployment, and required behavior when using those workflows.
Port bounded groups of files in dependency order:
.resx strings and their code/XAML consumers to .resw, connect the PRI resource index and accessor, and keep stable keys.Compile each migrated group and run its relevant tests when the repository permits those checks. Follow restrictions that defer builds to final acceptance, and keep failures attributable to the changed group.
Check uncertain replacement APIs against the restored WinUI app, not the machine SDK. From the target app's project directory, search for the type, then inspect the member on the intended type (see winui-design):
winapp find-api FileOpenPicker --json --project-dir .
winapp find-api members Microsoft.Windows.Storage.Pickers.FileOpenPicker --filter PickSingleFileAsync --json --project-dir .
App.xaml and App.xaml.cs; preserve generated startup and initialization that the target SDK needs.UseWPF or a WPF framework reference to the WinUI application to conceal an incomplete conversion.Package.appxmanifest for packaged apps. Change WindowsPackageType, WindowsAppSDKSelfContained, SelfContained, or package identity only as part of the chosen deployment configuration.Window for top-level windows. Set its size with AppWindow; use OverlappedPresenter to control whether users can resize it or it stays on top. If the project already uses WinUIEx, keep its WindowEx base.ContentDialog for in-app dialogs and Frame/Page for sub-views. Reserve separate windows for distinct top-level surfaces.clr-namespace: with using:, and map unsupported markup individually. x:DataType enables typed templates but does not reproduce WPF's implicit template selection.ThemeResource for theme-dependent resources, StaticResource for fixed resources, and binding/code for other dynamic values.Page/UserControl content root or a control-template root.x:Bind, existing control states, or suitable Toolkit converters before copying a WPF converter. Preserve the intended conversion and its inverse.x:Bind for new and migrated views with known types. Use classic Binding where the source must be resolved through runtime DataContext.Mode=TwoWay in WinUI.DataContext and element resources on the hosted view/root element. A WinUI Window does not expose the WPF equivalents.PreviewKeyDown/PreviewKeyUp handlers; redesign WPF mouse preview events according to their required behavior.Dispatcher.Invoke by its completion and exception semantics. DispatcherQueue.TryEnqueue only reports whether work was accepted.XamlRoot for dialogs and its HWND or WindowId for the selected picker API.| Symptom | What to check |
|---|---|
| A WinUI project still needs WPF assemblies | Check callers, resource items, generated files, and shared-library dependencies for WPF-only types. A System.Windows name alone is not a failure: System.Windows.Input.ICommand is valid in WinUI. |
| Startup reports a Windows App SDK runtime/COM activation error | Launch the project with winapp run .\MyApp.csproj --detach --json first (see winui-dev-workflow). Starting a packaged app's .exe directly skips package activation. If project launch still fails, check package identity, runtime deployment, architecture, and initialization. |
| A window's bindings or resources do not resolve | Move view state and resources to the hosted view/root and check the binding source. |
| Edited text does not reach the view model | Check explicit Mode=TwoWay, update timing, and notifications. |
| A dialog or picker opens without the correct owner | Supply the owning loaded XamlRoot, HWND, or WindowId required by that API. |
| Localized strings fail during startup or tests | Check PRI generation/name, resource-map lookup, initialization timing, and the test resource accessor. |
| A build script works from the solution but not from the project | Check the project-relative build paths. |
| Image quality, dimensions, or tests change | Check codec options and types, pixel/alpha representation, integer widths, and frame/metadata handling. |
Read the reference that matches the current phase:
winapp run by default. If activation depends on a separate packaging project (.wapproj), use that project's existing deployment and launch steps instead. Confirm the expected window opens and responds to input.winui-dev-workflow for Native AOT publish/run steps and winui-packaging's references/sourcegen-patterns.md for trimming/binding/serialization guidance.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub microsoft/winappcli --plugin winui7 skills in this plugin
/winui-code-reviewReview WinUI 3 code or changes for quality: MVVM, x:Bind correctness, accessibility, theming, security, performance, and WinUI analyzer findings. Use when asked to review or audit a WinUI app or its pending changes, or before committing. Catches issues the compiler and UI tests miss./winui-designRead before writing or changing WinUI 3 XAML: choosing controls, pages and navigation, layout, Fluent Design, theming, accessibility, x:Bind, real samples, and checking that APIs exist with winapp find-api. Not for WPF or WinForms UI, even if the app uses the Windows App SDK./winui-dev-workflowCreate, build, run, and fix build errors in WinUI 3 apps (C# or C++) with WinApp CLI 0.7+: winapp new, winapp run, Native AOT, crash diagnosis. Use for a new WinUI app or a WinUI project that fails to build or crashes. Not for WPF, WinForms, or Electron apps that only reference the Windows App SDK./winui-packagingMSIX packaging, signing, and Microsoft Store publishing for WinUI 3 apps with WinApp CLI 0.7+: project packaging, Native AOT, certificates, self-contained deployment, CI/CD. Use when releasing or publishing a WinUI app. Not for WPF, WinForms, or Electron apps that only reference the Windows App SDK./winui-setupInstall and verify WinUI 3 prerequisites — .NET SDK 8.0.100+, WinApp CLI 0.7+, and Developer Mode; identify additional Native AOT and Windows Sandbox requirements. Use when the user asks to set up or repair the toolchain, or when another WinUI skill finds a missing or outdated prerequisite./winui-ui-testingWrite and run automated UI tests for Windows desktop apps (WinUI 3, WPF, WinForms, Win32) with the winapp ui harness: one batch script, assertions, input, file pickers, dialogs, screenshots, locally or in Windows Sandbox. Use when asked for UI tests or to verify a feature end to end.Other plugins' skills for the same job