Skip to content

Commit e56dc74

Browse files
committed
Add Claude to Code Reviews
1 parent 014c05b commit e56dc74

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Claude Code Review
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
6+
jobs:
7+
review:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Run Claude Code Review
17+
uses: anthropics/claude-code-action@beta
18+
with:
19+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
20+
prompt: |
21+
Review this PR for potential bugs, security issues,
22+
and adherence to our coding standards.

CLAUDE.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# CLAUDE.md - Code Review Guidelines
2+
3+
## Repository Purpose
4+
This repository contains LeetCode problem solutions for learning and practicing algorithmic problem-solving. Solutions are primarily written in JavaScript/TypeScript.
5+
6+
## Code Review Focus
7+
8+
### 1. Algorithm Correctness
9+
- Verify the solution correctly solves the problem for all test cases
10+
- Check for edge cases: empty arrays, single elements, negative numbers, null values
11+
- Confirm the solution handles constraints mentioned in the problem
12+
13+
### 2. Time & Space Complexity
14+
- Always analyze and comment on time complexity (Big O notation)
15+
- Always analyze and comment on space complexity
16+
- Suggest optimizations if a more efficient approach exists
17+
- Compare to optimal solutions when applicable
18+
19+
### 3. Code Quality
20+
- Use clear, descriptive variable names (not just `i`, `j`, `k` unless in simple loops)
21+
- Add comments for non-obvious logic or algorithm steps
22+
- Keep functions focused and single-purpose
23+
- Prefer readability over cleverness
24+
25+
### 4. JavaScript/TypeScript Best Practices
26+
- Use `const` by default, `let` only when reassignment needed
27+
- Avoid `var`
28+
- Use modern ES6+ syntax (arrow functions, destructuring, spread operators)
29+
- Prefer built-in methods (`.map()`, `.filter()`, `.reduce()`) when appropriate
30+
- Use strict equality (`===`) over loose equality (`==`)
31+
32+
### 5. Problem-Specific Patterns
33+
When reviewing graph problems:
34+
- Verify proper graph representation (adjacency list/matrix)
35+
- Check for visited tracking to avoid cycles
36+
- Confirm DFS/BFS implementation follows standard patterns
37+
- Look for Union-Find correctness if applicable
38+
39+
When reviewing array/string problems:
40+
- Check for two-pointer technique correctness
41+
- Verify sliding window boundaries
42+
- Confirm hash map usage is optimal
43+
44+
### 6. README Requirements
45+
Each problem solution should include:
46+
- Problem description or link to LeetCode problem
47+
- Approach explanation
48+
- Time and space complexity analysis
49+
- Any key insights or learnings
50+
51+
## What NOT to Flag
52+
- Multiple solution approaches (exploratory learning is encouraged)
53+
- Console.log statements (used for debugging/learning)
54+
- Less optimal solutions if clearly marked as alternative approaches
55+
56+
## Tone
57+
Keep feedback constructive and educational. This is a learning repository, so explain *why* something could be improved, not just *what* to change.

0 commit comments

Comments
 (0)