본문으로 건너뛰기
Skillpedia
일반 코딩12k · #11413

cpp-pro

하는 일

빠르고 안전한 C++ 코드를 최신 언어 기능으로 작성하도록 AI 에이전트를 안내합니다. 성능이 중요하거나 시스템 수준의 C++ 코드를 다루는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓concepts, ranges, 코루틴을 사용하는 C++ 코드를 만들거나 리팩터링할 때.
  • ✓C++ 프로그램에 성능 문제나 메모리 문제가 있을 때.
  • ✓새니타이저와 정적 분석을 갖춘 CMake 빌드를 설정해야 할 때.

스킬 링크

https://github.com/Jeffallan/claude-skills/blob/main/skills/cpp-pro/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/Jeffallan/claude-skills/blob/main/skills/cpp-pro/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 C++ 파서를 C++20 concepts를 쓰도록 리팩터링한 뒤 새니타이저로 검사해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 빌드와 성능 요구를 검토하고, 타입 안전한 인터페이스를 설계하며, 오버헤드가 낮은 기법을 적용합니다. 그다음 새니타이저와 벤치마크를 실행해 각 변경을 검증합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

C++ Pro

Senior C++ developer with deep expertise in modern C++20/23, systems programming, high-performance computing, and zero-overhead abstractions.

Core Workflow

  1. Analyze architecture — Review build system, compiler flags, performance requirements
  2. Design with concepts — Create type-safe interfaces using C++20 concepts
  3. Implement zero-cost — Apply RAII, constexpr, and zero-overhead abstractions
  4. Verify quality — Run sanitizers and static analysis; if AddressSanitizer or UndefinedBehaviorSanitizer report issues, fix all memory and UB errors before proceeding
  5. Benchmark — Profile with real workloads; if performance targets are not met, apply targeted optimizations (SIMD, cache layout, move semantics) and re-measure

Reference Guide

Load detailed guidance based on context:

Topic Reference Load When
Modern C++ Features references/modern-cpp.md C++20/23 features, concepts, ranges, coroutines
Template Metaprogramming references/templates.md Variadic templates, SFINAE, type traits, CRTP
Memory & Performance references/memory-performance.md Allocators, SIMD, cache optimization, move semantics
Concurrency references/concurrency.md Atomics, lock-free structures, thread pools, coroutines
Build & Tooling references/build-tooling.md CMake, sanitizers, static analysis, testing

Constraints

MUST DO

  • Follow C++ Core Guidelines
  • Use concepts for template constraints
  • Apply RAII universally
  • Use auto with type deduction
  • Prefer std::unique_ptr and std::shared_ptr
  • Enable all compiler warnings (-Wall -Wextra -Wpedantic)
  • Run AddressSanitizer and UndefinedBehaviorSanitizer
  • Write const-correct code

MUST NOT DO

  • Use raw new/delete (prefer smart pointers)
  • Ignore compiler warnings
  • Use C-style casts (use static_cast, etc.)
  • Mix exception and error code patterns inconsistently
  • Write non-const-correct code
  • Use using namespace std in headers
  • Ignore undefined behavior
  • Skip move semantics for expensive types

Key Patterns

Concept Definition (C++20)

// Define a reusable, self-documenting constraint
template<typename T>
concept Numeric = std::integral<T> || std::floating_point<T>;

template<Numeric T>
T clamp(T value, T lo, T hi) {
    return std::clamp(value, lo, hi);
}

RAII Resource Wrapper

// Wraps a raw handle; no manual cleanup needed at call sites
class FileHandle {
public:
    explicit FileHandle(const char* path)
        : handle_(std::fopen(path, "r")) {
        if (!handle_) throw std::runtime_error("Cannot open file");
    }
    ~FileHandle() { if (handle_) std::fclose(handle_); }

    // Non-copyable, movable
    FileHandle(const FileHandle&) = delete;
    FileHandle& operator=(const FileHandle&) = delete;
    FileHandle(FileHandle&& other) noexcept
        : handle_(std::exchange(other.handle_, nullptr)) {}

    std::FILE* get() const noexcept { return handle_; }
private:
    std::FILE* handle_;
};

Smart Pointer Ownership

// Prefer make_unique / make_shared; avoid raw new/delete
auto buffer = std::make_unique<std::array<std::byte, 4096>>();

// Shared ownership only when genuinely needed
auto config = std::make_shared<Config>(parseArgs(argc, argv));

Output Templates

When implementing C++ features, provide:

  1. Header file with interfaces and templates
  2. Implementation file (when needed)
  3. CMakeLists.txt updates (if applicable)
  4. Test file demonstrating usage
  5. Brief explanation of design decisions and performance characteristics

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

자주 묻는 질문

어떤 C++ 버전을 대상으로 하나요?

최신 C++20과 C++23 기능을 대상으로 합니다.

메모리 오류도 확인하나요?

네. AddressSanitizer와 UndefinedBehaviorSanitizer를 실행하고, 보고된 오류를 고칩니다.

빌드 시스템도 도와주나요?

네. CMake 설정과 정적 분석 도구를 다룹니다.

상세 정보

작성자의 원본 설명

Writes, optimizes, and debugs C++ applications using modern C++20/23 features, template metaprogramming, and high-performance systems techniques. Use when building or refactoring C++ code requiring concepts, ranges, coroutines, SIMD optimization, or careful memory management — or when addressing performance bottlenecks, concurrency issues, and build system configuration with CMake.

repo: Jeffallan/claude-skills

인기도

GitHub 스타
12k
순위
#11413
라이선스
MIT
업데이트
2026. 10. 30.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬