🦀 ClawHub
C#
by @ivangdavila
Avoid common C# mistakes — null traps, async pitfalls, LINQ gotchas, and disposal leaks.
TERMINAL
clawhub install csharp📖 About This Skill
name: C# slug: csharp version: 1.0.1 description: Write robust C# avoiding null traps, async deadlocks, and LINQ pitfalls. metadata: {"clawdbot":{"emoji":"💜","requires":{"bins":["dotnet"]},"os":["linux","darwin","win32"]}}
Quick Reference
| Topic | File |
|-------|------|
| Null reference, nullable types | nulls.md |
| Async/await, deadlocks | async.md |
| Deferred execution, closures | linq.md |
| Value vs reference, boxing | types.md |
| Iteration, equality | collections.md |
| IDisposable, using, finalizers | dispose.md |
Critical Rules
?. and ?? prevent NRE but ! overrides warnings — still crashes if null.Result or .Wait() on UI thread — deadlock, use await or ConfigureAwait(false)query.Where(...) doesn't execute until iteration.ToList() firstStringComparison.Ordinal for code, CurrentCulture for UIGetHashCode() must be stable — mutable fields break dictionary lookup.ToList() to iterate copydecimal for money — float/double have precision lossreadonly struct prevents defensive copies — use for performancesealed prevents inheritance — enables devirtualization optimization