Skip to main content
skill GitHub Copilot official · GitHub

csharp-async — GitHub Copilot skill: install and use

This skill guides Copilot through C# async best practices and flags common mistakes. Use it when reviewing async methods, tasks, and public APIs.

Install into GitHub Copilot · Skills CLI (Vercel) All methods and platforms ↓
npx skills add github/awesome-copilot --skill csharp-async
Open on GitHub

What csharp-async does

The skill reviews async C# against concrete rules: Async method suffixes, suitable Task and Task return types, careful use of ValueTask, and no async void outside event handlers. It also checks exception handling and suggests ConfigureAwait(false) where library code needs it.

Its guidance covers Task.WhenAll() for parallel work, Task.WhenAny() for timeouts or the first completed task, cancellation tokens for long-running operations, and cases where async/await only adds a pass-through. It flags .Wait(), .Result, .GetAwaiter().GetResult(), mixed blocking and async code, and Task-returning calls that are never awaited.

Use it for C# code review and for public APIs built around TAP, async streams with IAsyncEnumerable, or long-running commands. Install it when Copilot should apply a shared async checklist; it has no role in projects that do not use C#.

What it helps with

  • check Async suffixes on methods
  • spot blocking .Wait() and .Result calls
  • choose Task.WhenAll() for concurrent tasks
  • catch lost exceptions in async code
  • review IAsyncEnumerable usage

Example prompts for the agent

  • Review this C# code with the csharp-async rules and suggest fixes.
  • Find `.Wait()`, `.Result`, and `async void` usages that should change.
  • Show where `Task.WhenAll()` and a cancellation token fit here.

How to install csharp-async

1Skills CLI (Vercel)

npx skills add github/awesome-copilot --skill csharp-async

2GitHub CLI

gh skill install github/awesome-copilot csharp-async

3Manually: put the files in place

.github/skills/csharp-async/SKILL.md

From the same set554

The whole set →
git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. GitHub Copilot 47,165installs excalidraw-diagram-generator official github Turn a plain-language description into an Excalidraw diagram. Useful for mapping processes, system structure, and relationships between entities. GitHub Copilot 31,639installs multi-stage-dockerfile official github This skill guides GitHub Copilot in writing multi-stage Dockerfiles for different languages and frameworks. Use it when the final runtime image should contain fewer build dependencies. GitHub Copilot 29,688installs documentation-writer official github Skill that turns the agent into a technical writer following the Diátaxis framework: tutorials, how-to guides, reference, and explanation. Proposes structure before writing. GitHub Copilot 27,757installs prd official github Turns a feature idea into a structured PRD with user stories, technical requirements, and risks. Use it when planning a software feature or an AI-powered one. GitHub Copilot 24,035installs refactor official github This skill reshapes existing code without changing its external behavior. Use it for gradual cleanup of large functions, duplication, weak types, and code smells. GitHub Copilot 22,321installs java-springboot official github Gives GitHub Copilot Spring Boot development practices, from project layout to tests and security. Use it when writing or reviewing Java application code. GitHub Copilot 21,272installs create-readme official github This skill reviews a project and creates a structured README.md. Use it when the repository needs clear documentation based on its actual files and code. GitHub Copilot 19,081installs

Similar

code-simplifier rtk-ai Reviews Rust code in RTK to remove over-engineering and needless allocations. It applies idiomatic simplifications without altering runtime behavior. Claude Code CX Codex Cursor +1 2,100installs rtk-tdd rtk-ai This skill enforces a Red-Green-Refactor workflow for Rust and activates on implementation, testing, refactoring, and bug-fixing tasks. Claude Code CX Codex Cursor +1 2,100installs typescript-expert sickn33 A skill for TypeScript and JavaScript work: it reads your project setup, fixes type errors and speeds up type checking. Useful once a TS codebase gets big. Claude Code CX Codex Cursor +1 12,600installs migrate-to-shoehorn Matt Pocock Replaces as type assertions in tests with helpers from @total-typescript/shoehorn. Use it when tests need partial objects or deliberately invalid data. Claude Code 475,388installs write-swift emilkowalski This skill guides Swift coding, reviews, and migrations using the language’s current practices. Use it to investigate concurrency errors, hangs, data races, or retain cycles. Claude Code CX Codex Cursor +1 117,500installs megacave JuliusBrussee Switches agent responses to Classical Chinese (wenyan) to reduce terminal output. Activated via /megacave or /caveman wenyan. Claude Code CX Codex Cursor +1 24,400installs find-docs upstash Pulls up-to-date documentation, API references and code examples for any library through the Context7 CLI. Useful when the model's training data lags behind the API. Claude Code CX Codex Cursor +1 9,400installs typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs

Questions about csharp-async

How do I install csharp-async in GitHub Copilot?

Run npx skills add github/awesome-copilot --skill csharp-async, gh skill install github/awesome-copilot csharp-async, or place the skill at .github/skills/csharp-async/SKILL.md.

What does csharp-async do?

It helps Copilot review async C# code by checking return types, exception handling, awaited tasks, and common blocking calls.

Which performance patterns does csharp-async check?

It covers Task.WhenAll(), Task.WhenAny(), unnecessary async/await, ValueTask, and cancellation tokens for long-running operations.

Source text

SKILL.md · MIT
---
name: csharp-async
description: 'Get best practices for C# async programming'
---

# C# Async Programming Best Practices

Your goal is to help me follow best practices for asynchronous programming in C#.

## Naming Conventions

- Use the 'Async' suffix for all async methods
- Match method names with their synchronous counterparts when applicable (e.g., `GetDataAsync()` for `GetData()`)

## Return Types

- Return `Task<T>` when the method returns a value
- Return `Task` when the method doesn't return a value
- Consider `ValueTask<T>` for high-performance scenarios to reduce allocations
- Avoid returning `void` for async methods except for event handlers

## Exception Handling

- Use try/catch blocks around await expressions
- Avoid swallowing exceptions in async methods
- Use `ConfigureAwait(false)` when appropriate to prevent deadlocks in library code
- Propagate exceptions with `Task.FromException()` instead of throwing in async Task returning methods

## Performance

- Use `Task.WhenAll()` for parallel execution of multiple tasks
- Use `Task.WhenAny()` for implementing timeouts or taking the first completed task
- Avoid unnecessary async/await when simply passing through task results
- Consider cancellation tokens for long-running operations

## Common Pitfalls

- Never use `.Wait()`, `.Result`, or `.GetAwaiter().GetResult()` in async code
- Avoid mixing blocking and async code
- Don't create async void methods (except for event handlers)
- Always await Task-returning methods

## Implementation Patterns

- Implement the async command pattern for long-running operations
- Use async streams (IAsyncEnumerable<T>) for processing sequences asynchronously
- Consider the task-based asynchronous pattern (TAP) for public APIs

When reviewing my C# code, identify these issues and suggest improvements that follow these best practices.

© github · MIT · github/awesome-copilot

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor