code-refactor-review
O que ela faz
Ele orienta a IA a verificar se o novo código reaproveita auxiliares existentes e se segue os padrões e a nomenclatura do projeto. É para desenvolvedores que revisam pull requests ou diffs de código.
Quando usar
- ✓Quando você quer um pull request ou um diff revisado quanto ao reaproveitamento e à consistência.
- ✓Quando quer verificar se o novo código duplica algo que a base de código já tem.
- ✓Quando quer saber se uma mudança se encaixa na estrutura de arquivos e na nomenclatura do projeto.
Link da skill
https://github.com/trycompai/crm/blob/release/.agents/skills/code-refactor-review/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Você pode revisar meu diff e me dizer se este código duplica auxiliares existentes ou não se encaixa nos nossos padrões?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A IA lê a mudança completa, rastreia como a funcionalidade está conectada e pesquisa na base de código antes de julgar novos auxiliares ou componentes.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
No que ele se concentra?
Foca em reaproveitamento, composição, consistência e limpeza do código.
Ele precisa de um link de pull request?
Não. Pode revisar o diff atual ou um pull request, se você der o link.
Ele julga o código isoladamente?
Não. Pede à IA que entenda o fluxo da funcionalidade antes de revisar os detalhes.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 12 mil
- Posição no ranking
- #11516
- Licença
- MIT
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
ai-elements
12 milAjuda seu agente a criar interfaces de chat com IA usando componentes prontos para conversas, mensagens, exibição de ferramentas e campos de prompt.
ai-sdk
12 milAjuda seu agente a criar recursos de IA com o Vercel AI SDK, incluindo geração de texto, streaming, chamada de ferramentas e agentes.
better-accessibility
12 milAjuda seu agente a tornar interfaces utilizáveis com teclado e leitores de tela, cobrindo foco, rótulos, ARIA e formulários.
better-auth-best-practices
12 milAjuda seu agente a configurar o Better Auth para login, sessões, OAuth e plugins em um app TypeScript, seguindo os passos documentados.
Skills parecidas
diffs
394 milPermite que seu agente gere um diff real e compartilhável das edições, como link de visualização ou arquivo de imagem, em vez de um resumo escrito à mão.
coding-agent
394 milAjuda seu agente a passar um trabalho grande de programação para o Codex, Claude Code ou OpenCode em segundo plano e acompanhar o andamento.
gh-issues
394 milAjuda seu agente a encontrar issues do GitHub, escolher quais resolver e abrir pull requests com correções, acompanhando os comentários de revisão.