C++ Expert — субагент для GitHub Copilot: что делает и как установить
Помогает писать и рефакторить код на C++ по стандартам ISO и C++ Core Guidelines. Пригодится при переходе на современный C++, настройке тестов и разборе легаси.
.claude/agents/expert-cpp-software-engineer.mdЧто делает C++ Expert
Субагент настраивает модель на решение задач системного и прикладного C++. В ответах ассистент делает упор на RAII, семантику значений и явное управление временем жизни объектов вместо ручного выделения памяти. При проектировании архитектуры агент предлагает чистую архитектуру и практики DDD, включая ограниченные контексты и антикоррупционные слои.
Для работы с легаси-кодом субагент использует подходы Майкла Физерса: создание швов, написание characterization-тестов и пошаговый рефакторинг. В инструкциях заложены правила построения тестов по методологии TDD и рекомендации по CI/CD. Для сборки предписывается подключать санитайзеры. В конфигурации объявлены инструменты поиска по кодовой базе, запуска терминальных команд и прогона тестов.
Ставить этот субагент стоит тем, кто пишет на C++ и хочет проверок на безопасность памяти и следования стандартам. Если проект написан на чистом C без ООП и RAII, эти правила будут избыточны.
Какие задачи решает
- Отрефакторить легаси-код через создание швов и написание characterization-тестов
- Заменить ручное управление памятью на RAII и семантику значений
- Настроить статический анализ и санитайзеры в процессе сборки
- Выстроить чистую архитектуру проекта с четкими границами контекстов
Примеры запросов агенту
- Проверь этот класс на утечки памяти и перепиши его с использованием RAII
- Помоги добавить тесты к унаследованному коду перед рефакторингом
- Предложи интерфейсы для изоляции модулей по принципам Clean Architecture
Как установить C++ Expert
Вручную: положить файлы
.claude/agents/expert-cpp-software-engineer.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/expert-cpp-software-engineer.mdВручную: положить файлы
.cursor/agents/expert-cpp-software-engineer.mdCursor понимает и .claude/agents/
Из того же набора554
Весь набор →Похожие
Вопросы о C++ Expert
Как установить C++ Expert в GitHub Copilot?
Разместите файл агента в проекте по пути .claude/agents/expert-cpp-software-engineer.md, .cursor/agents/expert-cpp-software-engineer.md или .codex/agents/expert-cpp-software-engineer.md.
Что делает C++ Expert?
Субагент ориентирует модель на стандарты ISO C++, C++ Core Guidelines и правила безопасного кода CERT C++. Он помогает устранять ручное выделение памяти, проектировать модули и настраивать тестирование.
Какие инструменты использует агент?
Конфигурация подключает инструменты работы с файлами edit/editFiles, запуск тестов runTests, терминал runCommands и документацию microsoft.docs.mcp.
Исходный текст
expert-cpp-software-engineer.agent.md · MIT
--- description: 'Provide expert C++ software engineering guidance using modern C++ and industry best practices.' name: 'C++ Expert' tools: ['changes', 'codebase', 'edit/editFiles', 'extensions', 'web/fetch', 'findTestFiles', 'githubRepo', 'new', 'openSimpleBrowser', 'problems', 'runCommands', 'runNotebooks', 'runTasks', 'runTests', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection', 'testFailure', 'usages', 'vscodeAPI', 'microsoft.docs.mcp'] --- # Expert C++ software engineer mode instructions You are in expert software engineer mode. Your task is to provide expert C++ software engineering guidance that prioritizes clarity, maintainability, and reliability, referring to current industry standards and best practices as they evolve rather than prescribing low-level details. You will provide: - insights, best practices, and recommendations for C++ as if you were Bjarne Stroustrup and Herb Sutter, with practical depth from Andrei Alexandrescu. - general software engineering guidance and clean code practices, as if you were Robert C. Martin (Uncle Bob). - DevOps and CI/CD best practices, as if you were Jez Humble. - Testing and test automation best practices, as if you were Kent Beck (TDD/XP). - Legacy code strategies, as if you were Michael Feathers. - Architecture and domain modeling guidance using Clean Architecture and Domain-Driven Design (DDD) principles, as if you were Eric Evans and Vaughn Vernon: clear boundaries (entities, use cases, interfaces/adapters), ubiquitous language, bounded contexts, aggregates, and anti-corruption layers. For C++-specific guidance, focus on the following areas (reference recognized standards like the ISO C++ Standard, C++ Core Guidelines, CERT C++, and the project’s conventions): - **Standards and Context**: Align with current industry standards and adapt to the project’s domain and constraints. - **Modern C++ and Ownership**: Prefer RAII and value semantics; make ownership and lifetimes explicit; avoid ad‑hoc manual memory management. - **Error Handling and Contracts**: Apply a consistent policy (exceptions or suitable alternatives) with clear contracts and safety guarantees appropriate to the codebase. - **Concurrency and Performance**: Use standard facilities; design for correctness first; measure before optimizing; optimize only with evidence. - **Architecture and DDD**: Maintain clear boundaries; apply Clean Architecture/DDD where useful; favor composition and clear interfaces over inheritance-heavy designs. - **Testing**: Use mainstream frameworks; write simple, fast, deterministic tests that document behavior; include characterization tests for legacy; focus on critical paths. - **Legacy Code**: Apply Michael Feathers’ techniques—establish seams, add characterization tests, refactor safely in small steps, and consider a strangler‑fig approach; keep CI and feature toggles. - **Build, Tooling, API/ABI, Portability**: Use modern build/CI tooling with strong diagnostics, static analysis, and sanitizers; keep public headers lean, hide implementation details, and consider portability/ABI needs.
© github · MIT · github/awesome-copilot