rocm/rocm-libraries/hipdnn-tidy
Claude Code and agent skill by rocm/rocm-libraries
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Run clang-tidy on hipDNN after a build, scoped to the translation units affected by changed files. Much faster than ENABLE_CLANG_TIDY=ON, which runs clang-tidy inline with every compile. Resolves changed headers to the translation units that include them. Use when asked to run clang-tidy, lint changed files, or check tidy cleanliness before pushing.
Install
npx vskill@latest install rocm/rocm-libraries/hipdnn-tidySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as rocm/rocm-libraries/hipdnn-tidy.
hipDNN clang-tidy (post-build, changed files only)
Use this skill when the user asks to run clang-tidy over hipDNN, lint what they changed, or confirm a branch is tidy-clean before pushing.
Do not reach for -DENABLE_CLANG_TIDY=ON for this. That option runs clang-tidy inline with every compile: it roughly quadruples a clean Windows build and re-runs on every recompile. clang-tidy needs only the compile database, so this skill runs it afterwards over a normal build and narrows the work to what changed.
How it works
scripts/tidy_changed.py drives LLVM's run-clang-tidy against compile_commands.json:
- Derives changed files from git: the merge base with the base ref, plus
staged, unstaged, and untracked edits.
- Resolves changed headers to translation units. Headers are not
translation units and never appear in the compile database, so a changed header is walked backwards through the include graph to every .cpp that reaches it, transitively. The scan reads #include lines, so it works on a configured-but-never-compiled tree.
- Writes a filtered
compile_commands.jsoncontaining exactly the selected
entries and points run-clang-tidy at it. This is exact, unlike run-clang-tidy's positional path regexes, which both over- and under-match.
Diagnostics and exit code match a full run: the configuration comes from projects/hipdnn/.clang-tidy (211 checks, WarningsAsErrors: '*'), so any finding exits non-zero.
Inputs
Infer from the user request:
- Build directory: required. Any configured hipDNN build directory holding
compile_commands.json. It does not need ENABLE_CLANG_TIDY=ON; a normal build (or even a configure-only tree) is the intended input.
- Base ref:
--base <ref>, defaultorigin/develop. Use the branch the
work will merge into.
- Explicit files:
--files <path>...to check specific paths instead of
deriving them from git. Headers are resolved to their includers exactly as git-derived changes are.
- Everything:
--allto check every translation unit in the database. - Preview:
--dry-runto list the selected translation units without
running clang-tidy. Use this first when a change touches a widely-included header, so the user can see the scope before committing to the run.
- Jobs:
-j <n>, default processor count. - Tool overrides:
--clang-tidyand--run-clang-tidy. Normally omitted:
both are read from the build's CMakeCache.txt (CLANG_TIDY_EXE, RUN_CLANG_TIDY_EXE), which the configure step already version-checked.
Workflow
- Find the build directory. Prefer one the user names; otherwise look for
compile_commands.json under the repository's build directories and confirm the choice before running.
Then choose the scope. Default to changed files; use --all for a full pass over every translation unit in the compile database when the user asks to check the whole project, wants a CI-equivalent result, or when the change invalidates a per-file scope: edits to .clang-tidy, to compiler flags, or to a build option that alters preprocessor branches. A full pass on hipDNN core is roughly 554 translation units and takes minutes, so say so before starting one, and prefer changed-file scope when a branch is the subject.
- Run the script from the repository root, where
<skill-directory>is the
directory holding this SKILL.md:
``bash python <skill-directory>/scripts/tidy_changed.py --build-dir <build-dir> [options] ``
<skill-directory> is the directory of the skill you were invoked from; use the scripts bundled there. Keep full output in a log when the run is large, and show the diagnostics rather than the progress lines.
- Report the selected translation unit count against the database total, then
the diagnostics. Group repeated header diagnostics: a defect in a header is reported once per including translation unit, so the raw count overstates the number of distinct problems.
- On a non-zero exit, show each unique diagnostic with its check name. Fix the
code rather than adding suppressions unless the user asks otherwise; a finding inside a system or vendor header is the exception worth raising with them.
Report
Summarize:
- Changed files detected and the base ref used
- Selected translation units versus the compile database total
- Unique diagnostics, each with file, line, and check name
- Clean or not, and the exit code
Notes
- The build directory must be configured. Compiled objects are not required:
hipDNN's generated headers (*_export.h, version.h) are written at configure time and the FlatBuffers *_generated.h files are committed, so a configure-only tree analyses identically to a fully built one.
- The compile database is regenerated at configure time. After adding a source
file, reconfigure or the new translation unit will not be in the database.
- The database encodes one configuration's flags. Checking against a Debug or
sanitizer build analyses different preprocessor branches than a Release one.
- On Windows the script disables
bugprone-exception-escapeand
performance-noexcept-move-constructor, mirroring the WIN32 block in projects/hipdnn/cmake/ClangTidy.cmake. Both fire on Microsoft STL internals rather than on hipDNN code and are clean against libstdc++. Keep the two in sync.
- Per-directory
.clang-tidyfiles are not applied. Passing-config-file
disables clang-tidy's directory discovery, so the nested configs under frontend/tests/, tests/frontend/, and test_sdk/tests/ are inert. This matches the behaviour of the in-tree tidy targets and of an ENABLE_CLANG_TIDY=ON build.
- Changing a widely-included header selects many translation units, which is
correct but slow. --dry-run shows the scope first.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingprojects/hipdnn/tools/ai/skills/hipdnn-tidy/SKILL.md
Popularity
- Repository stars
- 441
- Repository forks
- 420
- 7-day trend score
- 30
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rocm/rocm-libraries/hipdnn-tidy)