Install
$ agentstack add skill-redtropig-harness-anchor-cpp-build-systems ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
C/C++ Build Systems
The build system is the single most important piece of C/C++ tooling — it determines how every other tool (clang-tidy, IWYU, language servers, debuggers) understands your code.
The compile_commands.json invariant
> Every C/C++ project must export compile_commands.json.
It's a JSON database of compiler invocations per file. Without it, clang-tidy/IWYU/clangd can't parse your code correctly (they need to know macros, includes, standard, flags). The cpp-static-analysis skill enforces this prerequisite.
Per-build-system commands
CMake
cmake -S . -B .build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build .build -j
-DCMAKE_EXPORT_COMPILE_COMMANDS=ONis mandatory unless already inCMakeLists.txtviaset(CMAKE_EXPORT_COMPILE_COMMANDS ON)- Out-of-source build (
.build/) keeps the source tree clean - Symlink from project root so tools find it:
ln -sf .build/compile_commands.json .
Meson
meson setup builddir
meson compile -C builddir
- Meson emits
compile_commands.jsonin builddir automatically. Symlink it to root if tooling expects it there.
Make (raw)
Pure Makefile projects don't generate compilecommands.json natively. Use bear:
bear -- make -j
Or compiledb:
compiledb make -j
Bazel
bazel build //...
bazel run @hedron_compile_commands//:refresh_all
Bazel requires the hedron_compile_commands rule. If not configured, suggest the user add it; do NOT try to hand-edit BUILD files.
Build failure triage (you fix common ones, escalate the rest)
- CMake "could not find package X" → likely missing
find_package(X REQUIRED)cleanup or wrong CMAKEPREFIXPATH. Suggest:cmake -L .buildto inspect, or pass-DX_DIR=....
- Linker "undefined reference" → missing source in target or missing link library. Check
target_link_libraries(...)lists everything.
- "No such file: " → missing
target_include_directoriesor system header missing. For system headers, suggest installing the dev package.
- Configure step fails on macOS → often missing Command Line Tools:
xcode-select --install.
- Anything cryptic → escalate: dispatch the
cpp-build-doctorsubagent with the full error log.
- Anything you have now failed to fix twice → escalate, even if it looked obvious. The first
diagnosis is yours; a second failed attempt at the same failure means your hypothesis is the problem, and fresh context beats another iteration on a wrong prior. (Fixing it on the first try and moving on is the expected path — this is a repeat-failure trigger, not a "always delegate build errors" rule. The Session Pulse hook independently nudges at ≥3 repeats; this fires earlier and is yours to honour.)
Multi-config builds (Debug + Release + Sanitizer)
Keep separate build dirs:
.build/debug
.build/release
.build/asan
This is critical for cpp-sanitizers skill — the sanitizer build is a separate config, not a flag toggle on the same build.
When the user has NO build system yet
Don't pick one for them. Ask:
- Single-file experiment → suggest plain CMake (most portable)
- Header-only library → suggest CMake INTERFACE target
- Existing autotools project → keep it; just add
bearfor compile_commands.json - Bazel monorepo → it's a one-way door, only suggest if user already uses it elsewhere
Detection helper
Run bash ${CLAUDE_PLUGIN_ROOT}/scripts/cpp-detect.sh --target . to get a JSON summary of what's present. Used by the SessionStart hook to gate C/C++ skills.
References
- See
cmake-reference.mdfor CMake idioms used in this codebase / project conventions. - See
meson-reference.mdfor Meson equivalents. - See
compile-commands-guide.mdfor the deep-dive on compile_commands.json semantics.
When NOT to invoke this skill
- Pure C/C++ language questions (use docs / Context7 instead)
- Build performance tuning — separate concern; use after the build works
- Cross-compilation — out of scope for harness-anchor; consult build system docs
Calibrated uncertainty
If you propose a build fix you haven't verified by running the build:
> "I believe the fix is `. Please run cmake -S . -B .build && cmake --build .build` and share the output before we mark this resolved."
Looking up tool errors
Unfamiliar CMake/Meson/Bazel error or missing-package message? Don't guess — invoke the docs-lookup skill, which encodes the canonical Context7 → WebSearch → calibrated-uncertainty fallback chain (with explicit "Context7 is unavailable" detection so you don't silently degrade to guessing).
Typical entry queries: cmake find_package, meson dependency, bazel cc_binary, exact error string in quotes.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Redtropig
- Source: Redtropig/harness-anchor
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.