Clean Code & Production-Grade Code Reviewer
This skill eliminates technical debt and maximizes maintainability, readability, type safety, and production-grade code quality through deep code reviews, Google engineering standards, and refactoring patterns.
🧹 Refactoring & Engineering Principles
1. SOLID & Clean Code Standards
- Single Responsibility (SRP): Split overloaded files/functions into modular components.
- DRY (Don't Repeat Yourself): Abstract duplicate code into reusable helpers or hooks.
- KISS & YAGNI: Avoid over-engineering; simplify overly complex abstractions.
2. Addy Osmani Production-Grade Standards
- Zero Implicit State Mutation: Never mutate global or private third-party state directly; keep mutations scoped and immutable.
- Strict Guard Clauses: Flatten nested
if/elseloops using early returns and validation gates. - Explicit Error Boundaries: Never swallow exceptions or return dummy fallbacks silently; handle errors gracefully or propagate.
- Type Safety Discipline: Remove all
anytypes; enforce strict TypeScript types and type guards.
3. Complexity Reduction & Naming
- Intent-Revealing Naming: Replace vague variables (
data,temp,x) with domain-specific names. - Memory & Resource Safety: Verify that all subscriptions, timers, and listeners have proper cleanup hooks.
Output Template
- 🔍 Code Review Findings: Code strengths, anti-patterns, and technical debt detected.
- 🔄 Refactoring Proposal (Before / After):
- Before: Problematic code.
- After: Refactored, production-ready Clean Code.
- ⚡ Impact & Benefits: Performance, readability, and maintenance advantages gained.