agentCLAWHUBUnverified

ia-cpp-systems

Modern C++ patterns: RAII and ownership, rule of zero/five, exceptions and error handling, API and ABI boundaries, templates, and CMake tooling. Use when writing, reviewing, refactoring, or debugging C++, working with smart pointers, move semantics, memory leaks, template errors, or gtest. For plain C, see ia-c-systems. Skill: ia-cpp-systems Owner: iliaal Summary: Modern C++ patterns: RAII and ownership, rule of zero/five, exceptions and error handling, API and ABI boundaries, templates, and CMake tooling. Use when writing, reviewing, refactoring, or debugging C++, working with smart pointers, move semantics, memory leaks, template errors, or gtest. For plain C, see ia-c-systems. Tags: latest:5.1.0 Version history: v5.1.0 | 2026-10-

OpenClaw

Rank

62

Safety

84

Downloads

965

Updated

Oct 12, 2026

Version

5.1.0

Source

CLAWHUB

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 965 downloads reported by the source. Last updated 10/12/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Public facts

Every fact links back to the source it came from.

Vendor
Clawhubvendor · observed Oct 12, 2026
Protocol compatibility
OpenClawcompatibility · observed Oct 12, 2026
Adoption signal
965 downloadsadoption · observed Oct 12, 2026
Latest release
5.1.0release · observed Oct 11, 2026
Handshake status
UNKNOWNsecurity

What changed

Newest first. Only changes that point at a source are listed.

Install and run

Setup complexity: low.

clawhub skill install s17bcar8wq0xhegs0ny6f57ypd8484bw:compound-eng-cpp-systems
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-cpp-systems/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

144,131 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: ia-cpp-systems
class: language
description: >-
  Modern C++ patterns: RAII and ownership, rule of zero/five, exceptions and
  error handling, API and ABI boundaries, templates, and CMake tooling. Use when
  writing, reviewing, refactoring, or debugging C++, working with smart pointers,
  move semantics, memory leaks, template errors, or gtest. For plain C, see
  ia-c-systems.
paths:
  - "**/*.cpp"
  - "**/*.hpp"
  - "**/*.cc"
  - "**/*.hh"
  - "**/*.cxx"
  - "**/*.h"
  - "**/CMakeLists.txt"
  - "**/*.cmake"
---

# C++ Systems & Libraries

Covers C++17 as the baseline, with C++20 features called out where a project's standard allows them. For plain C (manual lifetimes, status enums, native extensions), see the `ia-c-systems` skill.

## Working rules

- Make resource ownership explicit and use RAII for release on every exit path.
- Keep borrowed views within backing-storage lifetimes and review copy/move behavior when special members change.
- Follow the project's error model and supported language standard.
- Preserve ABI and avoid invoking unknown callbacks while holding locks or invalidatable container iterators.

## Repo conventions outrank this skill

Check `CMakeLists.txt` for `CXX_STANDARD`, read `.clang-format` and `.clang-tidy`, and read two adjacent translation units before writing. Where they conflict with the rules below, they win.

The conflicts that actually happen:

| Local constraint | Consequence |
|---|---|
| `-fno-exceptions` | Error handling is codes or `expected`-alikes. Constructors cannot report recoverable failure, so use a fallible factory or construct a valid fallback state. `new (std::nothrow)` only where the project's OOM policy is to observe null and recover; plain `new` is fine where the policy is termination |
| Standard pinned below C++17 | No `std::optional`/`string_view`/structured bindings/`if constexpr`; check before using any |
| Public header is ABI-stable | No layout changes, no inline-function changes, no added virtuals: load the ABI reference |
| Embedded or freestanding target | No RTTI, no dynamic allocation in hot paths, possibly no STL containers |


## Ownership and RAII

Every resource has exactly one owner, and that owner is an object whose destructor releases it. A raw `new` or `delete` in application code is a defect.

- `std::unique_ptr<T>` for sole ownership. It is the default; it costs nothing over a raw pointer.
- `std::shared_ptr<T>` only where lifetime is genuinely shared and cannot be expressed as "the owner outlives the users". Reach for it third, not first.
- `std::weak_ptr<T>` to break ownership cycles. LeakSanitizer does report a cycle that is unreachable from any root, but not one still reachable from a global or other registered root, and detection varies by platform and configuration. Do not rely on the sanitizer to find these.
- Raw `T*` and `T&` mean **non-owning observation**, and are correct in that role. A parameter taking `unique_ptr` by value is announcing that it cons

_meta.json

{
  "ownerId": "kn715jrbbh71q9zncr0bqdkr8n848q1a",
  "slug": "compound-eng-cpp-systems",
  "version": "5.1.0",
  "publishedAt": 1791719042678
}

references/api-and-abi.md

# C++ API and ABI boundaries

Load when designing a public library header, exposing C++ to C, shipping a shared library other people link against, or changing anything already released.

## Exceptions must not cross an `extern "C"` boundary

`extern "C"` sets *language linkage*, not the caller's language: a C++ function with C linkage can still legally throw to a C++ caller. The reason to catch everything anyway is the contract. A C caller has no channel to receive a C++ exception, and unwinding through frames actually compiled as C is toolchain-dependent (GCC documents `-fexceptions` as sometimes necessary for exactly this). So every entry point of a C API converts:

```cpp
/* h and input must be non-NULL. On success *out_err is set to NULL.
 * On failure *out_err receives a message owned by the library; release
 * it with lib_error_free(). */
extern "C" int lib_do_thing(lib_handle *h, const char *input, char **out_err)
{
    if (out_err) *out_err = NULL;
    if (h == NULL || input == NULL)
        return LIB_ERR_ARG;

    try {
        reinterpret_cast<Impl *>(h)->doThing(input);
        return LIB_OK;
    } catch (const std::exception &e) {
        if (out_err) *out_err = lib_dup_message(e.what());
        return LIB_ERR;
    } catch (...) {
        if (out_err) *out_err = lib_dup_message("unknown error");
        return LIB_ERR;
    }
}
```

Three things that sample is doing deliberately. It states the non-NULL contract and enforces it, because a C caller gets no reference types to lean on. It clears `*out_err` on entry, so a caller that inspects it after success reads NULL rather than a stale pointer. And the message crosses the boundary through the library's own `lib_dup_message`/`lib_error_free` pair rather than `strdup`/`free`: the caller may link a different allocator, and whoever allocates must be whoever frees. `lib_dup_message` returning NULL under memory pressure is acceptable; the status code still reports the failure.

The bare `catch (...)` is not optional. A `catch (const std::exception &)` alone still lets an `int`, a string literal, or a foreign exception type escape.

The same rule applies to any callback a C library invokes: the callback body is a C frame boundary, so it catches everything and reports through the C API's error channel. This is the failure mode when wrapping a C++ vendor library from a C extension.

## `extern "C"` signature constraints

Only C-compatible types cross: fundamental types, pointers, and trivially-copyable structs with a stable layout. No references, no templates, no `std::` types, no default arguments, no overloading (there is no mangling to distinguish them).

Hand out an opaque pointer to the C++ object and a matching destroy function. `struct lib_handle;` declared but never defined in the public header prevents callers from dereferencing it.

## What breaks ABI

Once a shared library is released, all of the following break consumers even though they still compile. They break in three different

references/cmake-and-tooling.md

# CMake and C++ tooling

Load when setting up or reviewing a C++ build, adding a dependency, wiring sanitizers, or configuring static analysis.

## Target-based CMake

Modern CMake describes targets and their requirements. Directory-scoped commands leak settings into everything below them and are the root of most "works in my build" reports.

| Never | Use instead |
|---|---|
| `include_directories(...)` | `target_include_directories(tgt PUBLIC ...)` |
| `add_definitions(-DFOO)` | `target_compile_definitions(tgt PRIVATE FOO)` |
| appending to `CMAKE_CXX_FLAGS` | `target_compile_options(tgt PRIVATE ...)` |
| `link_directories(...)` | `target_link_libraries(tgt PRIVATE Ns::dep)` |
| `set(CMAKE_CXX_FLAGS "-std=c++17")` | `target_compile_features(tgt PUBLIC cxx_std_17)` |

`PRIVATE` means "I need this to build"; `INTERFACE` means "my consumers need this"; `PUBLIC` is both. Getting these wrong is how an implementation detail becomes part of a library's contract.

```cmake
cmake_minimum_required(VERSION 3.20)
project(mylib LANGUAGES CXX)

find_package(OpenSSL REQUIRED)

add_library(mylib src/client.cpp src/query.cpp)
add_library(Mylib::mylib ALIAS mylib)

target_compile_features(mylib PUBLIC cxx_std_17)
target_include_directories(mylib
    PUBLIC  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
            $<INSTALL_INTERFACE:include>
    PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(mylib PRIVATE OpenSSL::SSL)
```

The generator expressions matter, and they fail loudly rather than subtly: a bare absolute source path in a `PUBLIC` `target_include_directories` makes `install(EXPORT ...)` hard-error with "INTERFACE_INCLUDE_DIRECTORIES property contains path ... which is prefixed in the source directory".

Always export `compile_commands.json`, since clang-tidy, clangd, and IWYU all consume it:

```cmake
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
```

## Warnings as an interface target

Define the warning set once and link it into every target, rather than repeating flags:

```cmake
add_library(project_warnings INTERFACE)
target_compile_options(project_warnings INTERFACE
    "$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-Wall;-Wextra;-Wpedantic;-Wshadow;-Wconversion;-Wnon-virtual-dtor;-Wold-style-cast;-Wcast-align>"
    "$<$<CXX_COMPILER_ID:MSVC>:/W4;/permissive->")

target_link_libraries(mylib PRIVATE project_warnings)
```

The quoted, semicolon-separated spelling is the canonical way to carry a flag *list* through a generator expression, and it stays unambiguous wherever the surrounding context handles whitespace differently. (An unquoted, space-separated genex also works in `target_compile_options` and resolves to the same list; the quoted form is the one to reach for by default, not a bug fix.)

Add `-Werror` in CI only. Making it the local default turns every new compiler version into a blocked workday.

## Presets

`CMakePresets.json` replaces the wiki page of build incantations and gives CI and humans the same commands:

```json
{
 

references/concurrency-and-verification.md

# Concurrency and verification

## Tooling

| Tool | Purpose |
|------|---------|
| `cmake` | Build system; `CMAKE_EXPORT_COMPILE_COMMANDS=ON` feeds every other tool |
| `clang-format` | Formatter, driven by the repo's `.clang-format` |
| `clang-tidy` | Lint (`bugprone-*`, `performance-*`, `modernize-*`, `cppcoreguidelines-*`) |
| ASan + UBSan | `-fsanitize=address,undefined`; TSan separately for threaded code |
| `gtest` / `catch2` | Unit tests |
| `include-what-you-use` | Cuts transitive-include creep that slows builds and hides dependencies |
| `ccache` | Compile cache; the single biggest iteration-speed win on a C++ tree |

Build with `-Wall -Wextra -Wpedantic -Wshadow -Wconversion` and treat warnings as errors in CI.


## Concurrency

- Lock through an RAII guard, never a bare `lock()`/`unlock()` pair; an early return or a throw between them leaves the mutex held. `std::lock_guard` for a plain scope, `std::unique_lock` when the lock must be deferred, moved, or handed to a condition variable, `std::shared_lock` for reader access.
- **Name the guard.** `std::lock_guard<std::mutex>{m};` is a temporary that locks and unlocks before the next statement runs, leaving everything after it unguarded, and it compiles silently under `-Wall -Wextra -Wshadow`. `std::lock_guard<std::mutex>(m);` is worse-looking but harmless: it parses as a declaration of a variable named `m` and fails to compile. Only `std::lock_guard<std::mutex> guard{m};` locks for the scope.
- Take multiple mutexes with one `std::scoped_lock(a, b)` (C++17), which applies a deadlock-avoidance algorithm. Two sequential guards impose a lock order that a second call site can invert.
- Always pass a predicate: `cv.wait(lock, [&]{ return ready; })`. A bare `wait` returns on spurious wakeup and on a notify that raced ahead of the waiter.
- Never call unknown code (a user callback, a virtual, an observer notification) while holding a lock. The callee may take another lock, re-enter, or block, and none of that is visible at the call site.
- A `mutex` member makes a class non-copyable and non-movable; decide whether the type is meant to be either before adding one.

Compile-time signal for these is near zero, so run anything threaded under TSan (see Testing) rather than trusting the warning bundle.


## Testing

- gtest is the default (`TEST(Suite, Case)`, `TEST_F` for fixtures). One test file per public surface.
- `EXPECT_*` to continue after failure, `ASSERT_*` where continuing would crash or cascade.
- `EXPECT_THROW`/`EXPECT_NO_THROW` for the exception contract; assert on the exception's type and message, not merely that something threw.
- Run the suite under ASan and UBSan in CI, and under TSan separately for anything threaded.

For generic test discipline (anti-patterns, real assertions, rationalization resistance), see the `ia-writing-tests` skill.


## Build and analysis

For CMake target design, sanitizer and warning presets, `clang-tidy` configuration (including which checks are fatal ve
Github ReposUpdated 3d agoRank 70

AionUi

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

MCPOPENCLAW
Github ReposUpdated 6mo agoRank 70

activepieces

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

OPENCLAW
Github ReposUpdated 6mo agoRank 70

cherry-studio

AI productivity studio with smart chat, autonomous agents, and 300+ assistants.

MCPOPENCLAW
Github ReposUpdated 7mo agoRank 70

CopilotKit

The Frontend for Agents & Generative UI. React + Angular

OPENCLAW

Machine-readable data

The same record, as JSON, for agents and crawlers.

{
  "facts": [
    {
      "factKey": "vendor",
      "category": "vendor",
      "label": "Vendor",
      "value": "Clawhub",
      "href": "https://clawhub.ai/iliaal/skills/compound-eng-cpp-systems",
      "sourceUrl": "https://clawhub.ai/iliaal/skills/compound-eng-cpp-systems",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-12T00:48:51.451Z",
      "isPublic": true
    },
    {
      "factKey": "protocols",
      "category": "compatibility",
      "label": "Protocol compatibility",
      "value": "OpenClaw",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-cpp-systems/contract",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-cpp-systems/contract",
      "sourceType": "contract",
      "confidence": "medium",
      "observedAt": "2026-10-12T00:48:51.451Z",
      "isPublic": true
    },
    {
      "factKey": "traction",
      "category": "adoption",
      "label": "Adoption signal",
      "value": "965 downloads",
      "href": "https://clawhub.ai/iliaal/compound-eng-cpp-systems",
      "sourceUrl": "https://clawhub.ai/iliaal/compound-eng-cpp-systems",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-12T00:48:51.451Z",
      "isPublic": true
    },
    {
      "factKey": "latest_release",
      "category": "release",
      "label": "Latest release",
      "value": "5.1.0",
      "href": "https://clawhub.ai/iliaal/compound-eng-cpp-systems",
      "sourceUrl": "https://clawhub.ai/iliaal/compound-eng-cpp-systems",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-10-11T11:44:02.678Z",
      "isPublic": true
    },
    {
      "factKey": "handshake_status",
      "category": "security",
      "label": "Handshake status",
      "value": "UNKNOWN",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-cpp-systems/trust",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-cpp-systems/trust",
      "sourceType": "trust",
      "confidence": "medium",
      "observedAt": null,
      "isPublic": true
    }
  ],
  "events": [
    {
      "eventType": "release",
      "title": "Release 5.1.0",
      "description": "v5.1.0",
      "href": "https://clawhub.ai/iliaal/compound-eng-cpp-systems",
      "sourceUrl": "https://clawhub.ai/iliaal/compound-eng-cpp-systems",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-10-11T11:44:02.678Z",
      "isPublic": true
    }
  ]
}

Record generated Oct 12, 2026.

For crawlers

This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.

  • One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements.
  • Every agent, one feed: /.well-known/ai-catalog.json
  • What this site sells, and the price: /.well-known/x402
  • Paid run-check: /api/v1/agents/clawhub-iliaal-compound-eng-cpp-systems/run-check

Sponsored

Ads related to ia-cpp-systems and adjacent AI workflows.