ta-training

Code Review

Goals

Process

Reviewing with /clinic-pr-review

Review student pull requests using the /clinic-pr-review Claude skill. The skill runs the code and checks it against clinic standards. Review the skill’s output, verify its findings, and leave the review on the pull request yourself. The skill is meant to assist you in reviewing the code, not to replace you.

  1. Run the skill on the student’s PR. It will be installed from dsi-rse/skills.
  2. Verify findings: check each one yourself.
  3. Write your review: short, specific, human.
  4. Follow up: check that the student responded to your previous review comments.

Don’t paste the skill’s output into the PR. A Claude report is usually too detailed, and the giant block of markdown gets in the way of the more-important human comments. If you include Claude output, hide it in <details> … </details>.

Use the skill if and when you find it useful. Sometimes a manual review without Claude assistance may be easier.

Core Review Principles

Enforce, Don’t Code

Be Specific and Educational

Progress Over Perfection

Reviewer Checklist

Scope and Structure

Data and Error Handling

Code Organization

Dependencies and Environment

Security and Configuration

Code Quality

Style and Professional Practices

Common Review Scenarios

What to Look For

How to Give Feedback

Ask Questions

Suggest Alternatives

Explain Benefits

Celebrate Improvements

Sample Review Comments

Poor Feedback

Effective Feedback

The Review Feedback Loop

Student Code → TA Review → Student Revision → Final Approval

Keys to Effective Feedback

Managing the Process

Vibecoded UIs

Review Timing

Priority Framework

Critical (Must Fix)

  1. Security issues: Committed secrets, exposed credentials
  2. Reproducibility blockers: Missing Docker files, hardcoded paths
  3. Data correctness: Missing validation, improper error handling

Important (Address Soon)

  1. I/O separation: Mixed computation and file operations
  2. Type hints: On public functions and unclear parameters
  3. Configuration management: Hardcoded values, missing .env.example

Nice to Have (Follow-up)

  1. Documentation: Docstrings and README improvements
  2. Code organization: Function names, file structure
  3. Performance: Obvious inefficiencies in large data processing

Technical Focus Areas

Python Best Practices

Data Validation & Types

Environment & Dependencies

Configuration Management

When to Escalate

Escalate early rather than absorbing the problem yourself. See the clinic’s escalation guide.

To Technical Advisor…

Via the mentor-TA Slack channel.

If a student can’t get their computer set up for a week, that’s already ~12% of work time wasted.

To Project Mentor…

The mentor will likely escalate to the clinic director.

Pattern-Based Escalation

Effective Escalation

Examples and Practice

Practice Exercise

Review this function and identify issues:

def process_survey_data():
    data = pd.read_csv('/Users/alice/Documents/clinic/survey_data.csv')
    
    print("Data loaded successfully!")
    
    # Remove invalid responses
    clean_data = data[data['satisfaction_score'] > 0]
    
    # Calculate statistics  
    avg = clean_data['satisfaction_score'].mean()
    dept_stats = clean_data.groupby('department')['satisfaction_score'].mean()
    
    # Save results
    results = {'overall_avg': avg, 'dept_averages': dept_stats.to_dict()}
    
    with open('analysis_results.json', 'w') as f:
        json.dump(results, f)
    
    print(f"Analysis complete! Average satisfaction: {avg}")
    return results

Discussion Questions

Remember: Building Professional Data Scientists

Every code review, every standard enforced, every coaching conversation shapes how students will approach data science throughout their careers. The habits they learn here will serve them for years to come.

Focus on developing student capabilities, not just delivering perfect code. Your role is to guide, teach, and model professional practices that will make students better collaborators and contributors in their future careers.