/vibe:ghcopilot-instr-mvvm-toolkitfrom vibe
Provides CommunityToolkit.Mvvm coding conventions for ViewModels, commands, messaging, validation, and DI across WPF, WinUI 3, .NET MAUI, Uno Platform, and Avalonia. Use when writing or reviewing MVVM Toolkit code.
Ships in vibe. 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.
None: SKILL.md is the whole skill.
These rules apply whenever a project references CommunityToolkit.Mvvm.
For deep reference and end-to-end examples, load the mvvm-toolkit skill.
CommunityToolkit.Mvvm 8.x (or newer) in .csproj. Do not
install the legacy Microsoft.Toolkit.Mvvm (7.x) for new projects.LangVersion must support source generators (default in modern SDKs).ObservableObject by default.ObservableValidator only when the ViewModel needs
INotifyDataErrorInfo (forms, settings, input validation).ObservableRecipient only when the ViewModel sends or receives
IMessenger messages.INotifyPropertyChanged when one of the toolkit
base classes can be used. If the type cannot inherit from a toolkit base
(e.g., a custom control), apply the class-level [ObservableObject] or
[INotifyPropertyChanged] attribute instead.[ObservableProperty] as partial (and
every enclosing type, if nested).[ObservableProperty] to private fields named name, _name, or
m_name — never PascalCase. Let the generator emit the public property.SetProperty(ref field, value) boilerplate when the
field qualifies for [ObservableProperty].[NotifyPropertyChangedFor(nameof(Derived))] to raise change
notifications for derived/computed properties.[NotifyCanExecuteChangedFor(nameof(XxxCommand))] so commands
re-evaluate CanExecute when their inputs change.OnXxxChanging / OnXxxChanged partial-method hooks for
side-effects on property changes — do not subscribe to your own
PropertyChanged event.[property: SomeAttribute] to forward an attribute (e.g.,
[JsonIgnore], [JsonPropertyName(...)]) onto the generated property.[RelayCommand] on instance methods over manually constructed
RelayCommand / AsyncRelayCommand instances.[RelayCommand] methods must return void or Task (or Task<T>).
Never use async void — exceptions become unobserved.CancellationToken parameter and
optionally set IncludeCancelCommand = true to expose a paired
XxxCancelCommand.CanExecute = nameof(...) plus [NotifyCanExecuteChangedFor] on the
inputs to keep button enable/disable state in sync.AllowConcurrentExecutions to false (the default). Only set
true when overlapping invocations are explicitly safe and intended.FlowExceptionsToTaskScheduler = true when the UI binds to
ExecutionTask to render error states.WeakReferenceMessenger.Default. Only switch to
StrongReferenceMessenger.Default when profiling shows the messenger is
hot, and document the lifetime guarantees.(recipient, message) lambda form using the
static modifier — never capture this in the lambda.IRecipient<TMessage> interfaces on ObservableRecipient
ViewModels so RegisterAll(this) wires everything automatically when
IsActive = true.IsActive = true on activation (e.g., OnNavigatedTo) and
IsActive = false on deactivation (e.g., OnNavigatedFrom).int / string / Guid overloads) to scope
messages to a sub-system or window when more than one consumer would
otherwise collide.Microsoft.Extensions.DependencyInjection for service and ViewModel
registration. Prefer the .NET Generic Host
(Host.CreateDefaultBuilder()) so configuration, logging, and scope
validation are wired automatically.App.xaml.cs). Resolve the page's root ViewModel from DI in the page
constructor or via the navigation framework.Ioc.Default.GetService<T>() from inside ViewModels, services, or any
type the DI container can construct.AddSingleton<T>() — shell/main-window VMs, settings, file/HTTP
services, the shared IMessenger.AddTransient<T>() — per-page or per-document VMs.AddScoped<T>() — only with explicit IServiceScope usage; rarely
needed in client apps.IMessenger once
(services.AddSingleton<IMessenger>(WeakReferenceMessenger.Default))
and inject it via ObservableRecipient(messenger) constructors.ObservableValidator plus [NotifyDataErrorInfo] and DataAnnotation
attributes ([Required], [Range], [EmailAddress], [MinLength],
[MaxLength], [CustomValidation]).ValidateAllProperties() before submitting a form; check
HasErrors and bail out if true.ClearAllErrors() after a successful submit or
when resetting a form.ValidateProperty(value, nameof(Other))
from the changed property's OnXxxChanged hook.{x:Bind} (compiled bindings) over
{Binding}. Set Mode=OneWay or Mode=TwoWay explicitly — {x:Bind}
defaults to OneTime.Command="{x:Bind ViewModel.SaveCommand}" directly to the
generated command property.IsRunning, ExecutionTask.Status,
ExecutionTask.Exception) to surface progress/errors instead of
blocking the UI thread.[ObservableProperty] private string Name; — PascalCase field collides
with the generated property; use lowerCamel.RaisePropertyChanged(nameof(X)) calls alongside
[ObservableProperty] — produces duplicate notifications.Ioc.Default.GetService<T>() from inside a ViewModel constructor —
hides dependencies, breaks unit tests.StrongReferenceMessenger without OnDeactivated / UnregisterAll —
pins recipients and leaks them.this in messenger lambdas — closure allocation and
lifetime confusion. Always use (r, m) => r.OnX(m) with static.async void on [RelayCommand] methods — return Task instead.[ObservableProperty] field —
the equality comparer returns true and no change notification fires.
Replace the instance instead.ObservableValidator and ObservableRecipient —
not possible; use composition (inject IMessenger or implement
validation manually).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mvvm-toolkit, communitytoolkit-mvvm, dotnet-guidelines, wpf, winui
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job