Official agent skill

Mvvm Toolkit Messenger

by github in github/awesome-copilot

CommunityToolkit.Mvvm Messenger pub/sub for decoupled communication between ViewModels (or any objects).

OfficialMITAuto-check passedMobile

Install Mvvm Toolkit Messenger

skills CLI
$ npx skills add github/awesome-copilot --skill mvvm-toolkit-messenger -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install github/awesome-copilot mvvm-toolkit-messenger --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mvvm-toolkit-messenger .claude/skills/mvvm-toolkit-messenger && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mvvm-toolkit-messenger
GitHub stars
40k
Used in
1 other repo
Token cost
~2.2k tokens
SKILL.md length
573 words
Files
2 (incl. references)
Skills in repo
417
Repo updated
First seen
Licence
MIT

At a glance

CommunityToolkit.Mvvm Messenger pub/sub for decoupled communication between ViewModels (or any objects).

  • Works in 6 steps: Capturing this in the lambda. (r, m) =>… → Strong-ref recipients without… → Inherited message types. A handler… → …
  • Tasks that involve Event-driven systems
  • SKILL.md covers When to use this skill, Choose an implementation, Define a message and Register a recipient, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Mvvm Toolkit Messenger is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. CommunityToolkit.Mvvm Messenger pub/sub for decoupled communication between ViewModels (or any objects). Covers WeakReferenceMessenger vs StrongReferenceMessenger, IRecipient<TMessage, RequestMessage<T / AsyncRequestMessage<T / CollectionRequestMessage<T, ValueChangedMessage<T, channels (tokens), and the ObservableRecipient activation lifecycle. Use across WPF, WinUI 3, .NET MAUI, Uno, and Avalonia.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/messenger-patterns.md`).

It sits in Mobile, covering Event-driven systems. It works with Avalonia and Windows. The repository describes itself as: Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot. The licence is MIT.

When your agent uses it

  • Tasks that involve Event-driven systems

Example prompts

  • “/mvvm-toolkit-messenger”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Capturing this in the lambda. (r, m) => OnX(m) implicitly
  2. Strong-ref recipients without Unregister. With
  3. Inherited message types. A handler registered for BaseMessage is
  4. Wrong messenger instance. Sending via WeakReferenceMessenger.Default
  5. OnActivated never runs. ObservableRecipient only registers
  6. Cross-thread updates. The messenger is thread-agnostic. If a

What it can do on your machine

Read from SKILL.md and the folder at commit 727ff2e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mvvm Toolkit Messenger loads about 2.2k tokens when it runs, and up to ~4k if it reads all its reference files. Until then it costs about 108 tokens; SKILL.md has 573 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~108
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from github/awesome-copilot at commit 727ff2e, republished under its MIT licence (© github). 573 words, ~2,214 tokens.

Download SKILL.mdSave it as .claude/skills/mvvm-toolkit-messenger/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
mvvm-toolkit-messenger
description
CommunityToolkit.Mvvm Messenger pub/sub for decoupled communication between ViewModels (or any objects). Covers WeakReferenceMessenger vs StrongReferenceMessenger, IRecipient<TMessage>, RequestMessage<T> / AsyncRequestMessage<T> / CollectionRequestMessage<T>, ValueChangedMessage<T>, channels (tokens), and the ObservableRecipient activation lifecycle. Use across WPF, WinUI 3, .NET MAUI, Uno, and Avalonia.

CommunityToolkit.Mvvm Messenger

Pub/sub messaging for ViewModels (or any objects) without forcing a shared reference graph. Part of CommunityToolkit.Mvvm 8.x.

TL;DR. Default to WeakReferenceMessenger.Default. Register handlers with the (recipient, message) lambda and the static modifier so you never capture this. Inherit from ObservableRecipient and toggle IsActive at activation/deactivation to get automatic register/unregister.


When to use this skill

  • Two or more ViewModels need to react to an event (login, theme change, save, navigation) without holding references to each other
  • A ViewModel needs to ask another VM for a value (request/reply)
  • You're scoping events to a sub-system or window with channel tokens
  • Diagnosing "my handler never fires" or weak-reference recipient lifetime problems

For source generators, base classes, and commands see the mvvm-toolkit skill. For DI wiring (registering an IMessenger instance), see mvvm-toolkit-di.


Choose an implementation

TypeWhen
WeakReferenceMessenger.DefaultDefault. Recipients held weakly — eligible for GC even while registered. Internal trimming runs during full GCs; no manual Cleanup() needed.
StrongReferenceMessenger.DefaultProfiler shows the messenger is hot and allocation matters. Recipients are pinned until you Unregister. Forgetting unregistration leaks them.
Custom IMessenger instancePer-window/per-scope (e.g., one messenger per app window). Construct directly, inject via DI.

ObservableRecipient's parameterless constructor uses WeakReferenceMessenger.Default. Pass a different IMessenger to its constructor to override.


Define a message

The toolkit ships base classes; any class works.

csharp
using CommunityToolkit.Mvvm.Messaging.Messages;

// Single-payload broadcast
public sealed class LoggedInUserChangedMessage(User user)
    : ValueChangedMessage<User>(user);

// Custom shape (records are great for this)
public sealed record ThemeChangedMessage(AppTheme NewTheme);

// Empty signal
public sealed record RefreshRequestedMessage;

Register a recipient

csharp
WeakReferenceMessenger.Default.Register<MyViewModel, ThemeChangedMessage>(
    this,
    static (recipient, message) => recipient.OnThemeChanged(message.NewTheme));

The static modifier prevents accidental closure allocation and keeps this out of the lambda — use the recipient parameter instead.

IRecipient<TMessage> interface style
csharp
public sealed class MyViewModel : ObservableRecipient,
    IRecipient<ThemeChangedMessage>,
    IRecipient<RefreshRequestedMessage>
{
    public void Receive(ThemeChangedMessage message) { /* ... */ }
    public void Receive(RefreshRequestedMessage message) { /* ... */ }
}

ObservableRecipient.OnActivated() calls Messenger.RegisterAll(this), which subscribes every IRecipient<T> interface implemented by the type. If you're not using ObservableRecipient, register manually:

csharp
WeakReferenceMessenger.Default.RegisterAll(this);

Send a message

csharp
WeakReferenceMessenger.Default.Send(new ThemeChangedMessage(AppTheme.Dark));

// Empty payloads use the parameterless overload:
WeakReferenceMessenger.Default.Send<RefreshRequestedMessage>();

Channels (tokens)

Scope messages to a sub-system or window with a token (any equatable value — int, string, Guid):

csharp
const int LeftPaneChannel = 1;

WeakReferenceMessenger.Default.Register<MyViewModel, RefreshRequestedMessage, int>(
    this, LeftPaneChannel,
    static (r, _) => r.RefreshLeft());

WeakReferenceMessenger.Default.Send(new RefreshRequestedMessage(), LeftPaneChannel);

Messages sent without a token use the default shared channel — they are not delivered to channel-scoped recipients.


Request / reply

For ask-style scenarios where a recipient provides a value back to the sender, use the RequestMessage<T> family.

Sync request
csharp
public sealed class CurrentUserRequest : RequestMessage<User> { }

WeakReferenceMessenger.Default.Register<UserService, CurrentUserRequest>(
    this,
    static (r, m) => m.Reply(r.CurrentUser));

User user = WeakReferenceMessenger.Default.Send<CurrentUserRequest>();

The implicit conversion from CurrentUserRequest to User throws if no recipient called Reply. Capture the message to check first:

csharp
var request = WeakReferenceMessenger.Default.Send<CurrentUserRequest>();
if (request.HasReceivedResponse)
    User user = request.Response;
Async request
csharp
public sealed class CurrentUserRequest : AsyncRequestMessage<User> { }

WeakReferenceMessenger.Default.Register<UserService, CurrentUserRequest>(
    this,
    static (r, m) => m.Reply(r.GetCurrentUserAsync()));

User user = await WeakReferenceMessenger.Default.Send<CurrentUserRequest>();
Show full SKILL.md (231 more words)Show less
Collection requests (fan-in)

CollectionRequestMessage<T> and AsyncCollectionRequestMessage<T> collect a Reply from every responding recipient:

csharp
public sealed class OpenDocumentsRequest : CollectionRequestMessage<Document> { }

var docs = WeakReferenceMessenger.Default.Send<OpenDocumentsRequest>();
foreach (Document doc in docs) { /* ... */ }

Lifecycle

Even with WeakReferenceMessenger, unregister explicitly when a recipient is being torn down — it trims dead entries and improves performance:

csharp
WeakReferenceMessenger.Default.Unregister<ThemeChangedMessage>(this);
WeakReferenceMessenger.Default.Unregister<ThemeChangedMessage, int>(this, LeftPaneChannel);
WeakReferenceMessenger.Default.UnregisterAll(this);

ObservableRecipient.OnDeactivated() does this automatically when IsActive flips to false. Set it from your activation hook:

csharp
protected override void OnNavigatedTo(NavigationEventArgs e)
{
    base.OnNavigatedTo(e);
    ViewModel.IsActive = true;
}

protected override void OnNavigatedFrom(NavigationEventArgs e)
{
    ViewModel.IsActive = false;
    base.OnNavigatedFrom(e);
}

Common pitfalls

  1. Capturing this in the lambda. (r, m) => OnX(m) implicitly captures this; allocates a closure and confuses lifetime. Always use (r, m) => r.OnX(m) with static.
  2. Strong-ref recipients without Unregister. With StrongReferenceMessenger, recipients (and their entire object graph) stay pinned forever. Either inherit from ObservableRecipient (auto-unregisters in OnDeactivated) or call UnregisterAll(this).
  3. Inherited message types. A handler registered for BaseMessage is not invoked for DerivedMessage : BaseMessage. Register each concrete type.
  4. Wrong messenger instance. Sending via WeakReferenceMessenger.Default and registering via an injected per-window messenger means the message never arrives. Use the same IMessenger everywhere (typically inject it via ObservableRecipient(messenger)).
  5. OnActivated never runs. ObservableRecipient only registers IRecipient<T> handlers when IsActive flips from false to true.
  6. Cross-thread updates. The messenger is thread-agnostic. If a handler updates UI, marshal manually (DispatcherQueue.TryEnqueue / Dispatcher.BeginInvoke).

Multiple messengers (per-window scoping)

csharp
services.AddSingleton<IMessenger>(WeakReferenceMessenger.Default); // app-wide
services.AddScoped<WindowScopedMessenger>();                       // per-window

Inject the appropriate IMessenger into the ViewModel constructor:

csharp
public sealed partial class WindowViewModel(IMessenger messenger)
    : ObservableRecipient(messenger) { }

This isolates broadcasts to a single window — useful for multi-window desktop apps (WinUI 3, WPF, MAUI desktop, Avalonia).


References

TopicFile
Full deep dive (more channel/lifecycle examples, diagnostics)references/messenger-patterns.md

External:

© github, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/mvvm-toolkit-messenger of github/awesome-copilot.

  • SKILL.md
  • references/messenger-patterns.md

Open the folder on GitHubat commit 727ff2e

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in github/awesome-copilot, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Mvvm Toolkit Messenger next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mvvm Toolkit Messenger compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mvvm Toolkit Messenger this skillgithub/awesome-copilot40k1 repos~2.2kAutomated safety check: PassMIT
Translation Source SyncDevolutions/UniGetUI26k—~1.2kAutomated safety check: PassMIT
Maaend Test ImageMaaEnd/MaaEnd4k—~1.3kAutomated safety check: PassAGPL-3.0
Bump Swift Versionjamesmontemagno/tiny-clips118—~695Automated safety check: PassMIT
Maa CLI Operateduorua/narutomobile335—~981Automated safety check: PassAGPL-3.0
Frb Vmware Windows Preparefzyzcjy/flutter_rust_bridge5.4k—~316Automated safety check: PassMIT

Similar skills

  • Translation Source Sync

    Devolutions/UniGetUI

    Synchronizes the UniGetUI English language file with source-code usage, identifies missing translation keys, removes unused entries, reports localization drift, and can reorder locale files to match…

    26k GitHub stars~1.2k tokensUpdated today
    Writing & ContentAuto-check passed
  • Maaend Test Image

    MaaEnd/MaaEnd

    为 MaaEnd 添加、导入或补充节点识别测试截图,并按仓库约定脱敏图片、放入 tests/MaaEndTestset、维护 tests//test.json 和运行 pnpm check/pnpm test 验证。用户提到“添加测试图片/截图”“把截图加入 ADB 或 Win32 测试集”“给节点补正例或反例”“更新 hits/box”“UID…

    4k GitHub stars~1.3k tokensUpdated today
    MobileAuto-check passed
  • Bump Swift Version

    jamesmontemagno/tiny-clips

    Bump the version for the TinyClips Swift app across Info.plist, Info-MAS.plist, and project.pbxproj.

    118 GitHub stars~695 tokensUpdated today
    MobileAuto-check passed
  • Maa CLI Operate

    duorua/narutomobile

    Operate MaaFramework devices and Pipeline resources through the maafw-cli command line with strict JSON output.

    335 GitHub stars~981 tokensUpdated yesterday
    MobileAuto-check passed
  • Frb Vmware Windows Prepare

    fzyzcjy/flutter_rust_bridge

    A skill your agent uses when preparing the FRB VMware Fusion Windows 11 Arm base VM.

    5.4k GitHub stars~316 tokensUpdated yesterday
    MobileAuto-check passed
  • Winui

    managedcode/dotnet-skills

    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.

    486 GitHub stars~1.4k tokensUpdated today
    MobileAuto-check passed

More from github/awesome-copilot

All 417 skills in this repo
  • Acquire Codebase Knowledge

    github/awesome-copilot

    Official

    Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Azure Architecture Autopilot

    github/awesome-copilot

    Official

    Designs Azure infrastructure from a natural-language description, or diagrams an existing resource group, then refines the design through conversation and deploys it with Bicep.

    40k GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Draw.io Diagram Generator

    github/awesome-copilot

    Official

    Generates, edits and validates draw.io files with correct mxGraph XML, covering flowcharts, architecture, sequence, ER and UML class diagrams.

    40k GitHub starsUsed in 1 repo~4.9k tokens
    Auto-check passed
  • Credit Risk Data Cleaning

    github/awesome-copilot

    Official

    Cleans raw credit data and screens variables before loan modeling, dropping unstable, noisy or redundant features and writing an Excel report of every step.

    40k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Daily Focus Board

    github/awesome-copilot

    Official

    Builds a warm, browser-based daily focus board the user updates by talking to their agent, with Eisenhower priorities, a brain-dump box and kind not-today carryover.

    40k GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Python Pypi Package Builder

    github/awesome-copilot

    Official

    End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI.

    40k GitHub starsUsed in 1 repo~4.6k tokens
    Auto-check passed

Works with

Questions about Mvvm Toolkit Messenger

What does Mvvm Toolkit Messenger do?

CommunityToolkit.Mvvm Messenger pub/sub for decoupled communication between ViewModels (or any objects). Mvvm Toolkit Messenger is an agent skill from github/awesome-copilot, published by the product's own GitHub organization.Mvvm Messenger pub/sub for decoupled communication between ViewModels (or any objects).

When should I use Mvvm Toolkit Messenger?

Mvvm Toolkit Messenger fits situations like: tasks that involve Event-driven systems.

How do I install Mvvm Toolkit Messenger in Claude Code?

Run `npx skills add github/awesome-copilot --skill mvvm-toolkit-messenger -a claude-code`. Or copy the skill folder (skills/mvvm-toolkit-messenger in github/awesome-copilot) into .claude/skills/mvvm-toolkit-messenger in your project. Claude Code loads it when a task matches its description.

How do I install Mvvm Toolkit Messenger in Codex?

Run `npx skills add github/awesome-copilot --skill mvvm-toolkit-messenger -a codex`. Or copy the skill folder (skills/mvvm-toolkit-messenger in github/awesome-copilot) into .agents/skills/mvvm-toolkit-messenger in your project. Codex loads it when a task matches its description.

Can I use Mvvm Toolkit Messenger in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add github/awesome-copilot --skill mvvm-toolkit-messenger -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mvvm-toolkit-messenger, .gemini/skills/mvvm-toolkit-messenger, .github/skills/mvvm-toolkit-messenger and .opencode/skills/mvvm-toolkit-messenger in your project.

What does Mvvm Toolkit Messenger need to run?

SKILL.md names no scripts, command-line tools or credentials: Mvvm Toolkit Messenger is instructions for the agent only.

Does Mvvm Toolkit Messenger access the network?

SKILL.md names 2 domains. As links in the text: learn.microsoft.com and github.com. This is read from the text; nothing was executed.

Is Mvvm Toolkit Messenger safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mvvm Toolkit Messenger use?

Mvvm Toolkit Messenger is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mvvm Toolkit Messenger use?

About 2.2k tokens (SKILL.md is roughly 8.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.8k tokens, read only when the agent opens those files.

What are the alternatives to Mvvm Toolkit Messenger?

Skills that share tags, products or a category with Mvvm Toolkit Messenger: Translation Source Sync (Devolutions/UniGetUI, 26k stars), Maaend Test Image (MaaEnd/MaaEnd, 4k stars), Bump Swift Version (jamesmontemagno/tiny-clips, 118 stars) and Maa CLI Operate (duorua/narutomobile, 335 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mvvm Toolkit Messenger?

github (a GitHub organization, an official publisher) maintains it in github/awesome-copilot, which has 39,748 GitHub stars. The repository holds 417 skills in this directory. The repository was last updated on October 7, 2026.

Source: github/awesome-copilot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.