Перейти к содержанию
Skillpedia
Код в целом12k · #11516

code-refactor-review

Что он делает

Этот скилл направляет ИИ на проверку, переиспользует ли новый код существующие вспомогательные функции и соответствует ли он шаблонам и именованию проекта. Он предназначен для разработчиков, которые проверяют запросы на слияние или изменения кода.

Когда использовать

  • ✓Когда вы хотите проверить запрос на слияние или изменение кода на повторное использование и согласованность.
  • ✓Когда вы хотите понять, не дублирует ли новый код то, что уже есть в кодовой базе.
  • ✓Когда вы хотите знать, соответствует ли изменение структуре файлов и именованию проекта.

Ссылка на скилл

https://github.com/trycompai/crm/blob/release/.agents/skills/code-refactor-review/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/trycompai/crm/blob/release/.agents/skills/code-refactor-review/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Проверьте, пожалуйста, мой diff и скажите, дублирует ли этот код существующие вспомогательные функции или не соответствует нашим шаблонам?”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

ИИ читает полное изменение, прослеживает, как связана функция, и ищет по кодовой базе, прежде чем оценивать новые вспомогательные функции или компоненты.

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

Code Refactor Review

Review code changes deeply for reuse, composition, codebase consistency, and anything that reads like slop.

First Pass

  1. Inspect the full diff:
    • Use git diff for unstaged changes.
    • Use git diff HEAD if there are staged changes.
    • For a PR URL, inspect the changed files and understand the feature flow before reviewing details.
  2. Build the call stack / data flow when useful. Do not review isolated lines without understanding how the feature is wired.
  3. 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 lib dumps.
  • 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 / useCallback added 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
Частые вопросы

На чём он сосредоточен?

Он сосредоточен на повторном использовании, композиции, согласованности и аккуратности кода.

Нужна ли ему ссылка на запрос на слияние?

Нет. Он может проверить текущий diff, а также запрос на слияние, если вы дадите ссылку на него.

Оценивает ли он код изолированно?

Нет. Он просит ИИ понять ход работы функции, прежде чем проверять детали.

Подробности

Оригинальное описание автора

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
Обновлён
01.11.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы