All skills
davila7 avatar

/cpp-pro

@e72ce06

Write idiomatic C++ code with modern features, RAII, smart pointers, and STL algorithms. Handles templates, move semantics, and performance optimization.

Use this Skill: https://skilld.dev/gh/davila7/claude-code-templates/cpp-pro

This session only. Nothing lands on disk.

resourcesimplementation-playbook.md

≈314 tokens on demand. Your agent reads this file only when SKILL.md points to it.

C++ Implementation Playbook

Date: March 23, 2026
Author: champbreed

1. RAII & Resource Management

Always wrap raw resources in manager objects to ensure cleanup on scope exit.

// Good: Scope-bound cleanup
void process() {
    auto data = std::make_unique<uint8_t[]>(1024);
    // memory is freed automatically
}

2. Smart Pointer Ownership

  • unique_ptr: Use for exclusive ownership.
  • shared_ptr: Use for shared ownership across components.
  • weak_ptr: Use to break circular reference cycles.

3. Concurrency Safety

Always use RAII-style locks like std::lock_guard or std::unique_lock.

void update() {
    std::lock_guard<std::mutex> lock(mutex_); // Released automatically
    // thread-safe logic
}

4. Move Semantics & Efficiency

Avoid expensive copies by utilizing move constructors and std::move.

void processData(std::vector<std::string>&& data) {
    auto internalData = std::move(data); // Transfers ownership, no copy
}

5. Modern STL Algorithms

Prefer algorithms over manual loops for readability and optimization.

void sortData(std::vector<int>& myVector) {
    // Use std::ranges (C++20) for cleaner, safer iteration
    std::ranges::sort(myVector);
}

Source: SKILL.md on GitHub

No alerts1d3 checks · Risk SAFE
  • Gen Agent Trust Hub1d

    The skill provides comprehensive instructions and references for modern C++ development, covering best practices, memory management, and build tooling. No malicious patterns or security risks were detected.

  • Socket1d

    No alerts

  • Snyk1d

    Risk: LOW · No issues

Signed by skilld at e72ce06. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 14 hours ago.

Activeupdated 6 months ago
risk
unknown
source
community
date_added
2026-02-27

README badge

README badge for davila7/claude-code-templates/cpp-pro