Comprehensive code reviewer for Java and Python implementations focusing on correctness, efficiency, code quality, and algorithmic optimization. Reviews LeetCode solutions, data structures, and algorithm implementations. Use when reviewing code, checking solutions, or providing feedback on implementations.
Use this Skill when:
Check for:
Common edge cases:
[], ""null, None[1], "a"[1,1,1][-1, -5]Analyze and verify:
Provide:
Current: O(n²) time, O(1) space
Optimal: O(n) time, O(n) space using HashMap
Trade-off: Use extra space for better time complexity
Complexity Reference:
Java Best Practices:
ArrayList, HashMap, HashSet)List<Integer> not raw types)List<> not ArrayList<>)Java Anti-patterns to flag:
// Bad: Raw types
ArrayList list = new ArrayList();
// Good: Generics
List<Integer> list = new ArrayList<>();
// Bad: Manual array copying
for (int i = 0; i < arr.length; i++) { ... }
// Good: Built-in methods
Arrays.copyOf(arr, arr.length);
// Bad: String concatenation in loop
String s = "";
for (String str : list) { s += str; }
// Good: StringBuilder
StringBuilder sb = new StringBuilder();
for (String str : list) { sb.append(str); }
Check for:
long when neededPython Best Practices:
set, dict, deque)Python Anti-patterns to flag:
# Bad: Manual index tracking
for i in range(len(arr)):
print(i, arr[i])
# Good: enumerate
for i, val in enumerate(arr):
print(i, val)
# Bad: Building list with append in loop
result = []
for x in arr:
result.append(x * 2)
# Good: List comprehension
result = [x * 2 for x in arr]
# Bad: Multiple membership checks
if x == 'a' or x == 'b' or x == 'c':
# Good: Use set or tuple
if x in {'a', 'b', 'c'}:
Check for:
collections.defaultdict, Counter)None checksSuggest improvements for:
Pattern Recognition:
When comparing implementations:
Java strengths:
Python strengths:
Flag inconsistencies:
Structure your review as:
## Correctness: ✓ Pass / ⚠ Issues Found
[List any correctness issues]
## Complexity Analysis
- Time: O(?) - [Explain]
- Space: O(?) - [Explain]
- Optimal: [If current solution is not optimal]
## Code Quality
**Strengths:**
- [List positive aspects]
**Issues:**
- [Issue 1] at line X: [Explanation]
- [Issue 2] at line Y: [Explanation]
**Suggestions:**
- [Suggestion 1]: [Why it's better]
- [Suggestion 2]: [Why it's better]
## Overall Assessment
[Summary and recommendation]
Before completing review:
// Code under review
public int[] twoSum(int[] nums, int target) {
for (int i = 0; i < nums.length; i++) {
for (int j = i + 1; j < nums.length; j++) {
if (nums[i] + nums[j] == target) {
return new int[]{i, j};
}
}
}
return new int[]{};
}
Review:
Optimized:
public int[] twoSum(int[] nums, int target) {
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
int complement = target - nums[i];
if (map.containsKey(complement)) {
return new int[]{map.get(complement), i};
}
map.put(nums[i], i);
}
return new int[]{};
}
leetcode_java/ and leetcode_python/algorithm/ and data_structure/doc/ for analysisnpx skills add yennanliu/java-python-code-reviewer下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer