code-review

Review dimtensor code for correctness, dimensional safety, and adherence to patterns. Use when reviewing new code or during consolidation phases.

⭐2stars🔀0forks📁View on GitHub🕐Updated Jan 10, 2026

When & Why to Use This Skill

This Claude skill automates the technical review process for the dimtensor library, ensuring high-standard code quality through rigorous checks on dimensional safety, mathematical correctness, and architectural patterns. It streamlines the development workflow by identifying potential bugs in unit conversions, edge case handling, and adherence to internal coding standards, making it an essential tool for maintaining robust scientific computing codebases.

Use Cases

  • Automated Pull Request Audits: Use the skill to automatically review new code submissions for dimensional consistency and compliance with the dimtensor core patterns before merging.
  • Dimensional Integrity Verification: Ensure that complex mathematical operations (like power operations or transcendental functions) correctly handle unit exponents and dimensionless requirements.
  • Edge Case & Robustness Testing: Identify missing error handling for scenarios such as division by zero, null inputs, or infinite values in tensor calculations.
  • Scientific Standard Compliance: Verify that scale factors and physical constants used in the code align with authoritative sources like CODATA or IAU.
  • Refactoring & Consolidation: During codebase cleanup, use the skill to ensure that refactored functions maintain immutability and proper type hinting as defined in the project's style guide.
namecode-review
descriptionReview dimtensor code for correctness, dimensional safety, and adherence to patterns. Use when reviewing new code or during consolidation phases.
allowed-toolsRead, Grep, Glob

Code Review Skill

Review checklist for dimtensor code.

Review Checklist

Dimensional Correctness (CRITICAL)

  • Addition/subtraction requires same dimension
  • Multiplication/division correctly combines dimensions
  • Power operations handle dimension exponents correctly
  • Transcendental functions (sin, exp, log) require dimensionless input
  • sqrt halves dimension exponents

Edge Cases

  • Empty arrays handled
  • Scalar values handled
  • Zero values (division by zero)
  • None/null inputs
  • inf/nan values
  • Very large/small scale factors

Error Handling

  • Raises DimensionError for incompatible operations
  • Raises UnitConversionError for impossible conversions
  • Error messages are helpful (show dimensions involved)

Code Patterns

  • Uses DimArray._from_data_and_unit(data, unit) internally
  • Operations return new instances (immutable)
  • Follows patterns from core/dimarray.py
  • Type hints on public functions
  • Docstrings on public functions

Scale Factors

  • Uses authoritative values (CODATA, IAU, IUPAC)
  • Scientific notation for large/small values
  • Source documented in comments

Test Coverage

  • Happy path tests exist
  • Edge case tests exist
  • Error case tests exist
  • Conversion accuracy tests with tolerances

Review Output Format

### File: `path/to/file.py`
**Reviewed by**: agent
**Status**: APPROVED / ISSUES FOUND / NEEDS CHANGES

**Issues Found**:
1. [CRITICAL] Description...
2. [IMPORTANT] Description...
3. [MINOR] Description...

**Recommendations**:
- Suggestion 1
- Suggestion 2

After Review

Update CONTINUITY.md:

  • Add review findings to CODE REVIEW FINDINGS section
  • Mark review task as DONE in TASK QUEUE
  • Add session log entry