本文へ移動
cccskills
無料GitHub で公開

winui

Build or review WinUI 3 applications with the Windows App SDK, including MVVM patterns, packaging decisions, navigation, theming, windowing, and interop boundaries with other .NET stacks. USE FOR: building native modern Windows desktop UI on WinUI 3; integrating Windows App SDK features into a .NET app; deciding between WinUI, WPF, WinForms, and MAUI for Windows. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md5.4 KB
  • manifest.json97 B
  • references/anti-patterns.md13.0 KB
  • references/patterns.md12.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

WinUI 3 and Windows App SDK

Trigger On

  • building native modern Windows desktop UI on WinUI 3
  • integrating Windows App SDK features into a .NET app
  • deciding between WinUI, WPF, WinForms, and MAUI for Windows work
  • implementing MVVM patterns in Windows App SDK applications

Workflow

  1. Confirm WinUI is the right choice — use when modern Windows-native UI, Fluent Design, and Windows App SDK capabilities are needed. For cross-platform, consider MAUI instead.
  2. Choose packaging model early — packaged (MSIX) vs unpackaged differ materially for deployment, identity, and API access:
    <!-- Unpackaged: add to .csproj -->
    <WindowsPackageType>None</WindowsPackageType>
    
  3. Apply MVVM pattern with the MVVM Toolkit — keep views dumb, logic in ViewModels:
    public partial class ProductsViewModel : ObservableObject
    {
        [ObservableProperty]
        private ObservableCollection<Product> _products = [];
    
        [ObservableProperty]
        [NotifyCanExecuteChangedFor(nameof(DeleteCommand))]
        private Product? _selectedProduct;
    
        [RelayCommand(CanExecute = nameof(CanDelete))]
        private async Task DeleteAsync()
        {
            if (SelectedProduct is null) return;
            await _productService.DeleteAsync(SelectedProduct.Id);
            Products.Remove(SelectedProduct);
        }
        private bool CanDelete() => SelectedProduct is not null;
    }
    
  4. Use x:Bind for compiled bindings — better performance and compile-time checking than {Binding}:
    <TextBlock Text="{x:Bind ViewModel.Title, Mode=OneWay}"/>
    
  5. Wire DI through Host.CreateDefaultBuilder — register services, ViewModels, and views. Resolve via App.GetService<T>().
  6. Implement navigation service — map ViewModels to Pages by convention. See references/patterns.md for the full pattern.
  7. Handle Windows App SDK features — windowing (AppWindow), custom title bar, app lifecycle, notifications.
  8. Always set XamlRoot when showing ContentDialog — omitting this causes silent failures.
  9. Validate on Windows targets — behavior depends on runtime, packaging model, and Windows version.

Current Upstream Notes

  • Windows App SDK 2.3.1 adds schema-constrained Phi Silica JSON output, XamlOptionalChanges, ARM64EC support for Windows ML, Video Super Resolution improvements, and opt-in XAML startup/style/resource-lookup optimizations.
  • Windows App SDK 1.8.11 is the current 1.8 servicing patch. It restores focus after storage pickers, fixes MRT fallback resolution, and isolates runtime base-directory environment state; retest picker return focus, resource fallback, and side-by-side runtime activation when maintaining the 1.8 line.
  • For unpackaged apps, prefer ApplicationData.GetForUnpackaged() over registry or custom folder conventions when the app needs first-class app data storage.
  • When upgrading to 2.3.1, retest unpackaged LocalSettings, background tasks, side-placement flyouts, MediaPlayerPresenter device loss, popup pointer replay, ItemsRepeater layouts, Windows ML, and any opted-in XAML change IDs.
flowchart LR
  A["Choose WinUI"] --> B["Select packaging model"]
  B --> C["MVVM + DI setup"]
  C --> D["Navigation and views"]
  D --> E["Windows App SDK features"]
  E --> F["Validate on target runtime"]

Key Decisions

DecisionGuidance
Packaged vs unpackagedPackaged (MSIX) for Store, auto-update, and full API access; unpackaged for simpler deployment
x:Bind vs BindingAlways prefer x:Bind — compiled, faster, type-safe
MVVM Toolkit attributesUse [ObservableProperty], [RelayCommand] to eliminate boilerplate
NavigationConvention-based ViewModel→Page mapping via navigation service
ThemingUse RequestedTheme on root element; respect system theme by default

Deliver

  • modern Windows UI code with clear platform boundaries
  • explicit deployment and packaging assumptions
  • MVVM pattern with testable ViewModels
  • cleaner interop between shared and Windows-specific layers

Validate

  • WinUI is chosen for a real product reason, not defaulted to
  • Windows App SDK dependencies are explicit in the project file
  • packaging and runtime assumptions are tested on target
  • x:Bind is used for compiled bindings throughout
  • navigation and ContentDialog both work with correct XamlRoot
  • custom title bar renders correctly on Windows 10 and 11

References

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Route gh-aw workflow design/create/debug/upgrade requests to the right prompts.

日本語の概要は準備中です。原文の説明を表示しています。

managedcode/dotnet-skills4852026年10月11日 更新

Use a repo-root `.editorconfig` to configure free .NET analyzer and style rules. Use when a .NET repo needs rule severity, code-style options, section layout, or analyzer ownership made explicit. USE FOR: the repo needs a root .editorconfig; analyzer severity and style ownership are unclear; the team wants one source of truth for rule configuration. DO NOT USE FOR: choosing analyzers with no config change; formatting-only execution with no config ownership question. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.

日本語の概要は準備中です。原文の説明を表示しています。

managedcode/dotnet-skills4852026年10月11日 更新

Scans .NET code for ~50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I/O with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.

日本語の概要は準備中です。原文の説明を表示しています。

managedcode/dotnet-skills4852026年10月11日 更新

Symbolicate the .NET runtime frames in an Android tombstone file. Extracts BuildIds and PC offsets from the native backtrace, downloads debug symbols from the Microsoft symbol server, and runs llvm-symbolizer to produce function names with source file and line numbers. USE FOR triaging a .NET MAUI or Mono Android app crash from a tombstone, resolving native backtrace frames in libmonosgen-2.0.so or libcoreclr.so to .NET runtime source code, or investigating SIGABRT, SIGSEGV, or other native signals originating from the .NET runtime on Android. DO NOT USE FOR pure Java/Kotlin crashes, managed .NET exceptions that are already captured in logcat, or iOS crash logs. INVOKES Symbolicate-Tombstone.ps1 script, llvm-symbolizer, Microsoft symbol server.

日本語の概要は準備中です。原文の説明を表示しています。

managedcode/dotnet-skills4852026年10月11日 更新

Symbolicate .NET runtime frames in Apple platform .ips crash logs (iOS, tvOS, Mac Catalyst, macOS). Extracts UUIDs and addresses from the native backtrace, locates dSYM debug symbols, and runs atos to produce function names with source file and line numbers. Automatically downloads .dwarf symbols from the Microsoft symbol server using Mach-O UUIDs. USE FOR triaging a .NET MAUI or Mono app crash from an .ips file on any Apple platform, resolving native backtrace frames in libcoreclr or libmonosgen-2.0 to .NET runtime source code, retrieving .ips crash logs from a connected iOS device or iPhone, or investigating EXC_CRASH, EXC_BAD_ACCESS, SIGABRT, or SIGSEGV originating from the .NET runtime. DO NOT USE FOR pure Swift/Objective-C crashes with no .NET components, or Android tombstone files. INVOKES Symbolicate-Crash.ps1 script, atos, dwarfdump, idevicecrashreport.

日本語の概要は準備中です。原文の説明を表示しています。

managedcode/dotnet-skills4852026年10月11日 更新

Design or review .NET solution architecture across modular monoliths, clean architecture, vertical slices, microservices, DDD, CQRS, and cloud-native boundaries without over-engineering. USE FOR: .NET architecture choices; layer and domain boundary review; service decomposition; clean architecture, vertical slice, DDD, CQRS, and modular monolith decisions. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.

日本語の概要は準備中です。原文の説明を表示しています。

managedcode/dotnet-skills4852026年10月11日 更新

managedcode のスキルをすべて見る

このスキルの問題を報告する