dreamteam-hq/brigid/dotnet-mvvm-backend
Claude Code and agent skill by dreamteam-hq/brigid
- community
Checking that the SKILL.md file is still in the repository.
MVVM architecture for .NET game backends — System.Reactive, DynamicData, SourceCache, ViewModel binding with Godot nodes, ItemsNode collection pattern
Install
npx vskill@latest install dreamteam-hq/brigid/dotnet-mvvm-backendSKILL.md
The same SKILL.md was published earlier as dreamteam-hq/brigid/dotnet-mvvm-backend.
.NET MVVM Backend Architecture
MVVM in This Project
This project uses MVVM as a backend architecture pattern for its Godot 4.6 game client. This is NOT WPF/MAUI MVVM.
- Models live in the shared
GameProjectlibrary (GameProject.Models). These are wire types likeCharacterData,CharacterAction, andMoveBeginused by both client and server. - ViewModels live in
GameProject.Game/ViewModels/. They are client-side only and driven by System.Reactive.MainViewModel,RemoteCharacterVM,LocalPlayerCharacterVM. - Views are Godot nodes in
GameProject.Game/Views/.PlayerNode(base CharacterBody3D),RemotePlayerNode,ItemsNode. - The server has no ViewModels. MapHub owns models directly.
System.Reactive Patterns
Subject<T>is used for event streams that receive pushes from the network layer.RemoteCharacterVM.Updatesis aSubject<CharacterAction>that receives actions viaOnNext()fromMainViewModel.HandleMessage().IObservable<T>is used for derived state.RemoteCharacterVM.Positionis derived fromUpdatesvia.Select(x => x.Position).StartWith(data.Position), producing a position stream that starts with the spawn position and updates on each action.ValueSubject<T>wrapsBehaviorSubject<T>to expose a.Valueproperty with get/set semantics. Setting.ValuecallsOnNext()internally. Used forMainViewModel.StatusandMainViewModel.Player.
DynamicData / SourceCache
MainViewModel uses SourceCache<RemoteCharacterVM, Guid> keyed by x => x.Id for the collection of remote players. The connection pipeline:
Bind() bridges the SourceCache changeset stream into a ReadOnlyObservableCollection that implements INotifyCollectionChanged. Mutations happen through AddOrUpdate() and Remove() on the SourceCache; the bound collection updates automatically.
ObservableDictionary<TValue, TKey> is a helper that wraps SourceCache with the same Connect/Bind pattern and forwards CollectionChanged events from the bound collection.
ItemsNode Pattern
ItemsNode is a generic Node3D that observes a ViewModel collection and manages child scene instances:
- Has an
[Export] PackedScene NodeTemplateset in the Godot editor. Itemsproperty accepts anyINotifyCollectionChanged. Setting it subscribes toCollectionChanged.- On
Add: instantiatesNodeTemplate, casts toIBindable, callsBind(item), thenAddChild(node). Tracks in_nodesByItemdictionary. - On
Remove: looks up the node by VM reference, callsQueueFree(), removes from dictionary. - On
Reset: despawns all existing nodes (QueueFree()), clears dictionary, then re-creates nodes for all current items.
This lets you bind ItemsNode.Items = mainViewModel.RemoteCharacterList and have nodes spawn/despawn reactively as the SourceCache changes.
IBindable Interface
Defined in ItemsNode.cs. Views implement IBindable to receive their ViewModel:
RemotePlayerNode implements both IBindable (untyped, for ItemsNode) and a typed Bind(RemoteCharacterVM viewModel) that does the actual wiring. The untyped overload casts and delegates. Inside Bind(), Rx subscriptions are set up: subscribing to Position to update Position, subscribing to Updates to dispatch Jump(), StopMoving(), and MoveBegin() on the PlayerNode base class.
LocalPlayerCharacterVM vs RemoteCharacterVM
- LocalPlayerCharacterVM holds plain properties (
PositionasGodot.Vector3,Color). It captures local input and sends actions to the server viaserverClient.Map.RelayCharacterAction(). No Rx observables -- the local view reads its properties directly. - RemoteCharacterVM is Rx-driven. It exposes
Subject<CharacterAction> Updatesand derivesIObservable<Vector2> Position. The view subscribes to these streams to replicate remote player state. - Both feed
PlayerNode(the sharedCharacterBody3Dbase with physics, gravity, andIInputActionmethods) but through different paths: local drives it from input, remote drives it from Rx subscriptions.
Thread Safety
All Rx subscriptions fire on the main thread. MainViewModel.Process() reads from socketManager.Incoming.Reader (a Channel) and calls OnNext() on subjects synchronously. Process() is called from _Process() in the Godot scene tree, which runs on the main thread every frame. Because all OnNext() calls originate from Process(), subscribers never fire on a background thread. The socket read loop (socketManager.Run()) writes to the Channel from a background task, but the Channel decouples it from the main thread consumer.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dotnet-mvvm-backend/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dreamteam-hq/brigid/dotnet-mvvm-backend)