csharp-async
Guidelines for writing robust, efficient asynchronous C# code in isolated Azure Functions.
Install
mkdir -p .claude/skills/csharp-async && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15085" && unzip -o skill.zip -d .claude/skills/csharp-async && rm skill.zipInstalls to .claude/skills/csharp-async
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when implementing or reviewing async C# code in XPoster: Task-based APIs, cancellation, timeout handling, and sync-over-async avoidance in Azure Functions isolated workflows.Key capabilities
- →Use Async suffix for asynchronous methods
- →Return Task or Task<T> for asynchronous APIs
- →Keep async end-to-end across function orchestration
- →Accept and propagate CancellationToken
- →Log actionable context for operational failures
- →Use Task.WhenAll for independent work
How it works
The skill provides guidelines for implementing and reviewing asynchronous C# code, focusing on naming conventions, end-to-end async patterns, cancellation, error handling, and concurrency. It aims to prevent common async pitfalls.
Inputs & outputs
When to use csharp-async
- →Refactoring blocking C# code
- →Adding cancellation support to services
- →Optimizing Azure Function performance
About this skill
C# Async Best Practices For XPoster
Use this skill when implementing or reviewing asynchronous code in XPoster.
Naming And Signatures
- Use the Async suffix for asynchronous methods.
- Return Task or Task<T> for asynchronous APIs.
- Avoid async void except event handlers.
Azure Functions Isolated Context
- Keep async end-to-end across function orchestration, generators, services, and sender plugins.
- Avoid sync-over-async patterns (.Result, .Wait(), GetAwaiter().GetResult()).
- Treat cancellation as first-class at I/O boundaries when possible.
Cancellation And Timeouts
- Accept and propagate CancellationToken where signatures allow.
- Use cancellation-aware APIs (for example Task.Delay with token).
- Prefer explicit timeout and cancellation composition over fire-and-forget behavior.
Error Handling
- Do not swallow async exceptions.
- Log actionable context for operational failures.
- Rethrow or propagate failures when they must surface to runtime monitoring.
Concurrency Patterns
- Use Task.WhenAll only for independent work with acceptable fan-out.
- Use Task.WhenAny for first-result and timeout workflows where justified.
- Avoid unbounded parallelism for outbound API calls.
Performance And Reliability
- Avoid unnecessary async wrappers that only forward tasks.
- Consider ValueTask only when there is measured benefit.
- Keep memory allocations moderate on hot paths.
Review Checklist
- No blocking calls in async flow.
- No lost tasks (all Task-returning calls are awaited or intentionally tracked).
- Cancellation tokens are propagated where feasible.
- Failure logs include enough context to diagnose schedule/generator/sender path.
When not to use it
- →When using async void except for event handlers
- →When using sync-over-async patterns like .Result or .Wait()
- →When swallowing async exceptions
Limitations
- →The skill is specific to the XPoster project.
- →Async void is only allowed for event handlers.
- →ValueTask should only be used when there is a measured benefit.
How it compares
This skill offers specific C# async best practices tailored for the XPoster project and Azure Functions isolated contexts, providing more targeted guidance than general C# async documentation.
Compared to similar skills
csharp-async side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| csharp-async (this skill) | 0 | 2mo | No flags | Intermediate |
| dotnet-native-aot | 0 | 5mo | Review | Advanced |
| csharp-developer | 43 | 3mo | No flags | Advanced |
| csharp-pro | 9 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by artcava
View all by artcava →You might also like
dotnet-native-aot
rudironsoni
>-
csharp-developer
zenobi-us
Expert C# developer specializing in modern .NET development, ASP.NET Core, and cloud-native applications. Masters C# 12 features, Blazor, and cross-platform development with emphasis on performance and clean architecture.
csharp-pro
sickn33
Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions.
performance-benchmark
dotnet
Generate and run ad hoc performance benchmarks to validate code changes. Use this when asked to benchmark, profile, or validate the performance impact of a code change in dotnet/runtime.
dotnet-backend-patterns
wshobson
Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.
azure-servicebus-dotnet
microsoft
Azure Service Bus SDK for .NET. Enterprise messaging with queues, topics, subscriptions, and sessions. Use for reliable message delivery, pub/sub patterns, dead letter handling, and background processing. Triggers: "Service Bus", "ServiceBusClient", "ServiceBusSender", "ServiceBusReceiver", "ServiceBusProcessor", "message queue", "pub/sub .NET", "dead letter queue".