Skip to content
Back to skills

Exec Cpp

ASecurity

C++ execution idioms to embed into Codex prompts when the target project is C/C++ — RAII, memory safety, modern C++ idioms, and const-correctness.

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 20, 2026
ai-agentsgoc++

Security analysis

A100/100

Scanned November 20, 2026

npx -y skills add anhnguyen0905/codex-mcp --skill exec-cpp --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Exec Cpp?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Exec Cpp
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anhnguyen0905-exec-cpp/badge)](https://www.skillsdirectory.com/skills/anhnguyen0905-exec-cpp)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: exec-cpp
description: C++ execution idioms to embed into Codex prompts when the target project is C/C++ — RAII, memory safety, modern C++ idioms, and const-correctness.
---

# C++ Idioms (embed when project is C/C++)

```
C++ standards:
- RAII for every resource: memory, files, locks, sockets — no raw new/delete or manual free in
  application code; use smart pointers (unique_ptr by default, shared_ptr only for shared ownership,
  weak_ptr to break cycles) and standard containers. No owning raw pointers.
- Memory safety: no dangling references/iterators, no buffer overruns; prefer std::span/std::string_view
  for non-owning views (mind their lifetime); bounds-checked access where input-driven.
- const-correctness: mark methods/params/locals const wherever possible; pass by const& for non-trivial
  types, by value for cheap ones; use constexpr where evaluable at compile time.
- Errors: exceptions with specific types OR the project's error convention (std::expected / error
  codes) — follow whichever the codebase uses consistently; never ignore a returned error code.
- Prefer standard algorithms (<algorithm>, ranges) over hand-written loops; use auto to avoid
  redundant type spelling; enum class over plain enum; nullptr not NULL; braces for init.
- Follow the C++ standard version the build targets; match the repo's .clang-format and layout;
  respect the build system (CMake/Bazel) — declare deps and targets the project's way.
- Rule of zero: let RAII members manage lifetime; only declare special members when you must, then
  declare all five. Mark overrides override, single-arg ctors explicit.
- Tests: the repo's framework (GoogleTest/Catch2/doctest); arrange-act-assert; test behavior; match
  existing test target structure.
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.