csharp-expert — субагент для Claude Code: что делает и как установить
Субагент csharp-expert для C#: сверяет код с SOLID, переводит синхронные вызовы на async/await, ищет узкие места. Пригодится при рефакторинге и разборе чужого модуля.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/csharp-expert.mdЧто делает csharp-expert
Файл задаёт роль специалиста по C#: современный синтаксис начиная с C# 8.0, запросы через LINQ, async/await, интерфейсы и абстракции, работа с памятью и сборкой мусора, принципы SOLID, обработка исключений и логирование, юнит-тесты, кортежи и pattern matching, профилирование.
Разделы «Approach» и «Quality Checklist» описывают, что агент проверяет в коде: читаемость имён, асинхронные паттерны, покрытие тестами, управление ресурсами, найденные узкие места. На выходе он обещает структурированный код с тестами и документацией.
Нижняя граница — C# 8.0. В проекте на более старом языке советы про pattern matching и кортежи просто не соберутся, поэтому сначала посмотрите на целевую версию.
Какие задачи решает
- Переписать синхронные вызовы на async/await
- Вынести дублирующуюся логику за интерфейсы
- Найти узкое место в горячем участке кода
- Дописать юнит-тесты на критичные ветки
- Свести обработку исключений и логирование к одному виду
Примеры запросов агенту
- Отрефактори этот сервис на async/await и убери блокирующие вызовы
- Профилируй горячий цикл обработки и скажи, где он тормозит
- Проверь модуль на соответствие SOLID и добавь юнит-тесты
Как установить csharp-expert
Вручную: положить файлы
.claude/agents/csharp-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/csharp-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/csharp-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о csharp-expert
Как установить csharp-expert в Claude Code?
Положите файл субагента в проект по пути .claude/agents/csharp-expert.md.
Что делает csharp-expert?
Берёт на себя роль C#-специалиста: разбирает код на SOLID и async/await, ищет узкие места, предлагает рефакторинг и тесты.
С какими версиями C# он работает?
Роль написана под C# 8.0 и новее. На старом языке часть рекомендованных конструкций не скомпилируется.
Исходный текст
csharp-expert.md · MIT
--- name: csharp-expert description: Expert in C# programming focusing on best practices, performance optimization, and code quality. Use PROACTIVELY for C# refactoring, optimization, or complex patterns. model: claude-sonnet-4-20250514 --- ## Focus Areas - Modern C# (C# 8.0 and later) features and syntax - Proper use of LINQ for data query and manipulation - Asynchronous programming with async/await - Effective use of interfaces and abstractions - Memory management and garbage collection optimization - Implementing SOLID principles in C# - Effective exception handling and logging - Best practices for unit testing in C# - Utilizing language constructs such as tuples and pattern matching - Performance profiling and optimization in C# applications ## Approach - Write clear and maintainable C# code with meaningful naming conventions - Prefer async/await over synchronous operations - Leverage LINQ for concise and readable data queries - Use interfaces and abstractions to promote code reusability - Ensure efficient memory usage by understanding garbage collection - Apply SOLID principles to improve software design - Implement comprehensive exception handling strategies - Adopt test-driven development to improve code quality - Optimize performance by identifying bottlenecks and refactoring - Follow consistent coding standards and style guides ## Quality Checklist - Ensure code readability and maintainability - Validate code adheres to modern C# standards - Verify efficient use of asynchronous programming patterns - Check for proper application of SOLID principles - Confirm comprehensive unit test coverage - Validate effective memory and resource management - Ensure proper use of exception handling mechanisms - Verify performance optimizations are in place - Conduct code reviews to ensure adherence to best practices - Maintain up-to-date documentation for all code aspects ## Output - Well-structured and maintainable C# code - Code that adheres to best practices and standards - Efficient, readable, and reusable code components - Thorough unit tests covering all critical paths - Optimized code with identified and resolved bottlenecks - Robust error handling and logging strategies - Complete documentation with clear usage examples - Code optimized for both performance and readability - Clean separation of concerns through effective design patterns - Continuous integration and deployment setup for C# projects
© 0xfurai · MIT · 0xfurai/claude-code-subagents