/odin-native:static-analysisfrom ODIN Native
Selects, runs, and triages C/C++ static analysis using clang-tidy, cppcheck, and scan-build. Configures checks, suppresses false positives, generates compile_commands.json, and integrates into CI pipelines.
Ships in ODIN Native. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Select, run, and triage C/C++ static analysis: clang-tidy, cppcheck, and scan-build. Grounded against LLVM/Clang 23.1.0 and cppcheck 2.21.0.
| Field | Bound contract |
|---|---|
| Trigger | The task runs or configures clang-tidy, cppcheck, or scan-build, interprets check categories, suppresses false positives, generates compile_commands.json, or wires static analysis into CI. |
| Authority | Reversible local: writes only .clang-tidy, suppression comments, source files (through -fix), and analysis reports; rollback is version control. No remote mutation. |
| Side effect | clang-tidy -fix edits source files in place; analyzers read the compilation database. |
| Done | The analyzer runs over the intended translation units and findings are triaged into fixed, suppressed with reason, or reported. |
compile_commands.json.compile_commands.json. Done when: the database covers the sources to analyze.cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ln -s build/compile_commands.json .
# Make-based trees
bear -- make
# or: pip install compiledb && compiledb make
clang-tidy src/foo.c -- -std=c23 -I include/
run-clang-tidy -p build/ -j"$(nproc)"
clang-tidy -checks='bugprone-*,modernize-*,performance-*' src/foo.cpp
clang-tidy -checks='modernize-use-nullptr' -fix src/foo.cpp
| Goal | Categories |
|---|---|
| Find real bugs | bugprone-*, clang-analyzer-* |
| Modernize C++ | modernize-* |
| C++ Core Guidelines | cppcoreguidelines-* |
| Performance | performance-* |
| Security hardening | cert-*, hicpp-* |
| Readability and style | readability-* |
.clang-tidy at the project root so every run uses the same policy. Done when: the config file parses and clang-tidy picks it up.Checks: >
bugprone-*,
modernize-*,
performance-*,
-modernize-use-trailing-return-type,
-bugprone-easily-swappable-parameters
WarningsAsErrors: 'bugprone-*,clang-analyzer-*'
HeaderFilterRegex: '^(src|include)/.*'
CheckOptions:
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: readability-identifier-naming.VariableCase
value: camelCase
int result = riskyOp(); // NOLINT(bugprone-signed-char-misuse) - hardware register
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
constexpr int BUFFER_SIZE = 4096;
// NOLINTBEGIN(readability-*)
...legacy block...
// NOLINTEND(readability-*)
Exclude third-party trees with HeaderFilterRegex rather than NOLINT.
cppcheck --enable=warning,performance,portability \
--suppress=missingIncludeSystem \
--error-exitcode=1 \
--std=c23 \
src/
cppcheck --project=build/compile_commands.json
cppcheck --xml --xml-version=2 src/ 2> cppcheck-report.xml
--enable values: warning (undefined behavior, bad practice), performance, portability, information, or all.
scan-build make
scan-build -o /tmp/scan-out cmake --build build/
scan-view /tmp/scan-out/*/
# Enable a specific checker; list all with clang -cc1 -analyzer-checker-help
scan-build -enable-checker security.insecureAPI.gets make
- name: Static analysis
run: |
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
run-clang-tidy -p build -j"$(nproc)" -warnings-as-errors '*'
- name: cppcheck
run: |
cppcheck --enable=warning,performance \
--suppress=missingIncludeSystem \
--error-exitcode=1 \
src/
For per-check details see references/clang-tidy-checks.md.
compile_commands.json first; without it flags and include paths are guesses.-fix per check, not across the whole suite at once.HeaderFilterRegex instead.make -B or a clean build directory.missingIncludeSystem noise: the flag suppresses it; deeper fixes need --includes-file or -I flags.A .clang-tidy or cppcheck configuration encoding the agreed check policy, a triaged findings list (fixed, suppressed with reason, or open), and a CI step that gates on new warnings.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
clang-tidy, cppcheck, scan-build, compile-commands, c-cpp-analysis
138 skills in this plugin
/abi-and-calling-conventionsUse when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi./adc-dac-baremetalUse when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal./af-xdpUse when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk./apple-siliconUse when tuning or profiling native code on Apple M-series Macs: unified memory, 16 KiB pages, Accelerate and Metal for matrix work, xctrace and leaks, Rosetta 2, or sysctl hardware queries./arm-sveUse when writing or porting AArch64 SIMD to SVE or SVE2: arm_sve.h intrinsics, predicates, vector-length-agnostic loops, auto-vectorization, or SVE registers in GDB. Not for NEON: use simd-intrinsics./assembly-armUse when reading or writing AArch64 or AArch32 Thumb assembly, inline asm in C, AAPCS64 register roles, or NEON and SVE vector code. Not for ABI detail across ISAs: use abi-and-calling-conventions.npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odin-nativeOther plugins' skills for the same job