用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Nox-Lumen-tech/combo-skills --skill clang-tidy命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
本地 agent 的 ragbase 远程客户端:直接查云端知识库(语义检索 / 列文档 / 翻 chunk)、嫁接已有 session 的执行成果,以及向已有 session 派发任务(dispatch)。
L1 本地静态分析。调用 Checkstyle/PMD/SpotBugs/Detekt/Ruff/Bandit/Semgrep/cppcheck/clang-tidy 等工具链对代码做客观检测,输出 CodeEvidence JSON。支持 git diff、指定路径、--all 全量扫描三档。 触发词:静态分析、lint、跑检查工具、scan code、全量扫描、run linter、检查代码规范、安全扫描、跑 semgrep、检查漏洞、从头审、全分支审。 不触发:当用户说"review this PR"/"review before merge"/"is this safe?"时,走 code-review skill(LLM 主观审查)。 适用:需要对照需求文档/知识库的深度审核 → 先本地 L1 全量出 CodeEvidence → 上传云端 L2(详见 references/cloud-api-reference.md 的 "全量 + L2 组合")。 与 code-review 的关系:code-review = LLM 主观评审(含 diff/全分支三种场景),static-analysis = 工具客观检测(需安装工具)。两者互补,可串联使用。
企业级代码审核核心。对照需求文档/设计文档/编码规范/Bug 历史做 L2 理解性审核。 不做静态检查(那是各语言 Skill D1-D10 的事),只做需要 LLM + 知识库才能做到的深度审核。
基于 SOC 职业分类
正在显示 SKILL.md
| name | clang-tidy |
| description | C/C++ 静态分析,覆盖 bugprone/performance/modernize/cert/security 检查 |
| execution_mode | sandbox |
| metadata | {"language":["c","cpp"],"upstream":{"repo":"https://github.com/llvm/llvm-project (clang-tools-extra/clang-tidy)","stars":"37700 (LLVM 整体)","since":2013,"license":"Apache-2.0 with LLVM Exception","latest":"LLVM 18.x","rules":"400+ checks(18 个检查组:bugprone/cert/performance/modernize/cppcoreguidelines/...)","install":"apt install clang-tidy","integrations":["CMake","Bear","MegaLinter","reviewdog"]},"rating":{"community":"5/5","rules_richness":"5/5","speed":"2/5","accuracy":"5/5","integration":"3/5","overall":"4.0/5 ⭐⭐⭐⭐"}} |
| 检查范围 | 对应需求 | clang-tidy 检查组 |
|---|---|---|
| Bug 检测 | "逻辑漏洞" | bugprone-*(悬垂指针、使用后移动、未初始化) |
| 性能 | "性能问题" | performance-*(不必要拷贝、低效容器操作) |
| 安全 | "安全风险" | cert-* + clang-analyzer-security.* |
| 现代化 | 代码质量 | modernize-*(auto、范围 for、nullptr) |
| C++ 核心规范 | "代码规范" | cppcoreguidelines-* |
| 空指针/越界 | "空指针风险、数组越界" | clang-analyzer-core.NullDereference + clang-analyzer-core.VLASize |
CLI: clang-tidy src/*.cpp --checks='bugprone-*,performance-*,cert-*,modernize-*' --export-fixes=fixes.yaml
前提: 需要 compile_commands.json(CMake 生成或 Bear 工具生成)
现有库: LLVM 自带,apt install clang-tidy。输出为 YAML fixes 文件,可用 clang-apply-replacements 自动修复。reviewdog 有 reviewdog/action-clang-tidy 直接桥接到 PR 评论。MegaLinter 已内置。