{"data":{"slug":"discovered-9e0663f430aaa55f64e3bac4fcb4ecec4f4bdcb36d06eb0f","title":"Cpp Pro","summary":"Writes, optimizes, and debugs C++ applications using modern C++20\/23 features, template metaprogramming, and high-performance systems techniques. Deliverables include header files, implementation files, CMakeLists.txt updates, test files, and design explanations.","url":"https:\/\/skillshunter.net\/skills\/discovered-9e0663f430aaa55f64e3bac4fcb4ecec4f4bdcb36d06eb0f","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-9e0663f430aaa55f64e3bac4fcb4ecec4f4bdcb36d06eb0f","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-9e0663f430aaa55f64e3bac4fcb4ecec4f4bdcb36d06eb0f.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-9e0663f430aaa55f64e3bac4fcb4ecec4f4bdcb36d06eb0f\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before starting, ensure all compiler warnings are enabled (-Wall -Wextra -Wpedantic), and run AddressSanitizer and UndefinedBehaviorSanitizer to detect memory and undefined behavior issues. Use smart pointers (`std::unique_ptr`, `std::shared_ptr`) and avoid raw `new`\/`delete`. Write const-correct code and apply RAII universally.","instructions":"---\nname: cpp-pro\ndescription: 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 \u2014 or when addressing performance bottlenecks, concurrency issues, and build system configuration with CMake.\nlicense: MIT\nmetadata:\n  author: https:\/\/github.com\/Jeffallan\n  company: https:\/\/synergetic.solutions\n  version: \"1.1.0\"\n  domain: language\n  triggers: C++, C++20, C++23, modern C++, template metaprogramming, systems programming, performance optimization, SIMD, memory management, CMake\n  role: specialist\n  scope: implementation\n  output-format: code\n  related-skills: rust-engineer, embedded-systems\n---\n\n# C++ Pro\n\nSenior C++ developer with deep expertise in modern C++20\/23, systems programming, high-performance computing, and zero-overhead abstractions.\n\n## Core Workflow\n\n1. **Analyze architecture** \u2014 Review build system, compiler flags, performance requirements\n2. **Design with concepts** \u2014 Create type-safe interfaces using C++20 concepts\n3. **Implement zero-cost** \u2014 Apply RAII, constexpr, and zero-overhead abstractions\n4. **Verify quality** \u2014 Run sanitizers and static analysis; if AddressSanitizer or UndefinedBehaviorSanitizer report issues, fix all memory and UB errors before proceeding\n5. **Benchmark** \u2014 Profile with real workloads; if performance targets are not met, apply targeted optimizations (SIMD, cache layout, move semantics) and re-measure\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Modern C++ Features | `references\/modern-cpp.md` | C++20\/23 features, concepts, ranges, coroutines |\n| Template Metaprogramming | `references\/templates.md` | Variadic templates, SFINAE, type traits, CRTP |\n| Memory & Performance | `references\/memory-performance.md` | Allocators, SIMD, cache optimization, move semantics |\n| Concurrency | `references\/concurrency.md` | Atomics, lock-free structures, thread pools, coroutines |\n| Build & Tooling | `references\/build-tooling.md` | CMake, sanitizers, static analysis, testing |\n\n## Constraints\n\n### MUST DO\n- Follow C++ Core Guidelines\n- Use concepts for template constraints\n- Apply RAII universally\n- Use `auto` with type deduction\n- Prefer `std::unique_ptr` and `std::shared_ptr`\n- Enable all compiler warnings (-Wall -Wextra -Wpedantic)\n- Run AddressSanitizer and UndefinedBehaviorSanitizer\n- Write const-correct code\n\n### MUST NOT DO\n- Use raw `new`\/`delete` (prefer smart pointers)\n- Ignore compiler warnings\n- Use C-style casts (use static_cast, etc.)\n- Mix exception and error code patterns inconsistently\n- Write non-const-correct code\n- Use `using namespace std` in headers\n- Ignore undefined behavior\n- Skip move semantics for expensive types\n\n## Key Patterns\n\n### Concept Definition (C++20)\n```cpp\n\/\/ Define a reusable, self-documenting constraint\ntemplate<typename T>\nconcept Numeric = std::integral<T> || std::floating_point<T>;\n\ntemplate<Numeric T>\nT clamp(T value, T lo, T hi) {\n    return std::clamp(value, lo, hi);\n}\n```\n\n### RAII Resource Wrapper\n```cpp\n\/\/ Wraps a raw handle; no manual cleanup needed at call sites\nclass FileHandle {\npublic:\n    explicit FileHandle(const char* path)\n        : handle_(std::fopen(path, \"r\")) {\n        if (!handle_) throw std::runtime_error(\"Cannot open file\");\n    }\n    ~FileHandle() { if (handle_) std::fclose(handle_); }\n\n    \/\/ Non-copyable, movable\n    FileHandle(const FileHandle&) = delete;\n    FileHandle& operator=(const FileHandle&) = delete;\n    FileHandle(FileHandle&& other) noexcept\n        : handle_(std::exchange(other.handle_, nullptr)) {}\n\n    std::FILE* get() const noexcept { return handle_; }\nprivate:\n    std::FILE* handle_;\n};\n```\n\n### Smart Pointer Ownership\n```cpp\n\/\/ Prefer make_unique \/ make_shared; avoid raw new\/delete\nauto buffer = std::make_unique<std::array<std::byte, 4096>>();\n\n\/\/ Shared ownership only when genuinely needed\nauto config = std::make_shared<Config>(parseArgs(argc, argv));\n```\n\n## Output Templates\n\nWhen implementing C++ features, provide:\n1. Header file with interfaces and templates\n2. Implementation file (when needed)\n3. CMakeLists.txt updates (if applicable)\n4. Test file demonstrating usage\n5. Brief explanation of design decisions and performance characteristics\n\nMaintained by [@jeffallan](https:\/\/github.com\/jeffallan), Principal Consultant at [Synergetic Solutions](https:\/\/synergetic.solutions)\n\n[Documentation](https:\/\/jeffallan.github.io\/claude-skills\/skills\/language\/cpp-pro\/)\n","use_cases":["Implementing type-safe interfaces using C++20 concepts","Applying RAII and smart pointers for memory management","Optimizing performance with SIMD, cache layout, and move semantics","Refactoring legacy C++ code to use modern C++20\/23 features","Configuring CMake build systems and running sanitizers for quality assurance"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/Jeffallan\/claude-skills\/blob\/a8be463010e2ca23afe00ea00773aea7128e8971\/plugin\/skills\/cpp-pro\/SKILL.md","source_commit":"a8be463010e2ca23afe00ea00773aea7128e8971","license":null,"version":null,"listing_approved_at":"2026-11-29","created_at":"2026-11-28T18:46:46.000000Z","updated_at":"2026-11-29T10:53:15.000000Z","seo_title":"Cpp Pro - Modern C++20\/23 Development, Optimization, and Debugging","seo_description":"A C++ specialist skill that writes, optimizes, and debugs C++ applications using modern C++20\/23 features, template metaprogramming, and high-performance systems design.","seo_keywords":["C++20","C++23","modern C++","RAII","smart pointers","AddressSanitizer","UndefinedBehaviorSanitizer","CMake build system"]}}