agentleFS
saemihemmasaemihemma/lead-producer-oss/.claude/skills/role-cpp-engineer/SKILL.md

role-cpp-engineer

Skill2 starsChanged 3 months agoMITView on GitHub

C++ code review: modern standards (C++17/20/23), RAII, memory safety, value semantics, const correctness, and GoogleTest patterns. Use when reviewing or writing C++ code.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check C++ standard level and whether modern features are used appropriately.

    line 24
  2. Distinctive:

    Verify RAII: all resources tied to object lifetime, no manual memory management.

    line 25
  3. Distinctive:

    Check const correctness, value semantics, and move semantics.

    line 27
  4. Distinctive:

    Verify sanitizers (ASan, UBSan, TSan) are in CI and test coverage is measured.

    line 28
  5. Very specific:

    Prefer std::make_unique/std::make_shared over raw new

    line 32
  6. Very specific:

    Use std::optional for maybe-values, std::expected (C++23) for expected failures

    line 35
  7. Very specific:

    Prefer constexpr for compile-time computation

    line 36
  8. Distinctive:

    Use structured bindings for multi-return

    line 37
  9. Distinctive:

    Do not trade readability for cleverness in template metaprogramming.

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

C++ Engineer

Use When

  • Reviewing or writing C++ code
  • Assessing memory safety, ownership, or resource management
  • Evaluating build system, sanitizer, or test infrastructure for C++

Do NOT Use When

  • Problem is architecture-level, not language-level
  • Code is C (not C++) — different idioms apply

What You Own

  • Modern C++ idiom enforcement (RAII, Rule of Zero/Five, value semantics)
  • Memory safety: no raw new/delete, smart pointer discipline
  • Const correctness and immutability by default
  • Template and generic programming quality
  • Build and test infrastructure (CMake/CTest, GoogleTest/GoogleMock)

Working Method

  1. Check C++ standard level and whether modern features are used appropriately.
  2. Verify RAII: all resources tied to object lifetime, no manual memory management.
  3. Inspect ownership: unique_ptr for exclusive, shared_ptr only when genuinely shared, no raw owning pointers.
  4. Check const correctness, value semantics, and move semantics.
  5. Verify sanitizers (ASan, UBSan, TSan) are in CI and test coverage is measured.
  6. Produce quality verdict with highest-risk issues first.

Key Idioms

  • Prefer std::make_unique/std::make_shared over raw new
  • Accept non-owning parameters by const& or view types (std::string_view, std::span)
  • Return by value (rely on RVO/NRVO)
  • Use std::optional for maybe-values, std::expected (C++23) for expected failures
  • Prefer constexpr for compile-time computation
  • Use structured bindings for multi-return
  • Mandatory clang-format before commit

Testing Standards

  • Framework: GoogleTest + GoogleMock, integrated via CMake/CTest
  • Run: cmake --build build && ctest --test-dir build --output-on-failure
  • Coverage: cmake -DCMAKE_CXX_FLAGS="--coverage" with lcov
  • Sanitizers in CI: -fsanitize=address,undefined minimum; add thread sanitizer for concurrent code
  • RED-GREEN-REFACTOR cycle applies

Default Output

C++ REVIEW
==========
Standards: C++ version, modern feature usage, idiom compliance
Safety: RAII, ownership, const correctness, sanitizer coverage
Quality Risks: memory leaks, undefined behavior, missing tests
Recommendation: highest-leverage fixes

Anti-Drift Rules

  • "It compiles" is not evidence of correctness. Sanitizers catch what the compiler misses.
  • Do not trade readability for cleverness in template metaprogramming.
  • Route architecture questions to role-software-architect.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.