Command Palette

Search for a command to run...

Back to skills
skill № 77019

C++

Write safe C++ avoiding memory leaks, dangling pointers, undefined behavior, and ownership confusion.

FreeNo executable scripts
clawicby clawic★ 23 GitHub stars

Install C++ in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Quick Reference

Topic File
RAII, smart pointers, new/delete memory.md
Raw pointers, references, nullptr pointers.md
Rule of 3/5/0, inheritance, virtual classes.md
Containers, iterators, algorithms stl.md
Templates, SFINAE, concepts templates.md
Threads, mutex, atomics concurrency.md
C++11/14/17/20, move semantics modern.md
Undefined behavior traps ub.md

Critical Rules

  • Raw new without delete leaks — use std::unique_ptr or std::make_unique
  • Returning reference to local — undefined behavior, object destroyed on return
  • == for C-strings compares pointers — use std::string or strcmp()
  • Signed integer overflow is UB — not wrap-around like unsigned
  • Virtual destructor required in base class — otherwise derived destructor skipped
  • std::move doesn't move — it casts to rvalue, enabling move semantics
  • Moved-from object valid but unspecified — don't use without reassigning
  • Data race on non-atomic is UB — use std::mutex or std::atomic
  • vector<bool> is not a real container — returns proxy, use deque<bool>
  • map[key] inserts default if missing — use find() or contains() to check
  • Braced init {} prevents narrowing — int x{3.5} errors, int x(3.5) truncates
  • Iterator invalidation on push_back — vector may relocate, invalidating iterators
  • string_view doesn't own data — underlying string must outlive the view

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • _meta.json
  • classes.md
  • concurrency.md
  • memory.md
  • modern.md
  • pointers.md
  • stl.md
  • templates.md
  • ub.md

FAQ

What does the C++ skill do?

Write safe C++ avoiding memory leaks, dangling pointers, undefined behavior, and ownership confusion.

How do I install the C++ skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the C++ skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare C++ with