From wpf-dev-pack
Generates C# WPF ViewModels with optional XAML Views, DI registrations, and DataTemplate mappings following View First MVVM. Use for scaffolding new screens or View-ViewModel pairs via /wpf-dev-pack:make-wpf-viewmodel.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wpf-dev-pack:make-wpf-viewmodelsonnetThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**If `$0` is empty, use the AskUserQuestion tool to ask: "Enter the ViewModel name (e.g., Dashboard, Settings)". Do NOT proceed until a valid name is provided. Use the response as the ViewModelName for all subsequent steps.**
If $0 is empty, use the AskUserQuestion tool to ask: "Enter the ViewModel name (e.g., Dashboard, Settings)". Do NOT proceed until a valid name is provided. Use the response as the ViewModelName for all subsequent steps.
Generate a $0ViewModel class with optional View, DI registration, and DataTemplate mapping.
Follows View First MVVM pattern — View determines its ViewModel.
{Namespace} with the project's root namespace detected from csproj or existing code.{ViewModelNamespace} with the ViewModel project's CLR namespace for XAML xmlns declaration.# ViewModel + View + DI + DataTemplate mapping (full)
/wpf-dev-pack:make-wpf-viewmodel Dashboard --with-view
# ViewModel + DI only (no View, no mapping)
/wpf-dev-pack:make-wpf-viewmodel Settings
# ViewModel + View without DataTemplate mapping
/wpf-dev-pack:make-wpf-viewmodel Report --with-view --no-mapping
$0 is the ViewModel name (without ViewModel suffix — auto-appended)
Dashboard → DashboardViewModel.cs + DashboardView.xaml--with-view flag: Generate View XAML + code-behind--no-mapping flag: Skip DataTemplate mapping registrationSearch for solution file and identify projects by naming convention:
| Project Suffix | Purpose | Files Placed |
|---|---|---|
.ViewModels | ViewModel project | $0ViewModel.cs |
.WpfApp | WPF Application | Views/$0View.xaml, DI registration |
.WpfServices | WPF Services | (referenced for DI) |
Fallback: If no .ViewModels project exists, place ViewModel in ViewModels/ folder of main WPF project.
Create $0ViewModel.cs:
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
namespace {Namespace}.ViewModels;
public sealed partial class $0ViewModel : ObservableObject
{
[ObservableProperty] private string _title = "$0";
[RelayCommand]
private void Loaded()
{
// TODO: Initialize data
// TODO: 데이터 초기화
}
}
Create Views/$0View.xaml:
<UserControl x:Class="{Namespace}.Views.$0View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="{ViewModelNamespace}"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance vm:$0ViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<TextBlock Text="{Binding Title}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="24" />
</Grid>
</UserControl>
Create Views/$0View.xaml.cs:
namespace {Namespace}.Views;
public partial class $0View
{
public $0View()
{
InitializeComponent();
}
}
Locate App.xaml.cs and add registration inside ConfigureServices:
// In ConfigureServices method
services.AddSingleton<$0ViewModel>();
If --with-view:
services.AddSingleton<$0ViewModel>();
services.AddSingleton<$0View>();
Locate Mappings.xaml (or ViewModelMappings.xaml) and add:
<DataTemplate DataType="{x:Type vm:$0ViewModel}">
<views:$0View />
</DataTemplate>
If Mappings.xaml does not exist, create it and merge into App.xaml:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Mappings.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Output list of generated/modified files and next steps guidance.
{ViewModelsProject}/
└── $0ViewModel.cs
{WpfAppProject}/
├── Views/
│ ├── $0View.xaml (if --with-view)
│ └── $0View.xaml.cs (if --with-view)
├── Mappings.xaml (modified or created)
└── App.xaml.cs (DI registration added)
/wpf-dev-pack:make-wpf-project firstPrism 9 사용자: See PRISM.md for Prism-specific generation patterns.
npx claudepluginhub christian289/dotnet-with-claudecode --plugin wpf-dev-packScaffolds WPF project structures with MVVM, DI, and best practices using CommunityToolkit.Mvvm (default) or Prism. Use for new WPF apps, scratch solutions, or setups via /wpf-dev-pack:make-wpf-project.
Creates ViewModels, Wizards, and navigation for Avalonia apps using ReactiveUI and Zafiro. Includes patterns for enhanced commands, automatic section discovery, and View-ViewModel mapping.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.