static-analysis
Skill5 starsChanged 16 days agoMITView on GitHub
Run static analysis tools on changed files and generate a report
- Installs packages
12 other projects use a version of this.
Adopted by
Most recently taken up by
- d-o-hub/github-template-ai-agentstheir own version, first seen Nov 3, 2026
- Nox-Lumen-tech/combo-skillstheir own version, first seen Nov 2, 2026
- ZhongYecheng/stm32_skillstheir own version, first seen Oct 15, 2026
- kdy1/kdy1-scriptstheir own version, first seen Oct 13, 2026
- Z3Prover/z3their own version, first seen Oct 8, 2026
- felvieira/claude-skills-fvtheir own version, first seen Sep 2, 2026
Used with
Projects with it also use build-keil, can-debug and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ZhongYechengSkillbuild-keil
当需要通过 Keil MDK 命令行编译嵌入式工程,调用自带脚本解析工程文件、执行构建并定位固件产物时使用。
Also in 3 projects that use this
ZhongYechengSkillcan-debug
当需要调试 CAN 总线通信时使用,支持通过 USB-CAN 适配器监听、发送 CAN 帧和扫描节点。
Also in 3 projects that use this
iPlug2Skillbuild-cmake
Build an iPlug2 plugin project using CMake with Ninja, Xcode, or Visual Studio generators
Also in 3 projects that use this
- +9 more from ZhongYecheng
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- Z3Prover/z3★ 13ksame name
- 0x-Shashi/WEB3-AUDIT-SKILLS★ 61same name
- kdy1/kdy1-scripts★ 33same name
- felvieira/claude-skills-fv★ 27same name
- ZhongYecheng/stm32_skills★ 8same name
- zycdzh/stm32_skills★ 8same name
- Nox-Lumen-tech/combo-skills★ 4same name
- d-o-hub/github-template-ai-agents★ 2same name
- squall-chua/skills★ 2same name
- LiTianYun/claude-skills★ 1same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- analyze-pr-commentsSkill
- architecture-analyzeSkill
- architecture-tradeoffSkill
- askSkill
- code-smellsSkill
- debugging-rocprof-sysSkill
- exploration-explore-codeSkill
- git-commitSkill
- git-gh-clientSkill
- git-prepare-pull-requestSkill
- git-pull-request-statusSkill
- gitSkill
- grill-meSkill
- library-amd-smiSkill
- notify-meSkill
- planning-architectureSkill
- planning-baseSkill
- planning-bugfixSkill
- planning-docsSkill
- planning-featureSkill
- planning-refactorSkill
- programming-cmake-best-practicesSkill
- programming-cpp-constexprSkill
- programming-cpp-design-patternsSkill
- programming-cpp-naming-rulesSkill
- programming-cpp-policy-based-diSkill
- programming-cppSkill
- programming-cpp-stl-algorithmsSkill
- programming-pythonSkill
- pr-review-interactiveSkill
- pr-reviewSkill
- radisha-create-skillSkill
- radisha-helpSkill
- radisha-improve-skillSkill
- radisha-skillsSkill
- radisha-updateSkill
- refactoring-techniquesSkill
- review-architectureSkill
- rocprofsys-buildSkill
- rocprofsys-configureSkill
- rocprofsysSkill
- testing-gtest-gmockSkill
- testing-pytestSkill
- testing-testplanSkill
- therock-build-to-commitSkill
- therock-commit-in-buildSkill
- therock-first-build-with-commitSkill
- update-pr-descriptionSkill
- verify-pmc-metricsSkill
- watchSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run available static analysis tools on changed files and produce a structured report.
- Distinctive: line 49
Ask user or detect automatically:
- Distinctive: line 115
If running in VS Code with MCP:
- Very specific: line 293
When invoked from pr-review:
- Distinctive: line 313
When run standalone, output the full report to the user.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Static Analysis Skill
Run available static analysis tools on changed files and produce a structured report.
When to Use
| Context | Trigger |
| Standalone | User asks to run static analysis, linters, or check code quality |
| PR Review | Invoked by pr-review before manual code review |
| Pre-commit | User wants to check code before committing |
Workflow
┌─────────────────────────────────────────────────────────────────┐
│ Phase 1: Get Changed Files │
│ Determine scope (PR, staged, or all changes) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Phase 2: Detect Available Tools │
│ Check which tools are installed on the system │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Phase 3: Run Tools on Changed Files │
│ Execute each tool, capture output │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Phase 4: Generate Report │
│ Parse output, categorize by severity, format report │
└─────────────────────────────────────────────────────────────────┘Phase 1: Get Changed Files
Determine Scope
Ask user or detect automatically:
| Scope | Command | Use When |
| PR changes | git diff --name-only <base>...HEAD | Reviewing a PR |
| Staged | git diff --name-only --cached | Pre-commit check |
| Unstaged | git diff --name-only | Check current work |
| All uncommitted | git diff --name-only HEAD | Local changes review |
| Specific files | User-provided list | Targeted analysis |
# Get base branch (for PR scope)
base_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
[ -z "$base_branch" ] && base_branch="main"
# Get changed files based on scope
case "$scope" in
pr) changed_files=$(git diff --name-only "$base_branch"...HEAD) ;;
staged) changed_files=$(git diff --name-only --cached) ;;
all) changed_files=$(git diff --name-only HEAD) ;;
esacFilter by Language
cpp_files=$(echo "$changed_files" | grep -E '\.(cpp|cc|cxx|c|hpp|h)$' | tr '\n' ' ')
py_files=$(echo "$changed_files" | grep -E '\.py$' | tr '\n' ' ')
sh_files=$(echo "$changed_files" | grep -E '\.(sh|bash)$' | tr '\n' ' ')
cmake_files=$(echo "$changed_files" | grep -E '(CMakeLists\.txt|\.cmake)$' | tr '\n' ' ')Phase 2: Detect Available Tools
# C++ tools
which clang-tidy >/dev/null 2>&1 && echo "clang-tidy: available"
which cppcheck >/dev/null 2>&1 && echo "cppcheck: available"
# Python tools
which ruff >/dev/null 2>&1 && echo "ruff: available"
which pylint >/dev/null 2>&1 && echo "pylint: available"
which mypy >/dev/null 2>&1 && echo "mypy: available"
# Shell tools
which shellcheck >/dev/null 2>&1 && echo "shellcheck: available"
# CMake tools
which cmake-lint >/dev/null 2>&1 && echo "cmake-lint: available"Check for compile_commands.json (C++)
# Required for clang-tidy
if [ -f "build/compile_commands.json" ]; then
echo "compile_commands.json: build/"
elif [ -f "compile_commands.json" ]; then
echo "compile_commands.json: ./"
else
echo "compile_commands.json: NOT FOUND (clang-tidy may not work)"
fiUse IDE Diagnostics (if available)
If running in VS Code with MCP:
Use mcp__ide__getDiagnostics to get real-time diagnosticsPhase 3: Run Tools on Changed Files
C++ Tools
clang-tidy:
if [ -n "$cpp_files" ] && which clang-tidy >/dev/null 2>&1; then
compile_db=""
[ -f "build/compile_commands.json" ] && compile_db="-p build/"
[ -f "compile_commands.json" ] && compile_db="-p ."
for file in $cpp_files; do
[ -f "$file" ] && clang-tidy "$file" $compile_db 2>&1
done
ficppcheck:
if [ -n "$cpp_files" ] && which cppcheck >/dev/null 2>&1; then
cppcheck --enable=warning,style,performance $cpp_files 2>&1
fiPython Tools
ruff (recommended - fast):
if [ -n "$py_files" ] && which ruff >/dev/null 2>&1; then
ruff check $py_files 2>&1
fipylint:
if [ -n "$py_files" ] && which pylint >/dev/null 2>&1; then
pylint --output-format=text $py_files 2>&1
fimypy:
if [ -n "$py_files" ] && which mypy >/dev/null 2>&1; then
mypy $py_files 2>&1
fiShell Tools
shellcheck:
if [ -n "$sh_files" ] && which shellcheck >/dev/null 2>&1; then
shellcheck $sh_files 2>&1
fiCMake Tools
cmake-lint:
if [ -n "$cmake_files" ] && which cmake-lint >/dev/null 2>&1; then
cmake-lint $cmake_files 2>&1
fiPhase 4: Generate Report
Severity Mapping
| Tool | Check/Code | Severity |
| clang-tidy | bugprone-*, clang-analyzer-* | Critical (100) |
| clang-tidy | performance-* | Should Fix (50) |
| clang-tidy | modernize-*, readability-* | Nitpick (20) |
| cppcheck | error | Critical (100) |
| cppcheck | warning | Must Fix (80) |
| cppcheck | style, performance | Should Fix (50) |
| ruff | E (error), F (pyflakes) | Must Fix (80) |
| ruff | W (warning) | Should Fix (50) |
| ruff | C, N (convention, naming) | Nitpick (20) |
| pylint | E, F (error, fatal) | Critical (100) |
| pylint | W (warning) | Should Fix (50) |
| pylint | C, R (convention, refactor) | Nitpick (20) |
| mypy | error | Must Fix (80) |
| shellcheck | error | Must Fix (80) |
| shellcheck | warning | Should Fix (50) |
| shellcheck | info, style | Nitpick (20) |
Report Format
# Static Analysis Report
**Scope:** [PR #123 / staged changes / all uncommitted]
**Files analyzed:** X files
**Tools run:** clang-tidy, ruff, shellcheck
## Summary
| Severity | Count |
|----------|-------|
| 🔴 Critical | X |
| 🟠 Must Fix | X |
| 🟡 Should Fix | X |
| 🔵 Nitpick | X |
**Total issues:** X
---
## 🔴 Critical Issues (X)
### 1. bugprone-use-after-move
**File:** `src/parser.cpp:42`
**Tool:** clang-tidy
**Severity:** Critical (100)
**Message:**'data' used after it was moved
**Context:**
```cpp
auto result = std::move(data);
process(data); // Bug: data was moved🟠 Must Fix (X)
2. performance-unnecessary-copy-initialization
File: src/handler.cpp:78
Tool: clang-tidy
Severity: Should Fix (50)
Message:
The copy 'config' is only used as const reference; consider making it a const reference🟡 Should Fix (X)
...
🔵 Nitpicks (X)
...
Tools Not Available
The following tools were not found and could not be run:
cppcheck- Install with:apt install cppcheckmypy- Install with:pip install mypy
No Issues Found
✅ No issues detected by static analysis tools.
## Integration with pr-review
When invoked from `pr-review`:
1. `pr-review` calls `static-analysis` with PR scope
2. `static-analysis` runs tools and generates report
3. Report is included in PR review under "Static Analysis Results"
4. Issues are merged with manual review findings by severity
```markdown
## How pr-review uses this skill:
1. Invoke static-analysis skill with scope=pr
2. Get the generated report
3. Include report in Phase 4 (Code Review) findings
4. Critical/Must Fix issues from tools → Must Fix in review
5. Should Fix from tools → Should Fix in review
6. Nitpicks from tools → Nitpick in reviewStandalone Usage
When run standalone, output the full report to the user.
Example invocations:
- "run static analysis" → analyze all uncommitted changes
- "run static analysis on staged files" → pre-commit check
- "run clang-tidy on the PR" → C++ analysis only
- "check code quality" → full analysis with report
Tool Installation Reference
| Tool | Language | Install Command |
| clang-tidy | C++ | apt install clang-tidy or comes with LLVM |
| cppcheck | C++ | apt install cppcheck |
| ruff | Python | pip install ruff |
| pylint | Python | pip install pylint |
| mypy | Python | pip install mypy |
| shellcheck | Shell | apt install shellcheck |
| cmake-lint | CMake | pip install cmakelint |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

