Isurwars/Correlation / .agents/skills/code-review
code-review
VerifiedComprehensive pre-commit and pre-merge code review checklist. Use when the user asks to "review code", "check changes", or before committing critical features.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.0 KB |
SKILL.md
View on GitHub---
name: code-review
description: Comprehensive pre-commit and pre-merge code review checklist. Use when the user asks to "review code", "check changes", or before committing critical features.
---
# Code Review
Rigorous technical audit before staging, committing, or merging changes in `Correlation`. Ensures zero regressions in C++23 standards, thread safety, cognitive complexity, and build integrity.
## Phase 1: Context & Diff Inspection
1. **Inspect Working Tree & Diff:**
```bash
git diff --stat
git diff -U3
```
2. **Classify Affected Subsystems:**
- **Calculators / Math:** (`src/calculators/`, `include/calculators/`)
- **Core & Domain:** (`include/core/`, `src/core/`)
- **UI & ViewModels:** (`ui/`, `src/app/`, `include/app/`)
- **Build & Bindings:** (`CMakeLists.txt`, `cmake/`, `src/bindings/`)
## Phase 2: Quality Gates Audit
| Gate | Check | Command / Verification | Pass Criteria |
| :--- | :--- | :--- | :--- |
| **1. Compilation** | Strict compiler & conversion flags | `cmake --build build -j$(nproc)` | 0 warnings/errors with `-Wall -Wextra -Wpedantic -Werror=float-conversion -Werror=implicit-float-conversion -Werror=shorten-64-to-32` (`/we4244 /we4267 /we4305` on MSVC). |
| **2. Clang-Tidy** | Static analysis & narrowing | `clang-tidy -p build <modified_files>` | 0 warnings/errors (`bugprone-narrowing-conversions`, `clang-diagnostic-float-conversion`, `clang-diagnostic-shorten-64-to-32`). **Zero** `NOLINT` comments allowed. |
| **3. Complexity** | Cognitive complexity threshold | `clang-tidy -checks="readability-function-cognitive-complexity"` | Cognitive complexity $\le 25$ per function. |
| **4. SOLID Architecture** | SRP, OCP, LSP, ISP, DIP & Zero-cost | Architectural inspection | Clean separation of concerns, no virtual calls in hot loops, concepts for math, DI at boundaries (see [solid-design](file:///home/isurwars/Projects/Correlation/.agents/skills/solid-design/SKILL.md)). |
| **5. Concurrency** | Thread safety & alignment | Code inspection | No shared mutable state without lock/reduction; `alignas(64)` on thread-local accumulators. |
| **6. RAII & Ownership** | Memory safety | Code inspection | No raw `new`/`delete`; proper use of `std::span`, `std::unique_ptr`, `std::shared_ptr`. |
| **7. Documentation** | Doxygen completeness | Check public headers | `@param`, `@return`, `@throws` present on all public API methods. |
| **8. Testing** | Unit & Functional tests | `ctest --test-dir build --output-on-failure` | 100% passing tests across all test suites. |
## Phase 3: Diagnostic Output
Present review findings using the strict diagnostic format:
```
[File:Line] -> [Error Category] -> [Root Cause] -> [Fix Action]
```
### Review Decision Verdict
Conclude the review with one of three explicit states:
- **LGTM (Ready to Commit):** All gates pass, zero issues.
- **NEEDS WORK:** Minor warnings or styling/doc issues that must be remediated.
- **BLOCKED:** Critical defects (compilation error, thread race, memory leak, complexity $> 25$).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |