소스 정보
- 저장소
- ROCm/rocprofiler-systems-skills
- 최근 소스 활동
- 2026년 3월 12일 19:40
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SOC 직업 분류 기준
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ROCm/rocprofiler-systems-skills --skill static-analysis명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
Given a TheRock nightly build (URL or run-id), return the rocm-systems pin_sha used in that build
Check whether a given rocm-systems commit is included in a specific TheRock nightly build
Find the first TheRock nightly build that includes a given rocm-systems commit
| name | static-analysis |
| description | Run static analysis tools on changed files and generate a report |
Run available static analysis tools on changed files and produce a structured report.
| 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 |
┌─────────────────────────────────────────────────────────────────┐
│ 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 │
└─────────────────────────────────────────────────────────────────┘
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) ;;
esac
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' ' ')
# 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"
# 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)"
fi
If running in VS Code with MCP:
Use mcp__ide__getDiagnostics to get real-time diagnostics
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
fi
cppcheck:
if [ -n "$cpp_files" ] && which cppcheck >/dev/null 2>&1; then
cppcheck --enable=warning,style,performance $cpp_files 2>&1
fi
ruff (recommended - fast):
if [ -n "$py_files" ] && which ruff >/dev/null 2>&1; then
ruff check $py_files 2>&1
fi
pylint:
if [ -n "$py_files" ] && which pylint >/dev/null 2>&1; then
pylint --output-format=text $py_files 2>&1
fi
mypy:
if [ -n "$py_files" ] && which mypy >/dev/null 2>&1; then
mypy $py_files 2>&1
fi
shellcheck:
if [ -n "$sh_files" ] && which shellcheck >/dev/null 2>&1; then
shellcheck $sh_files 2>&1
fi
cmake-lint:
if [ -n "$cmake_files" ] && which cmake-lint >/dev/null 2>&1; then
cmake-lint $cmake_files 2>&1
fi
| 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) |
# 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
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
...
...
The following tools were not found and could not be run:
cppcheck - Install with: apt install cppcheckmypy - Install with: pip install mypy✅ 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 review
When run standalone, output the full report to the user.
Example invocations:
| 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 |