---
description: SimHub plugin and C# coding standards
globs: plugin/**/*.cs
alwaysApply: false
---

# SimHub Plugin & C#

- Follow SimHub SDK conventions (device extensions, properties, actions)
- Use async/await for I/O; proper error handling and logging
- Keep plugin logic in `plugin/`; reference memory-bank for requirements
- Deploy output plugin DLL only to `C:\Program Files (x86)\SimHub\PluginsData\`
- Do not add alternative deploy targets for SimHub plugin copy steps

```csharp
// ✅ Clear error handling for OBS WebSocket operations
try {
  await _obsClient.SendAsync(startRecordRequest);
} catch (WebSocketException ex) {
  SimHub.Logging.Current.Error("OBS recording start failed", ex);
  // Surface connection error to UI via plugin property
  ObsConnectionStatus = "Error";
}
```
