Automated Code Reviewer
Automated Code Reviewer
The Automated Code Reviewer is a specialized agent designed to act as a high-seniority peer, ensuring every line of code meets your team's specific architectural and quality standards before it reaches a human reviewer. By leveraging the .claude/agents/code-reviewer.md configuration, Claude can perform deep inspections that go far beyond what static analysis tools like ESLint can detect.
Core Review Pillars
The reviewer agent is configured to prioritize three critical areas of the codebase:
1. TypeScript Strict Mode & Type Safety
The agent enforces high-fidelity typing across the repository. It doesn't just check for syntax; it ensures your types reflect the actual domain logic.
- Strict Mode Compliance: Blocks the use of
anyand ensures proper null/undefined handling. - Inference vs. Explicit Typing: Encourages explicit return types on public APIs and interfaces for shared state.
- Pattern Matching: Validates that new types follow the established naming conventions (e.g.,
TProps,IResult).
2. Robust Error Handling
Instead of generic try/catch blocks, the reviewer ensures error handling follows the project's specific mutation patterns.
- Graceful Failures: Checks that UI-bound actions provide meaningful feedback to the user rather than failing silently.
- Consistency: Ensures that errors in services are caught, logged, and re-thrown or handled according to the
testing-patternsskill.
3. Loading State Patterns
To maintain a consistent UX, the agent verifies that all asynchronous operations implement the standard loading state patterns.
- State Coverage: Ensures that components account for
idle,loading,success, anderrorstates. - Skeleton/Spinner Consistency: Checks that the correct UI components are used for loading indicators based on the directory (e.g., different patterns for
screens/vs.components/).
Usage
You can invoke the code reviewer manually during development or automate it as part of your CI pipeline.
Manual Review
To have Claude review your current changes before committing:
# Ask the specialized code reviewer agent to look at your staged changes
claude "Run a deep review on my current changes using the code-reviewer agent"
GitHub Actions Integration
For automated quality gates, the reviewer is integrated into the PR workflow via .github/workflows/pr-claude-code-review.yml. Every time a Pull Request is opened or updated, the agent:
- Analyzes the diff.
- Evaluates the context using the
skill-eval.jshook. - Leaves comments on specific lines regarding logic flaws or pattern deviations.
- Provides a summary of the review against the project's core checklist.
Configuration
The reviewer’s logic is governed by a Markdown-based instruction set in .claude/agents/code-reviewer.md. You can customize the review criteria by updating the checklist in that file:
# Code Reviewer Agent Checklist
- [ ] Ensure all new components use the React.memo() wrapper where performance-critical.
- [ ] Verify that Zod schemas are used for all API response validation.
- [ ] Check that `useContext` is not overused in favor of local state where possible.
By keeping this checklist in your repository, you ensure that Claude’s "eye for detail" evolves alongside your codebase.