This walks you through the full cycle of static analysis for C/C++ projects: generating compile_commands.json, running clang-tidy with the right check categories, configuring .clang-tidy files, suppressing false positives with NOLINT, and integrating cppcheck or scan-build into CI. It's opinionated about which checks catch real bugs versus style noise, and includes a decision tree for picking between bugprone, modernize, performance, and security categories. The workflow is solid if you're triaging a noisy build or hardening a codebase before release. Most useful when you know static analysis matters but need the practical commands and suppression strategies to make it bearable.

skills.sh installs
1.2K
GitHub stars
279
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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

Sponsors

Details

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

More from mohitmishra786/low-level-dev-skills

All 54

Recommended

More Security
1iswalle avatargetnote-authiswalle/getnote-cliManage authentication for Get笔记 CLI1.2Kskills.sh installs
2binance avatarderivatives-trading-coin-futuresbinance/binance-skills-hubBinance Derivatives-trading-coin-futures request using the Binance API. Authentication requires API key and secret key. Supports testnet and mainnet.1.2Kskills.sh installs
3behisecc avatarVibeSec-Skillbehisecc/vibesec-skillThis skill helps Claude write secure web applications. Use this when working on any web application or when a user requests a scan or audit to ensure security b1.2Kskills.sh installs
4binance avatarderivatives-trading-optionsbinance/binance-skills-hubBinance Derivatives-trading-options request using the Binance API. Authentication requires API key and secret key. Supports testnet and mainnet.1.2Kskills.sh installs
5binance avatarderivatives-trading-portfolio-marginbinance/binance-skills-hubBinance Derivatives-trading-portfolio-margin request using the Binance API. Authentication requires API key and secret key. Supports testnet and mainnet.1.1Kskills.sh installs
6binance avatarsub-accountbinance/binance-skills-hubBinance Sub-account request using the Binance API. Authentication requires API key and secret key.1.1Kskills.sh installs