Review Julia Scripts
Run the comprehensive Julia code review protocol.
Steps
- •
Identify scripts to review:
- •If an argument is a specific
.jlfilename: review that file only - •If the argument is
all: review all Julia scripts incode/
- •If an argument is a specific
- •
For each script, follow the review protocol below.
- •Read
code/AGENTS.md(or.claude/rules/julia-code-conventions.md) for current standards - •Save report to
quality_reports/[script_name]_julia_review.md
- •Read
- •
After all reviews complete, present a summary:
- •Total issues found per script
- •Breakdown by severity (Critical / High / Medium / Low)
- •Top 3 most critical issues
- •
IMPORTANT: Do NOT edit any Julia source files. Only produce reports. Fixes are applied after user review.
Review Protocol
You are a Senior Principal Computational Scientist (HPC/Big Tech caliber) who also holds a PhD with deep expertise in quantitative methods and numerical computing.
Review Categories
1. SCRIPT STRUCTURE & HEADER
- • Header block present with: title, author, purpose, inputs, outputs
- • Numbered top-level sections
- • Logical flow: setup -> data load -> computation -> process results -> export
2. CONSOLE OUTPUT HYGIENE
- •
@info/@warn/@errorfromLoggingused sparingly - • No
println(),print(),@printffor status/progress
3. REPRODUCIBILITY
- •
Random.seed!()called ONCE at top (never inside loops/functions) - • All dependencies loaded at top via
using/import - • All paths relative via
joinpath() - • No hardcoded absolute paths
4. FUNCTION DESIGN & DOCUMENTATION
- •
snake_casefunctions,CamelCasetypes - • Verb-noun pattern
- • Triple-quoted docstrings with signature, arguments, return type
- • Default parameters, no magic numbers
- • Return
NamedTupleor customstruct(not bare tuples)
5. DOMAIN CORRECTNESS
- • Estimator/simulation implementations match paper formulas
- • Float64 precision adequate for the computation
- • Algorithm matches paper description
6. DATA PERSISTENCE
- • Every computed object has a corresponding
jldsave()orserialize()call - • JLD2 filenames are descriptive
- • Results saved as CSV for model output
- • File paths use
joinpath()
7. COMMENT QUALITY
- • Comments explain WHY, not WHAT
- • No commented-out dead code
8. ERROR HANDLING & EDGE CASES
- • Results checked for
NaN/Inf/missing/nothing - •
try/catchfor external I/O or numerical failures
9. PROFESSIONAL POLISH
- • Consistent indentation (4 spaces)
- • Lines under 92 characters (mathematical exceptions allowed)
- •
eachindex(x)instead of1:length(x) - • Unicode Greek letters for variable names
10. TYPE STABILITY & PERFORMANCE
- • Hot functions verified with
@code_warntype - • Struct fields have concrete types
- • Module-level constants declared with
const - •
@viewson array slices in loops - • Output arrays pre-allocated when size is known
11. MULTIPLE DISPATCH
- • Dispatch on types preferred over if/elseif chains on type tags
- • Shallow type hierarchies
12. BROADCASTING & FUSION
- •
@.macro used for multi-operation expressions - • No manual loops replacing broadcastable operations
Report Format
Save report to quality_reports/[script_name]_julia_review.md:
markdown
# Julia Code Review: [script_name].jl **Date:** [YYYY-MM-DD] **Reviewer:** review-julia skill ## Summary - **Total issues:** N - **Critical:** N | **High:** N | **Medium:** N | **Low:** N ## Issues ### Issue 1: [Brief title] - **File:** `[path/to/file.jl]:[line_number]` - **Category:** [Structure / Console / Reproducibility / Functions / Domain / Persistence / Comments / Errors / Polish / TypeStability / Dispatch / Broadcasting] - **Severity:** [Critical / High / Medium / Low] - **Current:** [code snippet] - **Proposed fix:** [corrected code snippet] - **Rationale:** [Why this matters] ## Checklist Summary | Category | Pass | Issues | |----------|------|--------| | Structure & Header | Yes/No | N | | Console Output | Yes/No | N | | Reproducibility | Yes/No | N | | Functions | Yes/No | N | | Domain Correctness | Yes/No | N | | Data Persistence | Yes/No | N | | Comments | Yes/No | N | | Error Handling | Yes/No | N | | Polish | Yes/No | N | | Type Stability | Yes/No | N | | Multiple Dispatch | Yes/No | N | | Broadcasting | Yes/No | N |
Important Rules
- •NEVER edit source files. Report only.
- •Be specific. Include line numbers and exact code snippets.
- •Be actionable. Every issue must have a concrete proposed fix.
- •Prioritize correctness. Domain bugs > performance > style issues.