What problem does it solve? AscendC operator kernels for Ascend NPU hardware are prone to structural defects (division by zero, buffer overruns, null pointer dereferences, overflow) and algorithm-level gaps (broken normalization chains, unconsumed reduction results) that cause crashes or silent data corruption. This Skill automates a five-phase review workflow that detects, prioritizes, fixes, and verifies these issues before evaluation. ## Core Features & Use Cases - API Compliance Precheck: Dynamically derives grep patterns from api-dispatch.json to scan kernel code against a blacklist (e.g., GlobalTensor::SetValue, raw DataCopy) and dispatch best-practice reference docs only for APIs actually used. - Structural Red-Line Review: Scans op_kernel and op_host code for 7 mandatory red lines (division-by-zero, bounds, overflow, initialization, null pointers, resource matching, data races) plus TopN issues like stdlib math bans, PipeBarrier namespace errors, and tiling field mismatches, outputting JSON and Markdown reports with P0–P3 severity. - Algorithm Correctness Check: Verifies normalization-chain completeness, denominator safety invariants, iterative update completeness, and reduction result consumption. - Fix and Verify Pipeline: Applies standard repair patterns in P0→P3 priority order, generates rectification reports, then runs compile → UT → ST three-layer verification. - Use Case: After lowering a DSL operator to AscendC, run the full workflow on the operator directory to receive a rectification report, patched source code, and a verification report confirming 100% compile/UT/ST pass rates. ## Quick Start Use cake-code-review to check the operator at output/my_operator and fix any red-line violations it finds.