C#
Write robust C# avoiding null traps, async deadlocks, and LINQ pitfalls.
Why use this skill?
Master C# development with the OpenClaw skill. Learn to prevent null traps, avoid async deadlocks, and optimize LINQ queries with expert coding standards.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ivangdavila/csharpWhat This Skill Does
The C# skill for OpenClaw provides high-level architectural guidance and code generation support for C# developers. It acts as a specialized pair programmer that enforces best practices related to memory management, asynchronous programming, and idiomatic language usage. The skill focuses on preventing common runtime vulnerabilities and performance bottlenecks, such as NullReferenceExceptions, deadlocks in Task-based asynchronous patterns, and the performance degradation caused by improper LINQ usage or heap allocations. By integrating this skill, the agent gains the ability to review, refactor, and generate clean, enterprise-grade C# code following the guidelines defined in the OpenClaw C# reference library.
Installation
To integrate this skill into your environment, run the following command via your terminal or agent interface:
clawhub install openclaw/skills/skills/ivangdavila/csharp
Use Cases
- Code Refactoring: Convert legacy codebases to modern C# standards (e.g., C# 12+ features).
- Performance Tuning: Identify and fix issues like multiple enumerations of IEnumerables, boxing of value types, or inefficient string concatenations.
- Async/Await Safety: Audit code for potential deadlocks when bridging synchronous and asynchronous boundaries.
- Memory Management: Optimize resource-heavy applications using IDisposable implementations and read-only structs to minimize allocations.
Example Prompts
- "Analyze this C# method for potential thread-safety issues with asynchronous calls and suggest a safer implementation using ConfigureAwait(false)."
- "I am getting a performance warning for my LINQ query. Can you check if I am causing multiple enumerations and suggest where to place a .ToList() call?"
- "Help me rewrite this class to safely handle nullable references by applying C# 8.0+ nullability patterns instead of using traditional null checks."
Tips & Limitations
- Null Safety: While
?.and??are powerful, always remember that!is a temporary override—it does not remove nullability, it only hides the compiler warning; use it sparingly. - LINQ awareness: Always remember that LINQ queries are lazy. If you are querying a database, ensure you understand the translation layer to prevent n+1 query problems.
- Structs: Be wary of passing structs into async methods, as they are copied. Use
readonly structwhere possible to force immutability and enable compiler-level performance optimizations. - Data Integrity: Never use
floatordoublefor financial applications. Always rely ondecimalto avoid rounding errors and precision loss. - Documentation: Refer to the
Quick Referencetables in the source repository for deep dives into specific topics likeIDisposableor equality overrides.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ivangdavila-csharp": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
Animations
Create performant web animations with proper accessibility and timing.
Arduino
Develop Arduino projects avoiding common wiring, power, and code pitfalls.
Bulgarian
Write Bulgarian that sounds human. Not formal, not robotic, not AI-generated.
Arabic
Write Arabic that sounds human. Not formal, not robotic, not AI-generated.
Assistant
Manage tasks, communications, and scheduling with proactive and organized support.