CS

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.zip

Installs 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.
178 chars✓ has a “when” trigger
Intermediate

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

You give it
C# code for implementation or review
You get back
Asynchronous C# code adhering to best practices for XPoster

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.

SkillInstallsUpdatedSafetyDifficulty
csharp-async (this skill)02moNo flagsIntermediate
dotnet-native-aot05moReviewAdvanced
csharp-developer433moNo flagsAdvanced
csharp-pro94moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

dotnet-native-aot

rudironsoni

>-

00

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.

43151

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.

953

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.

328

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.

722

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".

316

Search skills

Search the agent skills registry