Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/redtropig/harness-anchor/cpp-static-analysisnpx skills add Redtropig/harness-anchor --skill cpp-static-analysisgit clone --depth 1 https://github.com/Redtropig/harness-anchorWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00037 | $0.02256 |
| Opus 5 | $0.00018 | $0.01128 |
| Sonnet 5 | $0.00007 | $0.00451 |
| Haiku 4.5 | $0.00004 | $0.00226 |
Grade A, and why
cpp-static-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 193 lines — stays where its author put it; the contents beside it link to each section on GitHub.
C/C++ Static Analysis
Static analysis catches an enormous class of bugs at zero runtime cost: null derefs, leaks, dangling refs, integer overflow, missing initializers, unused includes, banned APIs.
Three core tools cover most needs:
| Tool | What it catches | Cost |
|---|---|---|
| clang-tidy | Style + correctness + modernize + bugprone | Heavy (uses full AST) |
| cppcheck | Quick correctness, leaks, off-by-one | Light (own parser) |
| IWYU | Missing/superfluous #include |
Heavy (compile-driven) |
Prerequisites (hard)
compile_commands.jsonexists at project root or symlinked- A
.clang-tidyconfig exists at project root (use template if not) - The tool is actually reachable — resolve this with the discovery script, not with
command -v:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/cpp-tool-discovery.sh clang-tidy cppcheck include-what-you-use
FOUND lines carry the absolute path — use it directly (the tool need not be on
PATH to be usable). Only a NOT_FOUND line licenses you to call a tool unavailable.
An empty command -v / where proves nothing. On Windows the VS-bundled LLVM
only joins PATH after vcvars64.bat; on macOS Homebrew's llvm is keg-only. Report
absence as "searched PATH + <listed locations>, not found (as of <YYYY-MM-DD>)" —
never "not installed" / "on this machine". The first is a falsifiable claim about
your search; the second is an unfalsifiable claim about the world, and it tends to
get written into AGENTS.md where it silently disables this skill for every later session.
The date carries the other half: a scope-less negative is wrong about where you
looked, a date-less one is wrong about when. Both turn one observation into a
standing fact — and AGENTS.md is exactly where standing facts go unchallenged.
If any prerequisite is missing, say so explicitly instead of pretending to analyze:
"Cannot run clang-tidy because compile_commands.json is missing. Generate it via
cmake -S . -B .build -DCMAKE_EXPORT_COMPILE_COMMANDS=ONthen symlink to root."
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 193 lines · 37 tokens per session scan A 18bf7449460b
cpp-static-analysis is a skill published in the GitHub repository Redtropig/harness-anchor (13 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 2,256 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
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…
arduino-code-generator
Generate Arduino and embedded C++ snippets for sensors, actuators, buses, state machines, timing, data logging, and hardware abstraction. Use when a user requests implementation code and provide the exact board, framework, toolchain, pins, voltage, memory, and library versions first. Bundled templates target UNO…
library-selection
Use when selecting, replacing, pinning, or auditing an Arduino, ESP32, RP2040, C++, or vendor-framework library. Compare architecture support, framework and version compatibility, API behavior, footprint, maintenance, provenance, security, and hardware assumptions before installation.
zephyr-json
JSON serialization and deserialization in Zephyr RTOS using the descriptor-based JSON library. Use when encoding C structs to JSON strings, parsing JSON into C structs, working with nested objects or arrays, handling cloud/IoT protocols (MQTT, HTTP, CoAP payloads), or implementing REST APIs on embedded devices.
unreal-cpp
写 Unreal C++/蓝图时使用。UObject/GC、反射宏、Tick 性能、蓝图边界。.
gdb
Debug and trace C/C++/Rust programs with the GNU Debugger (GDB) without blocking the agent. Use when you need to set tracepoints, inspect variables, or monitor a running process while staying responsive to the user.