一键导入
pre-reviewer
Automated pre-review tool to inspect C++ style, concurrency safety, test quality, and CL descriptions before submitting code for human review.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Automated pre-review tool to inspect C++ style, concurrency safety, test quality, and CL descriptions before submitting code for human review.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pre-reviewer |
| description | Automated pre-review tool to inspect C++ style, concurrency safety, test quality, and CL descriptions before submitting code for human review. |
This skill acts as a pre-review confidence check tool for WebRTC C++ contributions. Use this skill to evaluate code changes for common C++ anti-patterns, concurrency bugs, test hygiene issues, and CL description completeness.
[on_certificate_ready = std::move(on_certificate_ready)][callback = std::move(on_certificate_ready)]BlockingCall), prefer
auto-capture ([&]). Do not explicitly list captures as it reduces
readability.
nullptr Comparisons: Always compare pointer types to nullptr
explicitly. Avoid implicit boolean conversion in conditions.
if (tq_ != nullptr) / RTC_DCHECK(transport == nullptr);if (tq_) / RTC_DCHECK(!transport);auto)auto: Explicitly spell out types unless the type is
overly verbose (e.g. templates) or using auto directly improves safety. Do
not use it merely to avoid writing the type.
++i, --i) unless
postfix semantics are required.
std::unique_ptr<Foo> foo = std::make_unique<Foo>();std::unique_ptr<Foo> foo(std::make_unique<Foo>());constinit directly instead of ABSL_CONST_INIT.
std::exchange to simplify reset-and-return logic.
std::pair{a, b} instead of
std::make_pair(a, b).std::optional, it
is recommended to move first and dereference after (e.g. *std::move(opt)).
Note that this is generally not recommended for std::unique_ptr.
std::move on return statements
when it prevents copy elision (NRVO/RVO). Moving a member variable out of a
class when returning can still be useful.RecreateEncoder(std::move(config_)) which internally
updates config_ back. Prefer separating it into a parameterless reset
method or a config updater.RTC_DCHECK_RUN_ON) inside destructors. In C++, it is assumed that no other
threads can call into an object while it is being destroyed..Times(1) to EXPECT_CALL as
it is the default.EXPECT_CALL when
all parameters are wildcards (applicable to non-overloaded methods).
ON_CALL instead of EXPECT_CALL for
setting default behavior without setting expectations.
FAIL() << "message"; instead of triggering a
crash when verifying preconditions or expectations.
.md files, always include
freshness metadata to track ownership.