Instruction file imported from webex/web-capabilities (
.github/instructions/code-review.instructions.md). Copyright stays with the author.
Code Review Instructions
Priorities
CapabilityStatestays correct. ReturnUNKNOWNwhen signals are missing instead of guessing.- Keep
WebCapabilities.supportsWasm()separate fromWasmRuntimeProbe.check(). They answer different questions. - Preserve probe cleanup: terminate the worker and revoke the Blob URL.
- Treat probe thresholds, check order, visibility handling, and reason codes as correctness-sensitive.
- Treat public exports and capability outcomes as compatibility-sensitive.
- Require tests when behavior changes at browser boundaries or in the WASM probe.
Checks
- Prefer browser APIs and feature detection. Use
BrowserInfofor version checks instead of new user-agent parsing. - Do not use the WASM availability helper as a stand-in for the async speed probe, or the other way around.
- Keep the probe's one-result-per-page cache unless a test intentionally resets it.
- Reject invalid worker measurements before classification.
- Return
UNKNOWNfor background-tab and too-short timing cases instead of a false slow or fast result. - Keep
CpuInfodeprecated behavior stable for existing callers. - Register and unregister
SystemInfopressure callbacks safely when the API is missing. - Keep JSDoc complete where ESLint requires it.
- Verify documentation claims against source, tests, and configuration.
- Do not add secrets, private URLs, real user-agent captures, or local absolute paths.