Skip to content

Guide for running and triaging clang-tidy, cppcheck, and scan-build on C/C++ code with CI integration.

CCM score
62 of 100
skills.sh installs
1.4K
GitHub stars
303
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers generating compile_commands.json, running clang-tidy, cppcheck, and scan-build, and choosing check categories
  • Includes a category decision tree mapping goals to bugprone-*, modernize-*, cert-*, and related check groups
  • Provides .clang-tidy configuration, NOLINT-style false-positive suppression, and cppcheck suppression flags
  • Designed for teams triaging noisy builds or adding static analysis to CI pipelines

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill static-analysis -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Static Analysis

Purpose

Guide agents through selecting, running, and triaging static analysis tools for C/C++ — clang-tidy, cppcheck, and scan-build — including suppression strategies and CI integration.

Triggers

  • "How do I run clang-tidy on my project?"
  • "What clang-tidy checks should I enable?"
  • "cppcheck is reporting false positives — how do I suppress them?"
  • "How do I set up scan-build for deeper analysis?"
  • "My build is noisy with static analysis warnings"
  • "How do I generate compile_commands.json for clang-tidy?"

Workflow

1. Generate compile_commands.json

clang-tidy requires a compilation database:

# CMake (preferred)
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ln -s build/compile_commands.json .

# Bear (for Make-based projects)
bear -- make

# compiledb (alternative for Make)
pip install compiledb
compiledb make

2. Run clang-tidy

# Single file
clang-tidy src/foo.c -- -std=c11 -I include/

# Whole project via compile_commands.json
run-clang-tidy -p build/ -j$(nproc)

# With specific checks enabled
clang-tidy -checks='bugprone-*,modernize-*,performance-*' src/foo.cpp

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
Categories
Code Review & Quality, Security
First seen
Jun 3, 2026

More from mohitmishra786/low-level-dev-skills

All 54

Similar to Static Analysis

More Code Review & Quality