| name | review-solution |
| description | Review the user's solution to a java-mastery exercise like a senior engineer / interviewer — run the tests, grade correctness, style, complexity, and idiomatic Java, then suggest improvements. Use after the user says they finished an exercise or module. |
Skill: review-solution
Give interview-grade feedback on code the user implemented themselves.
Input
$ARGUMENTS = a module name, package, class, or file path (e.g. m01_fundamentals,
FizzBuzz). If empty, review the most recently modified exercise under src/main.
Steps
- Locate the exercise class(es) and their tests.
- Run the relevant tests:
mvn -Dtest=<TestClass> test (or mvn test for a whole module).
Report green/red clearly with the actual output.
- Read the implementation and review it on these axes:
- Correctness: do all tests pass? Any missed edge cases the tests don't cover?
- Time & space complexity: state the Big-O; is there a better one?
- Idiomatic Java: streams vs loops,
Optional, immutability, StringBuilder,
proper equals/hashCode, modern syntax (records, switch expressions) where it fits.
- Readability & naming: clean code, SOLID where relevant.
- Bugs & risks: null handling, integer overflow, off-by-one, locale issues.
- Deliver feedback as:
- ✅ What was done well (be specific).
- 🔧 Concrete improvements, ranked by impact, with short code snippets.
- 🎯 A grade out of 10 and what a staff-level version would add.
- ❓ 1–2 follow-up questions an interviewer would ask about this code.
- Offer to update the progress tracker (root
README.md) to ✅ if all tests are green.
Be honest and rigorous — the goal is monster-level, not encouragement for its own sake.