code-refactor-review
하는 일
새 코드가 기존 도우미를 재사용하고, 프로젝트의 패턴과 명명에 맞는지 확인하도록 AI를 안내합니다. 풀 리퀘스트나 코드 차이를 검토하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓풀 리퀘스트나 코드 차이를 재사용과 일관성 측면에서 검토받고 싶을 때.
- ✓새 코드가 코드베이스에 이미 있는 기능을 중복하는지 확인하고 싶을 때.
- ✓변경이 프로젝트의 파일 구조와 명명에 맞는지 알고 싶을 때.
스킬 링크
https://github.com/trycompai/crm/blob/release/.agents/skills/code-refactor-review/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“내 차이를 검토해서 이 코드가 기존 도우미를 중복하는지, 또는 우리 패턴에 맞지 않는지 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 변경 전체를 읽고, 기능이 어떻게 연결되어 있는지 추적하며, 새 도우미나 컴포넌트를 판단하기 전에 코드베이스를 검색합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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.
3. Composition and Boundaries
- Functions should do one thing at the right level of abstraction.
- Avoid grab-bag modules that mix unrelated concerns like flags, API calls, transformation, UI state, logging, and scheduling.
- Avoid parameter sprawl. If a function needs many knobs, check whether the boundary is wrong.
- Prefer simple composition over chains of callbacks, wrappers, memoized helpers, and prop plumbing.
- When two backing entities are presented as one product concept, package them into one transport/view model across intermediate components. Black-box components should receive one unified prop/callback and should not care about distinctions like remote vs prebuilt; split back into core entities only at roots/adapters where persistence or payload formats require it.
- Keep domain-specific logic close to its domain unless there is proven cross-domain reuse.
4. Slop Detection
Flag and, when asked, remove:
- Comment slop: obvious comments, comments defending awkward code, long comments that should become clearer code, stale context in PR descriptions.
- Helper slop: tiny wrappers that add no meaning, helper files created only to make one function look shorter, unnecessary indirection.
- Type slop: exported one-off types, custom result shapes, annotations where inference is clearer, types that only paper over awkward code.
- Memo/callback slop:
useMemo/useCallbackadded without a measured or structural reason. - Effect slop: effects that mirror props/state, reset derived state, or handle events after the fact.
- Compatibility cruft: bolted-on behavior that preserves accidental architecture instead of building the coherent end state.
- Diff churn: unrelated renames, formatting, comments, or wrappers that make the PR larger without improving the design.
5. React / Next.js Quality
- Apply “You Might Not Need an Effect”: derive values during render, move event-caused work into event handlers, and reset state with keys when appropriate.
- Avoid redundant state and synchronization effects.
- Do not add memoization just to quiet performance anxiety. Memoization should solve a real render identity or expensive computation issue.
- Prefer straightforward component boundaries over prop/callback gymnastics.
- For server/data code, avoid unnecessary waterfalls and run independent work concurrently when the codebase has a pattern for it.
6. Minimality
- Prefer deleting code over adding new structure.
- Prefer one clear function over several helper-y fragments unless extraction improves reuse or readability.
- Keep the fix proportional to the problem.
- Do not add architecture, docs, or comments unless they remove ambiguity for future readers.
Output Format
Start with a verdict:
clean— no meaningful concerns.mostly clean— m
자주 묻는 질문
무엇에 집중하나요?
재사용, 구성, 일관성, 코드의 깔끔함에 집중합니다.
풀 리퀘스트 링크가 필요한가요?
아닙니다. 현재 차이를 검토할 수 있으며, 링크를 주면 풀 리퀘스트도 검토할 수 있습니다.
코드를 따로 떼어 판단하나요?
아닙니다. 세부 사항을 검토하기 전에 AI가 기능의 흐름을 이해하도록 요구합니다.
상세 정보
작성자의 원본 설명
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.
repo: trycompai/crm
인기도
- GitHub 스타
- 12k
- 순위
- #11516
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
ai-elements
12k에이전트가 대화, 메시지, 도구 표시, 프롬프트 입력을 위한 기성 컴포넌트로 AI 채팅 화면을 만들도록 돕습니다.
ai-sdk
12k에이전트가 Vercel AI SDK로 텍스트 생성, 스트리밍, 도구 호출, 에이전트를 포함한 AI 기능을 만들도록 돕습니다.
better-accessibility
12k에이전트가 키보드와 스크린 리더로도 사용할 수 있도록 인터페이스를 만들며, 포커스, 레이블, ARIA, 양식을 다루도록 돕습니다.
better-auth-best-practices
12k에이전트가 TypeScript 앱에서 문서에 나온 단계에 따라 Better Auth로 로그인, 세션, OAuth, 플러그인을 설정하도록 돕습니다.