Agent skill
code-review
Review Julia code for correctness, performance, numerical stability, AD compatibility, and maintainability. Use when reviewing pull requests, examining code changes, auditing performance, or when the user asks for a code review.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/code-review-hammerhead-space-agenticcodingrules
SKILL.md
Code Review
Purpose
Review code for correctness, performance, and maintainability with attention to the specific concerns of scientific/numerical Julia code.
Review Checklist
Correctness
- Logic is correct and handles edge cases (singularities, zero vectors, degenerate orbits)
- Numerical stability: no catastrophic cancellation, overflow, or division by near-zero
- Units are consistent (km, km/s, radians) and conversions are correct
- Frame conventions are respected (J2000 ECI, ECEF, body-fixed)
- Mathematical formulation matches cited reference (paper, textbook)
Performance
- Hot-path functions return
SVector/SMatrix, not heap-allocated arrays - No unnecessary allocations (verify with
@check_allocsor@allocated) -
@inlineon performance-critical functions - No type instabilities (
@code_warntypeclean) - Promotion via
promote_typerather than implicit conversion
AD Compatibility
- No mutation of arrays that AD needs to track (return new values instead)
- No branching on floating-point values in differentiable paths
- Uses
promote_type(T, V)for mixed numeric types - Safe handling of norm-near-zero (no NaN gradients)
- Tested with ForwardDiff at minimum; ideally multiple backends
Style & Maintainability
-
using/importonly in module file orruntests.jl, not ininclude-d files -
exportat the top of the file where symbols are defined - Packages added via Pkg.jl, not by editing Project.toml directly
- Docstrings with
# Arguments,# Returns,# References - Functions are focused (single responsibility)
- Consistent naming: PascalCase types, snake_case functions, Unicode for physics
Testing
- Correctness tests against known reference values
- Edge cases tested (circular, equatorial, hyperbolic, near-singularity)
- AD tests comparing against FiniteDiff
- Allocation tests on hot-path functions
Feedback Format
Categorize each finding:
- Critical: Must fix -- correctness bug, numerical instability, or silent wrong answer
- Performance: Allocation, type instability, or avoidable overhead
- Suggestion: Improvement to clarity, style, or maintainability
- Nitpick: Minor style preference, optional
For each finding, provide:
- The specific location (file and line)
- What the issue is
- A concrete fix or alternative
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?