{"kind":"Skill","metadata":{"namespace":"community","name":"csharp-async","version":"0.1.0"},"spec":{"description":"Get best practices for C# async programming","files":{"SKILL.md":"---\nname: csharp-async\ndescription: 'Get best practices for C# async programming'\n---\n\n# C# Async Programming Best Practices\n\nYour goal is to help me follow best practices for asynchronous programming in C#.\n\n## Naming Conventions\n\n- Use the 'Async' suffix for all async methods\n- Match method names with their synchronous counterparts when applicable (e.g., `GetDataAsync()` for `GetData()`)\n\n## Return Types\n\n- Return `Task\u003cT\u003e` when the method returns a value\n- Return `Task` when the method doesn't return a value\n- Consider `ValueTask\u003cT\u003e` for high-performance scenarios to reduce allocations\n- Avoid returning `void` for async methods except for event handlers\n\n## Exception Handling\n\n- Use try/catch blocks around await expressions\n- Avoid swallowing exceptions in async methods\n- Use `ConfigureAwait(false)` when appropriate to prevent deadlocks in library code\n- Propagate exceptions with `Task.FromException()` instead of throwing in async Task returning methods\n\n## Performance\n\n- Use `Task.WhenAll()` for parallel execution of multiple tasks\n- Use `Task.WhenAny()` for implementing timeouts or taking the first completed task\n- Avoid unnecessary async/await when simply passing through task results\n- Consider cancellation tokens for long-running operations\n\n## Common Pitfalls\n\n- Never use `.Wait()`, `.Result`, or `.GetAwaiter().GetResult()` in async code\n- Avoid mixing blocking and async code\n- Don't create async void methods (except for event handlers)\n- Always await Task-returning methods\n\n## Implementation Patterns\n\n- Implement the async command pattern for long-running operations\n- Use async streams (IAsyncEnumerable\u003cT\u003e) for processing sequences asynchronously\n- Consider the task-based asynchronous pattern (TAP) for public APIs\n\nWhen reviewing my C# code, identify these issues and suggest improvements that follow these best practices.\n"},"import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/tree/541b7819d8c3545c6df122491af4fa1eae415779/plugins/csharp-dotnet-development/skills/csharp-async"}},"content_hash":[180,101,136,139,181,43,232,91,39,189,58,182,145,49,45,30,122,97,151,53,247,12,211,248,211,63,52,123,15,112,64,128],"trust_level":"unsigned","yanked":false}
