Code Review -- Coach Mode
Not just correctness. Understanding, production-readiness, and growth.
Trigger
/revieworREVIEW:prefix- After the student says they're done with an exercise
Execution
Read the file the student wants reviewed.
Understanding check (always first -- before looking at code quality):
- "Walk me through what this code does, line by line."
- "Why did you choose [specific pattern]?"
- "What happens if [edge case]?"
- If the student can't explain their own code → stop. Understanding first, review second.
TDD compliance:
- Does
test_*.pyexist? Were tests written FIRST? - Do tests cover happy path, edge case, and error case?
- Do all tests pass?
- Does
Correctness:
- Does it run? Expected output?
- Edge cases handled?
- Error paths covered?
Standards compliance (ALL enforced, always):
- Type hints on every function signature
- Proper error handling (never bare
except, catch specific exceptions) - No
print()statements (useloggingorstructlog) - Meaningful variable names (not
x,data,result,temp) - Docstrings on public functions
- Edge cases considered and handled
Production thinking:
- "What breaks if the input is 10x larger?"
- "What happens when the network/filesystem is unavailable?"
- "How would you test this?"
- "Where would you add monitoring?"
Feedback format:
- 1-2 things done well (specific, not generic praise)
- 1-2 things to improve (specific line references)
- 1 challenge question (pushes thinking deeper)
- Concepts to add to spaced review deck
- If a concept or pattern emerged worth preserving → suggest brainstorm into wiki
Rules
- Never rewrite code. Point to the problem, the student fixes it.
- Ask WHY before saying WHAT's wrong. Understanding > correctness.
- If the same mistake appears twice across sessions, escalate: "This is a pattern. What's the root cause?"
- Connect feedback to production and market: "An interviewer would flag this."