Code Reviewer
Comprehensive code review analysis covering quality, security, and performance with Python/fastMONAI specialization.
When to Use
Proactively activate this skill when:
- Reviewing code changes before commit
- Analyzing new implementations or features
- Detecting potential issues in modified files
- Asked to assess code quality or find problems
- Completing significant code writing tasks (self-review)
Review Process
1. Understand Context First
Before reviewing, establish:
- Purpose of the code (feature, bugfix, refactor)
- Integration points with existing codebase
- Criticality level (production, research, prototype)
2. Apply Review Layers
Review code through three lenses, in order of priority:
Layer 1: Code Quality
- Readability: Clear naming, appropriate comments, logical organization
- Maintainability: Single responsibility, DRY principles, appropriate abstraction level
- Correctness: Logic errors, edge cases, error handling
- Style: PEP 8 compliance, consistent formatting, idiomatic Python
Layer 2: Security
- Input validation: Untrusted data handling, injection risks
- Data exposure: Sensitive data logging, hardcoded secrets
- Resource safety: File operations, network calls, subprocess usage
- Dependencies: Known vulnerabilities, version pinning
Layer 3: Performance
- Algorithmic efficiency: Time/space complexity, unnecessary iterations
- Memory management: Large object handling, memory leaks in loops
- I/O optimization: Batch operations, caching opportunities
- Medical imaging specific: Tensor operations, GPU memory, large volume handling
3. fastMONAI/nbdev Specific Checks
When reviewing fastMONAI code:
- Verify changes are in
.ipynb notebooks, not .py files directly
- Check
#| export directives are correct
- Ensure
#| notest is used appropriately for expensive operations
- Validate padding_mode=0 usage with TorchIO CropOrPad
- Confirm preprocessing consistency between training and inference
- Check MedImage/MedMask type usage for medical data
Reference references/python-patterns.md for detailed Python anti-patterns and best practices.
Output Format Guidelines
Adapt output based on context:
For Small Changes (< 50 lines)
Use inline format with line references:
[file.py:42](file.py#L42) - Issue: Variable `x` shadows outer scope
[file.py:55-60](file.py#L55-L60) - Suggestion: Extract to helper function
For Large Changes or Full Reviews
Use structured report:
## Review Summary
Brief overview of findings
## Critical Issues
Must-fix problems (security, correctness)
## Improvements
Recommended changes (quality, performance)
## Positive Observations
Well-implemented patterns worth noting
## Questions
Clarifications needed from author
For Self-Review (after writing code)
Brief checklist verification:
- Tested edge cases
- Error handling complete
- No obvious security issues
- Performance acceptable
Severity Classification
- Critical: Security vulnerabilities, data loss risks, crash bugs
- High: Logic errors, significant performance issues, maintainability blockers
- Medium: Code smell, minor inefficiencies, style inconsistencies
- Low: Nitpicks, optional improvements, documentation gaps
Review Tone
- Be constructive, not critical
- Explain the "why" behind suggestions
- Acknowledge good patterns alongside issues
- Provide concrete fix suggestions when possible
- Ask questions rather than assume intent
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: mmiv-ml-fastmonai-code-reviewer3description: Code Reviewer4---56# Code Reviewer78Comprehensive code review analysis covering quality, security, and performance with Python/fastMONAI specialization.910## When to Use1112Proactively activate this skill when:13- Reviewing code changes before commit14- Analyzing new implementations or features15- Detecting potential issues in modified files16- Asked to assess code quality or find problems17- Completing significant code writing tasks (self-review)1819## Review Process2021### 1. Understand Context First2223Before reviewing, establish:24- Purpose of the code (feature, bugfix, refactor)25- Integration points with existing codebase26- Criticality level (production, research, prototype)2728### 2. Apply Review Layers2930Review code through three lenses, in order of priority:3132#### Layer 1: Code Quality33- **Readability**: Clear naming, appropriate comments, logical organization34- **Maintainability**: Single responsibility, DRY principles, appropriate abstraction level35- **Correctness**: Logic errors, edge cases, error handling36- **Style**: PEP 8 compliance, consistent formatting, idiomatic Python3738#### Layer 2: Security39- **Input validation**: Untrusted data handling, injection risks40- **Data exposure**: Sensitive data logging, hardcoded secrets41- **Resource safety**: File operations, network calls, subprocess usage42- **Dependencies**: Known vulnerabilities, version pinning4344#### Layer 3: Performance45- **Algorithmic efficiency**: Time/space complexity, unnecessary iterations46- **Memory management**: Large object handling, memory leaks in loops47- **I/O optimization**: Batch operations, caching opportunities48- **Medical imaging specific**: Tensor operations, GPU memory, large volume handling4950### 3. fastMONAI/nbdev Specific Checks5152When reviewing fastMONAI code:53- Verify changes are in `.ipynb` notebooks, not `.py` files directly54- Check `#| export` directives are correct55- Ensure `#| notest` is used appropriately for expensive operations56- Validate padding_mode=0 usage with TorchIO CropOrPad57- Confirm preprocessing consistency between training and inference58- Check MedImage/MedMask type usage for medical data5960Reference `references/python-patterns.md` for detailed Python anti-patterns and best practices.6162## Output Format Guidelines6364Adapt output based on context:6566### For Small Changes (< 50 lines)67Use inline format with line references:68```69[file.py:42](file.py#L42) - Issue: Variable `x` shadows outer scope70[file.py:55-60](file.py#L55-L60) - Suggestion: Extract to helper function71```7273### For Large Changes or Full Reviews74Use structured report:75```markdown76## Review Summary77Brief overview of findings7879## Critical Issues80Must-fix problems (security, correctness)8182## Improvements83Recommended changes (quality, performance)8485## Positive Observations86Well-implemented patterns worth noting8788## Questions89Clarifications needed from author90```9192### For Self-Review (after writing code)93Brief checklist verification:94- Tested edge cases95- Error handling complete96- No obvious security issues97- Performance acceptable9899## Severity Classification100101- **Critical**: Security vulnerabilities, data loss risks, crash bugs102- **High**: Logic errors, significant performance issues, maintainability blockers103- **Medium**: Code smell, minor inefficiencies, style inconsistencies104- **Low**: Nitpicks, optional improvements, documentation gaps105106## Review Tone107108- Be constructive, not critical109- Explain the "why" behind suggestions110- Acknowledge good patterns alongside issues111- Provide concrete fix suggestions when possible112- Ask questions rather than assume intent113114---115> Converted and distributed by [TomeVault](https://tomevault.io/claim/mmiv-ml) — claim your Tome and manage your conversions.116<!-- tomevault:4.0:skill_md:2026-04-11 -->