agentleFS
realsenseairealsenseai/librealsense/.claude/skills/cpp-coding/SKILL.md

cpp-coding

Skill9.1k starsChanged 27 days agoApache-2.0View on GitHub

C++ coding standards for librealsense - language standard, naming, RAII, error handling, comments. Use before adding or modifying any C++ code.

3 other projects use a version of this.

Trending

Steady talk.about the whole repository

Dec 2025: 1 mentionJan 2026: 3 mentionsFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 3 mentionsJul 2026: 5 mentionsAug 2026: 6 mentionsSep 2026: 6 mentionsOct 2026: 6 mentionsNov 2026: 2 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the realsenseai/librealsense repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about realsenseai/librealsense

The biggest 5 of 34 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 34

Talked about on GitHub (34 times).

On GitHub · 34

29 more on GitHub
  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. timeplus-io/proton★ 2.3ksame name
    2. Ultimaker/CuraEngine★ 1.9ksame name
    3. figuretu/my-skills★ 16same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository9 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    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:

    Use this protocol to ensure all C++ code modifications align with the project's engineering standards.

    line 8
  2. Very specific:

    Safety: Prefer strict Types over auto (unless type is obvious or iterator).

    line 14
  3. Distinctive:

    No Macros: Avoid C-style macros unless absolutely necessary.

    line 15
  4. Very specific:

    Pointers: Use std::unique_ptr by default.

    line 27
  5. Very specific:

    Allocation: Avoid raw new/delete. Use std::make_unique / std::make_shared.

    line 28
  6. Distinctive:

    Value Semantics: Prefer stack allocation and value semantics where possible.

    line 29
  7. Distinctive:

    Silence: Never fail silently. Log errors or throw exceptions.

    line 33
  8. Distinctive:

    Style: Do NOT reformat existing code solely for style.

    line 36
  9. Distinctive:

    Hot Paths: Check for hidden allocations in loops or streaming callbacks.

    line 40
  10. Distinctive:

    Comments should be sparse: Keep to 1–2 lines unless the code is large and genuinely complex.

    line 44
  11. Distinctive:

    Intention: Don't restate what the code already says, comment should convey the reason for the code.

    line 45
  12. Distinctive:

    Generality: Don't reference internal session reasoning e.g.

    line 48

≈ “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++ Coding Standards & Practices Skill

Use this protocol to ensure all C++ code modifications align with the project's engineering standards.

Protocol

1. Enforce Language Standard

  • Standard: The core library must compile with C++14 compatibility (cxx_std_14 — see CMake/lrs_macros.cmake). The public interface requires C++11 (cxx_std_11). Examples and wrappers generally use C++11
  • Safety: Prefer strict Types over auto (unless type is obvious or iterator).
  • No Macros: Avoid C-style macros unless absolutely necessary.

2. Applied Naming Conventions

  • General: snake_case for variables, functions, classes and namespaces (e.g. uvc_device, get_device_count()).
  • Files: kebab-case (e.g. backend-v4l2.h, device-model.cpp).
  • Constants: UPPER_CASE_WITH_UNDERSCORES.
  • Members: Prefix with _ (e.g., _my_variable).
  • Templates: PascalCase for type parameters (e.g., template<typename T>).
  • Namespaces: librealsense (core), librealsense::platform (platform layer); public C API types and enums use the rs2_ prefix.
  • Suffixes: *_interface (abstract bases, e.g. device_interface), *_factory, *_callback, *_model (viewer UI classes).

3. Resource Management (RAII)

  • Pointers: Use std::unique_ptr by default. Use std::shared_ptr only when ownership is truly shared.
  • Allocation: Avoid raw new/delete. Use std::make_unique / std::make_shared.
  • Value Semantics: Prefer stack allocation and value semantics where possible.

4. Error Handling

  • Exceptions: Inside src/, throw the library exception types from src/librealsense-exception.h (e.g. invalid_value_exception, wrong_api_call_sequence_exception, not_implemented_exception); the C API wrappers translate them into rs2_error. rs2::error is the public C++ wrapper's type, used only in include/librealsense2/hpp/ and client code.
  • Silence: Never fail silently. Log errors or throw exceptions.

5. Modification Rules

  • Style: Do NOT reformat existing code solely for style. Only apply these rules to new or refactored lines.
  • Consistency: Match the surrounding code style if it deviates from the standard (local consistency wins for minor edits).

6. Performance Checks

  • Hot Paths: Check for hidden allocations in loops or streaming callbacks.
  • Copying: Minimize data copying; use const references (const T&) for non-primitive arguments.

7. Comments

  • Comments should be sparse. Keep to 1–2 lines unless the code is large and genuinely complex.
  • Intention: Don't restate what the code already says, comment should convey the reason for the code.
  • Locality: The comment should refer to the local code. e.g. class description should not mention inheritors or where other logic live.
  • Length: Comment lines can be as long as the surrounding code. If code lines usually trim at 120 characters comment lines don't have to be 80 characters long.
  • Generality: Don't reference internal session reasoning e.g. "as you instructed"

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.