Skip to content

Isurwars/Correlation / .agents/skills/code-review

code-review

Verified

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:
    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

GateCheckCommand / VerificationPass Criteria
1. CompilationStrict compiler & conversion flagscmake --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-TidyStatic analysis & narrowingclang-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. ComplexityCognitive complexity thresholdclang-tidy -checks="readability-function-cognitive-complexity"Cognitive complexity $\le 25$ per function.
4. SOLID ArchitectureSRP, OCP, LSP, ISP, DIP & Zero-costArchitectural inspectionClean separation of concerns, no virtual calls in hot loops, concepts for math, DI at boundaries (see solid-design).
5. ConcurrencyThread safety & alignmentCode inspectionNo shared mutable state without lock/reduction; alignas(64) on thread-local accumulators.
6. RAII & OwnershipMemory safetyCode inspectionNo raw new/delete; proper use of std::span, std::unique_ptr, std::shared_ptr.
7. DocumentationDoxygen completenessCheck public headers@param, @return, @throws present on all public API methods.
8. TestingUnit & Functional testsctest --test-dir build --output-on-failure100% 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$).
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 implementationStars: 318kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 318kUpdated Claude CodeCodexVerifiedInstall
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 fallbackStars: 318kUpdated Claude CodeCodexVerifiedInstall
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 alwaysStars: 318kUpdated Claude CodeCodexVerifiedInstall