
Code Refactor Review
Reviews code changes for reuse, composition, codebase consistency, and slop.
Install
npx skills add trycompai/crm --skill code-refactor-review -g -a claude-code -y- Repository
- trycompai/crm11.8k
- Category
- Engineering
- Updated
- 4d ago
- License
- MIT
- Context cost
- Mediumabout 1,512 tokens
- Runs scripts
- No, instructions only
What it does
Reviews code changes for reuse, composition, codebase consistency, and slop. Use when asked to review PRs/diffs, check code reuse, composition, cleanliness, or whether code fits the codebase.
Code Refactor Review
Review code changes deeply for reuse, composition, codebase consistency, and anything that reads like slop.
First Pass
- Inspect the full diff:
- Use
git difffor unstaged changes. - Use
git diff HEADif there are staged changes. - For a PR URL, inspect the changed files and understand the feature flow before reviewing details.
- Use
- Build the call stack / data flow when useful. Do not review isolated lines without understanding how the feature is wired.
- Search the codebase before judging new helpers, components, hooks, or patterns. Prefer nearby and sibling patterns over invented abstractions.
Review Lenses
1. Reuse Existing Code
- Look for existing utilities, components, hooks, server actions, route patterns, copy patterns, and styling primitives before accepting newly written code.
- Flag duplicated logic, copied helpers, or custom implementations of things the codebase already has.
- Prefer reusing the existing flow even if it needs a small extension.
- If the new code creates a shared helper, verify it has real reuse and is not just extracted private logic with a vague name.
2. Codebase Consistency
- File placement should match the domain and neighboring features. Be suspicious of random top-level
libdumps. - Naming should match what the code actually does and follow sibling file/function names.
- Avoid implementation details in names unless they are the actual product/API distinction.
- Use existing result/error/loading patterns. Do not invent bespoke success/failure types when the codebase has a standard one.
- Match existing copy and tone for user-facing text.
