docs/reference/detail/review-checklist.md
When reviewing workerd C++ code, check for each of these items.
std::string, std::vector, std::optional, std::unique_ptr, etc.new/delete**. Should be kj::heap<T>() or similarthrow statements. Should use KJ_ASSERT/KJ_REQUIRE/KJ_FAIL_ASSERT/etcnoexceptnoexcept(false) on explicit destructors[=] lambda captureskj::Maybe<T&>.attach() on promises. Objects must stay alive for the promise duration.eagerlyEvaluate() with background promises. Lazy continuations may never execute. Co-routines are eager by default.KJ_SYSCALL / KJ_SYSCALL_HANDLE_ERRORSstatic_cast for downcasting where possible. Should be kj::downcast<T> (debug-checked)dynamic_cast for dispatch where possible. Extend the interface insteadstd::to_string or + string concatenation**/* */ block comments. Use // line commentsbool function parameters. Prefer enum class or WD_STRONG_BOOL for clarity at call sites. E.g., void connect(bool secure) should be void connect(SecureMode mode)[[nodiscard]] with functions returning error codes, kj::Maybe, or success booleans that callers must check should be [[nodiscard]].then() chains with complex error handling that would be more readable as a coroutine with co_await. But always avoid suggesting sweeping rewritesconstexpr / consteval where they would be appropriatesrc/workerd/util/ (e.g., custom ring buffer, small set, state machine, weak reference pattern). Always check the util directory before suggesting a new abstraction.override on virtual method overrides..c++ and .h file must begin with the project copyright/license header using the current year (not copied from older files). Expected format:
// Copyright (c) <current-year> Cloudflare, Inc.
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
// https://opensource.org/licenses/Apache-2.0
2017-2022 in a file created in 2026) or omits the header entirely.