agentleFS
IntelRealSenseIntelRealSense/librealsense/.claude/skills/add-api/SKILL.md

add-api

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

Add new public API to the librealsense SDK (C/C++ headers, Windows exports, Python bindings, examples) without breaking existing API. Use before adding any function, struct, enum, option or metadata field to include/librealsense2.

2 other projects use a version of this.

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 2 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the IntelRealSense/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 IntelRealSense/librealsense

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

See all 81

Talked about on GitHub, Stack Overflow and Hacker News (81 times).

On GitHub · 48

43 more on GitHub

On Stack Overflow · 30

25 more on Stack Overflow
  • Other versions2 projects use a version of this.

    Word for word · 1

    1. realsenseai/librealsense★ 9.1k100% same

    Edited · 0

    None found.

    Wrote their own version · 1

    1. glowingkitty/OpenMates★ 53same 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

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add, don't change: Never remove or change the signature, struct layout or enum values of existing public API without explicit user approval …

    line 10
  2. Very specific:

    Enums: add new values just before the *_COUNT entry.

    line 11
  3. Very specific:

    Add only what was asked. No summary/design files.

    line 12
  4. Very specific:

    Use HANDLE_EXCEPTIONS_AND_RETURN(<default>, <args>...) when the function takes arguments, and VALIDATE_NOT_NULL / VALIDATE_RANGE for inputs.

    line 26
  5. Very specific:

    C++ wrapper: add the method/class in include/librealsense2/hpp/rs_*.hpp, calling the C function and error::handle(e).

    line 28
  6. Very specific:

    Add the value in the header before *_COUNT (e.g.

    line 35
  7. Very specific:

    Add its string in src/to-string.cpp (CASE( NAME ) in the matching *_to_string switch).

    line 36
  8. Very specific:

    Every new C function is in src/realsense.def.

    line 43

≈ “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

Adding New API to librealsense

Rules

  • Add, don't change. Never remove or change the signature, struct layout or enum values of existing public API without explicit user approval — the C API keeps ABI compatibility within a major version.
  • Enums: add new values just before the *_COUNT entry; never renumber existing ones.
  • Add only what was asked. No summary/design files; use an example instead of a doc unless one is really needed (doc/<feature>.md).
  • New files get the copyright header with the current year (see the file-creation skill).

Checklist — new C function

  1. Declare in the matching C header include/librealsense2/h/rs_*.h, with a doc comment and a trailing rs2_error** error parameter.
  2. Implement in src/rs.cpp using the API-call wrappers, which turn exceptions into rs2_error:
    rs2_processing_block* rs2_create_mjpeg_decoder(rs2_error** error) BEGIN_API_CALL
    {
        return new rs2_processing_block{ std::make_shared<mjpeg_converter>(RS2_FORMAT_RGB8) };
    }
    NOARGS_HANDLE_EXCEPTIONS_AND_RETURN(nullptr)
    Use HANDLE_EXCEPTIONS_AND_RETURN(<default>, <args>...) when the function takes arguments, and VALIDATE_NOT_NULL / VALIDATE_RANGE for inputs.
  3. Export the symbol in src/realsense.def next to related functions. Windows exports only what is listed there — a missing entry builds fine but fails to link for users.
  4. C++ wrapper: add the method/class in include/librealsense2/hpp/rs_*.hpp, calling the C function and error::handle(e).
  5. Python: bind it in the matching wrappers/python/pyrs_*.cpp (e.g. pyrs_processing.cpp, pyrs_device.cpp, pyrs_sensor.cpp, pyrs_frame.cpp) with snake_case names and a docstring.
  6. Example / test: a short C++ example in examples/<feature>/ (with CMakeLists.txt) when the feature is user-facing, and/or a pytest test (see the pytest-infra skill).
  7. Build the library and pyrealsense2, and try the new API from Python.

Checklist — new enum value (option, metadata, stream, format...)

  1. Add the value in the header before *_COUNT (e.g. RS2_OPTION_* in rs_option.h, RS2_FRAME_METADATA_* in rs_frame.h).
  2. Add its string in src/to-string.cpp (CASE( NAME ) in the matching *_to_string switch).
  3. Implement it where it applies (e.g. the device/sensor option registration under src/ds/..., or the metadata parser).
  4. A new enum type also needs src/core/enum-helpers.h, its rs2_<type>_to_string declared, exported in src/realsense.def, and a Python binding in wrappers/python/c_files.cpp.

Before Finishing

  • git diff shows no changed signatures, struct layouts or enum values in include/librealsense2/.
  • Every new C function is in src/realsense.def.
  • Library and Python bindings build; the new API was exercised.

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.