Skip to content
Agentmart
Submit a tool

cpp-development

Use when writing, reviewing, or refactoring C++ code — covers workflow, essential patterns, and pre-commit checklist for modern C++17/20.

Skill by viniciuscs84

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/viniciuscs84-cpp-development

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when writing, reviewing, or refactoring C++ code — covers workflow, essential patterns, and pre-commit checklist for modern C++17/20.

Use cases: writing, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/cpp-development

What's inside

Skill name
cpp-development
Description
Use when writing, reviewing, or refactoring C++ code — covers workflow, essential patterns, and pre-commit checklist for modern C++17/20.
License
MIT
Instructions
155 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# C++ Development

## Workflow

1. **Analyze** — Review build system, compiler flags (`-Wall -Wextra -Wpedantic`), and C++ standard version
2. **Design with concepts** — Define type-safe interfaces using C++20 concepts before implementation
3. **Implement zero-cost** — Apply RAII, `constexpr`, smart pointers, and zero-overhead abstractions
4. **Verify** — Run AddressSanitizer (`-fsanitize=address`) and UBSan (`-fsanitize=undefined`); run static analysis
5. **Optimize** — Profile first (`perf`, `valgrind --tool=callgrind`); measure before and after any change

## Essential Patterns

### Rule of Zero
Let the compiler generate all special members. Compose from types that already manage their own resources.

```cpp
// GOOD: Rule of Zero — compiler generates correct copy/move/destructor
struct Employee {
    std::string name;
    std::string department;
    int id{0};
    // No destructor, no copy/move needed
};
```

### Rule of Five
If you manage a raw resource directly, define (or `=delete`) all five special members.

```cpp
// Rule of Five: owning a raw resource via unique_ptr handles it cleanly
class Buffer {
public:
    explicit Buffer(std::size_t n)
        : data_{std::make_unique<char[]>(n)}, size_{n} {}

    ~Buffer() = default;
    Buffer(Buffer&&) noexcept = default;
    Buffer& operator=(Buffer&&) noexcept = default;

    Buffer(const Buffer& o)
        : data_{std::make_unique<char[]>(o.size_)}, size_{o.size_} {
        std::copy_n(o.data_.get(), size_, data_.get());
    }
    Buffer& operator=(const Buffer& o) {
        if (this != &o) {
            auto nd = std::make_unique<char[]>(o.size_);
            std::copy_n(o.data_.get(), o.size_, nd.get());
            data_ = std::move(nd);
            size_ = o.size_;
        }
        return *this;
    }

private:
    std::unique_ptr<char[]> data_;
    std::size_t size_;
};
```

### Parameter Passing

```cpp
void print(int x);                      // cheap (≤ pointer size): by value
void analyze(const std::string& data);  // expensive, read-only: const&
void consume(std::string s);            // sink (will move/store): by value
```

### Smart Pointers

```cpp
auto widget = std::make_unique<Widget>("cfg");  // default: unique ownership
auto cache  = std::make_shared<Cache>(1024);    // shared ownership only when needed
void render(const Widget* w);                   // raw ptr = non-owning observer only
```

### RAII + const Correctness (combined example)

```cpp
class Sensor {
public:
    explicit Sensor(std::string id) : id_{std::move(id)} {}

    const std::string& id() const { return id_; }   // const member fn
    double reading()        const { return val_; }

    void record(double v) { val_ = v; }              // non-const only when needed

private:
    const std::string id_;   // never changes after construction
    double val_{0.0};
};

// RAII mutex lock — always named, never plain lock()/unlock()
void update(Sensor& s, double v) {
    std::lock_guard<std::mutex> lock{mtx_};  // released at scope exit
    s.record(v);
}
```

### Concepts for Template Constraints (C++20)

```cpp
#include <concepts>

template<std::integral T>
T gcd(T a, T b) {
    while (b) a = std::exchange(b, a % b);
    return a;
}

// Custom concept
template<typename T>
concept Serializable = requires(const T& t) {
    { t.serialize() } -> std::convertible_to<std::string>;
};

template<Serializable T>
void save(const T& obj, std::string_view path);
```

From viniciuscs84/sdd-toolkit, MIT.

More from viniciuscs84/sdd-toolkit

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
May 30, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from viniciuscs84

Cite this page

cpp-development skill. Agent Mart. https://agentmart.dev/skills/viniciuscs84-cpp-development (last updated 2026-10-24)