agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when writing modern C++ (17/20/23). Covers RAII, smart-pointer ownership, move semantics, ranges, concepts, and eliminating undefined behavior with sanitizers.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill cpp --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/cppContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing modern C++ (17/20/23). Covers RAII, smart-pointer ownership, move semantics, ranges, concepts, and eliminating undefined behavior with sanitizers.
name: cpp description: Use when writing modern C++ (17/20/23). Covers RAII, smart-pointer ownership, move semantics, ranges, concepts, and eliminating undefined behavior with sanitizers. metadata: category: languages version: 1.0.0 tags: [cpp, raii, move-semantics, concepts, sanitizers]
Write C++ where resources are owned by objects, ownership is visible in the type, and undefined behavior is actively hunted with tooling rather than hoped away.
1. **Establish ownership** — Every resource has exactly one owner. Express it in the type: value, `unique_ptr`, or a documented non-owning `T*`/`span`. 2. **Apply the rule of zero** — If a class needs a destructor, it probably should not also hold business logic. 3. **Constrain templates** — Use concepts; unconstrained templates produce unreadable errors and accept nonsense. 4. **Sanitize** — Build and run the test suite under ASan+UBSan, then TSan separately. 5. **Measure before optimizing** — Profile, change one thing, benchmark again.
**RAII wrapper with clear ownership:**
class FileHandle {
public:
explicit FileHandle(const std::filesystem::path& path)
: file_(std::fopen(path.c_str(), "rb")) {
if (!file_) {
throw std::system_error(errno, std::generic_category(), path.string());
}
}
FileHandle(FileHandle&&) noexcept = default;
FileHandle& operator=(FileHandle&&) noexcept = default;
FileHandle(const FileHandle&) = delete;
FileHandle& operator=(const FileHandle&) = delete;
~FileHandle() { if (file_) std::fclose(file_); }
[[nodiscard]] std::FILE* get() const noexcept { return file_; }
private:
std::FILE* file_;
};**Constrained template with concepts:**
template <std::ranges::input_range R>
requires std::totally_ordered<std::ranges::range_value_t<R>>
auto median(R&& range) {
std::vector values(std::ranges::begin(range), std::ranges::end(range));
if (values.empty()) throw std::invalid_argument("median of empty range");
auto mid = values.begin() + std::ssize(values) / 2;
std::ranges::nth_element(values, mid);
return *mid;
}A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…