К основному содержанию
скилл CX Codex

review-and-simplify-changes — скилл для Claude Code: ревью диффа

Разбирает изменённый код на переиспользование, качество, эффективность и ясность, а потом по желанию вносит безопасные правки. Пригодится перед коммитом.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add Dimillian/Skills --skill review-and-simplify-changes -a claude-code
Открыть на GitHub

Что делает review-and-simplify-changes

Скилл смотрит на git-дифф или на файлы, которые вы назвали сами, и ищет четыре класса проблем: дублирование логики, лишнее состояние и параметры, повторную работу и промахи по местным конвенциям. Работает в трёх режимах. review-only просто отчитывается о находках, safe-fixes вносит правки, fix-and-validate после правок прогоняет минимальную проверку. Если режим не назван, скилл выбирает его по формулировке запроса.

Устроено так: четыре субагента Codex проходят один и тот же участок параллельно, каждый по своей роли — переиспользование, качество, эффективность, ясность и стандарты. Все они read-only: только читают код и возвращают находки главному агенту. Правки применяет исключительно главный агент, и только те, в которых уверен и которые не меняют поведение. Субъективные рефакторинги, требующие продуктовых решений, пропускаются.

Перед разбором скилл читает локальные инструкции проекта вроде AGENTS.md и документацию по затронутому модулю — иначе он не отличит настоящую проблему от намеренного местного паттерна. Для крошечного диффа параллельный запуск не нужен, там разбор идёт локально. Если область не ясна, скилл останавливается и говорит об этом, а не угадывает.

Какие задачи решает

  • найти дублирующуюся логику в свежем диффе
  • убрать лишнее состояние и разросшиеся параметры
  • вынести повторяющийся код в существующий хелпер
  • проверить изменения на соответствие конвенциям проекта
  • внести безопасные правки и прогнать минимальную проверку

Примеры запросов агенту

  • проверь изменения на переиспользование кода
  • упрости изменения, режим safe-fixes
  • сделай ревью диффа и поправь, что уверенно

Как установить review-and-simplify-changes

1Через Skills CLI (Vercel)

npx skills add Dimillian/Skills --skill review-and-simplify-changes -a claude-code

2Вручную: положить файлы

~/.claude/skills/review-and-simplify-changes/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/review-and-simplify-changes/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора11

macos-spm-app-packaging Скилл помогает собрать macOS-приложение на SwiftPM без проекта Xcode: от скелета до подписи, нотаризации и appcast. CX Codex +1 1 400установок app-store-changelog Собирает коммиты с последнего тега и превращает их в текст «What's New» для App Store. Пригодится перед каждой выкладкой в стор. CX Codex +1 1 300установок react-component-performance Находит причины медленного рендера в React, изолирует часто обновляемый стейт и убирает лишние вычисления. Помогает при лагах списков и анимаций. CX Codex +1 1 100установок github Даёт агенту команды утилиты gh CLI для работы с задачами, пулл-реквестами и запусками CI прямо из терминала. CX Codex +1 870установок project-skill-audit Анализирует прошлые сессии Codex, файлы памяти и локальные навыки проекта. Рекомендует обновить устаревшие инструкции или создать новые под частые задачи. CX Codex +1 785установок review-swarm Проводит параллельное ревью git-диффа или выбранных файлов без изменений в рабочей копии. Нужен для поиска регрессий, рисков безопасности и пробелов в тестах. CX Codex +1 756установок bug-hunt-swarm Ищет первопричину багов параллельно через субагентов и ранжирует версии. Нужен для регрессий, сбоев и нестабильного поведения без правок кода. CX Codex +1 713установок orchestrate-batch-refactor Скилл разбивает крупный рефакторинг на независимые рабочие пакеты и координирует субагентов. Нужен, когда затронуто много файлов или подсистем. CX Codex +1 688установок

Похожие

review-local-changes NeoLabHQ Проверяет незакоммиченные изменения в рабочем дереве и выдаёт список замечаний с предложениями по улучшению. Пригодится перед коммитом. CX Codex +1 1 200установок simplify-code Hermes Agent (inspired by Claude Code /simplify) Проверяет недавние изменения кода четырьмя параллельными субагентами и убирает оправданные упрощения. Нужен для чистки работающего кода после правок. CX Codex +1 345установок simplify brianlovin Переписывает код, который вы только что написали: снимает лишнюю вложенность, дубли и неудачные имена. Поведение программы остаётся прежним. CX Codex +1 20 100установок ce-simplify-code EveryInc Упрощает код после реализации, сохраняя поведение, и убирает тесты или комментарии без пользы. Подходит для проверки изменений перед ревью. CX Codex +1 3 400установок simplify-and-harden pskoett Пост-ревью кода сразу после завершения задачи: упрощение, харденинг, перепроверка и микродокументация. Пока агент ещё помнит замысел правок. CX Codex +1 535установок review-changes tirth8205 Проверяет набор изменений по графу знаний, оценивает риск и радиус влияния. Нужен для ревью функций, затронутых сценариев и пробелов в тестах. CX Codex +1 1 100установок

Рядом в теме «Код-ревью и рефакторинг»

Всё по теме «Код-ревью и рефакторинг» →

Вопросы о review-and-simplify-changes

Как установить review-and-simplify-changes в Claude?

Через установщик скиллов: npx skills add Dimillian/Skills --skill review-and-simplify-changes -a claude-code. После этого файл скилла лежит в ~/.claude/skills/review-and-simplify-changes/SKILL.md.

Что делает review-and-simplify-changes?

Разбирает git-дифф или указанные файлы по четырём направлениям: переиспользование, качество, эффективность, ясность и стандарты. В режиме с правками вносит только те изменения, в которых уверен и которые не меняют поведение кода.

Чем режимы safe-fixes и fix-and-validate отличаются?

fix-and-validate делает то же, что safe-fixes, и вдобавок прогоняет минимальную подходящую проверку после правок. review-only вообще ничего не меняет, только отчитывается.

Исходный текст

SKILL.md · MIT
---
name: review-and-simplify-changes
description: "Review a git diff or explicit file scope for reuse, code quality, efficiency, clarity, and standards issues, then optionally apply safe Codex-driven fixes. Use when the user asks to \"simplify code\", \"review changed code\", \"check for code reuse\", \"review code quality\", \"review efficiency\", \"simplify changes\", \"clean up code\", \"refactor changes\", or \"run simplify\"."
---

# Review and Simplify Changes

Review changed code for reuse, quality, efficiency, and clarity issues. Use Codex sub-agents to review in parallel, but keep those sub-agents read-only: they should only inspect code and send findings back to the main agent. Only the main agent may apply high-confidence, behavior-preserving fixes.

## Modes

Choose the mode from the user's request:

- `review-only`: user asks to review, audit, or check the changes
- `safe-fixes`: user asks to simplify, clean up, or refactor the changes
- `fix-and-validate`: same as `safe-fixes`, but also run the smallest relevant validation after edits

If the user does not specify, default to:

- `review-only` for "review", "audit", or "check"
- `safe-fixes` for "simplify", "clean up", or "refactor"

## Step 1: Determine the Scope and Diff Command

Prefer this scope order:

1. Files or paths explicitly named by the user
2. Current git changes
3. Files edited earlier in the current Codex turn
4. Most recently modified tracked files, only if the user asked for a review but there is no diff

If there is no clear scope, stop and say so briefly.

When using git changes, determine the smallest correct diff command based on the repo state:

- unstaged work: `git diff`
- staged work: `git diff --cached`
- branch or commit comparison explicitly requested by the user: use that exact diff target
- mixed staged and unstaged work: review both

Do not assume `git diff HEAD` is the right default when a smaller diff is available.

Before reviewing standards or applying fixes, read the repo's local instruction files and relevant project docs for the touched area. Prefer the closest applicable guidance, such as:

- `AGENTS.md`
- repo workflow docs
- architecture or style docs for the touched module

Use those instructions to distinguish real issues from intentional local patterns.

## Step 2: Launch Four Read-Only Review Sub-Agents in Parallel

Use Codex sub-agents when the scope is large enough for parallel review to help. For a tiny diff or one very small file, it is acceptable to review locally instead.

When spawning sub-agents:

- give each sub-agent the same scope
- tell each sub-agent to inspect only its assigned review role
- tell each sub-agent it is operating in a read-only review pass
- do not let sub-agents edit files, run `apply_patch`, stage changes, commit, or perform other state-mutating actions
- ask for concise, structured findings only
- ask each sub-agent to report file, line or symbol, problem, recommended fix, and confidence
- ask each sub-agent to return findings to the main agent only; they must not implement fixes themselves

Use four review roles.

### Sub-Agent 1: Code Reuse Review

Review the changes for reuse opportunities:

1. Search for existing helpers, utilities, or shared abstractions that already solve the same problem.
2. Flag duplicated functions or near-duplicate logic introduced in the change.
3. Flag inline logic that should call an existing helper instead of re-implementing it.

This sub-agent is read-only. It must not edit files, apply patches, or make any other workspace changes.

Recommended sub-agent role: `explorer` for broad codebase lookup, or `reviewer` if a stronger review pass is more useful than wide search.

### Sub-Agent 2: Code Quality Review

Review the same changes for code quality issues:

1. Redundant state, cached values, or derived values stored unnecessarily
2. Parameter sprawl caused by threading new arguments through existing call chains
3. Copy-paste with slight variation that should become a shared abstraction
4. Leaky abstractions or ownership violations across module boundaries
5. Stringly-typed values where existing typed contracts, enums, or constants already exist

This sub-agent is read-only. It must not edit files, apply patches, or make any other workspace changes.

Recommended sub-agent role: `reviewer`

### Sub-Agent 3: Efficiency Review

Review the same changes for efficiency issues:

1. Repeated work, duplicate reads, duplicate API calls, or unnecessary recomputation
2. Sequential work that could safely run concurrently
3. New work added to startup, render, request, or other hot paths without clear need
4. Pre-checks for existence when the operation itself can be attempted directly and errors handled
5. Memory growth, missing cleanup, or listener/subscription leaks
6. Overly broad reads or scans when the code only needs a subset

This sub-agent is read-only. It must not edit files, apply patches, or make any other workspace changes.

Recommended sub-agent role: `reviewer`

### Sub-Agent 4: Clarity and Standards Review

Review the same changes for clarity, local standards, and balance:

1. Violations of local project conventions or module patterns
2. Unnecessary complexity, deep nesting, weak names, or redundant comments
3. Overly compact or clever code that reduces readability
4. Over-simplification that collapses separate concerns into one unclear unit
5. Dead code, dead abstractions, or indirection without value

This sub-agent is read-only. It must not edit files, apply patches, or make any other workspace changes.

Recommended sub-agent role: `reviewer`

Only report issues that materially improve maintainability, correctness, or cost. Do not churn code just to make it look different.

## Step 3: Aggregate Findings

Wait for all review sub-agents to complete, then merge their findings.

The main agent owns this step. Treat sub-agent output as review input only, not as permission to delegate code changes back out.

Normalize findings into this shape:

1. File and line or nearest symbol
2. Category: reuse, quality, efficiency, or clarity
3. Why it is a problem
4. Recommended fix
5. Confidence: high, medium, or low

Discard weak, duplicative, or instruction-conflicting findings before editing.

## Step 4: Fix Issues Carefully

In `review-only` mode, stop after reporting findings.

In `safe-fixes` or `fix-and-validate` mode:

- Only the main agent applies fixes for this skill
- Apply only high-confidence, behavior-preserving fixes
- Skip subjective refactors that need product or architectural judgment
- Preserve local patterns when they are intentional or instruction-backed
- Keep edits scoped to the reviewed files unless a small adjacent change is required to complete the fix correctly

Prefer fixes like:

- replacing duplicated code with an existing helper
- removing redundant state or dead code
- simplifying control flow without changing behavior
- narrowing overly broad operations
- renaming unclear locals when the scope is contained

Do not stage, commit, or push changes as part of this skill.

## Step 5: Validate When Required

In `fix-and-validate` mode, after the main agent finishes edits, run the smallest relevant validation for the touched scope.

Examples:

- targeted tests for the touched module
- typecheck or compile for the touched target
- formatter or lint check if that is the project's real safety gate

Prefer fast, scoped validation over full-suite runs unless the change breadth justifies more.

If validation is skipped because the user asked not to run it, say so explicitly.

## Step 6: Summarize Outcome

Close with a brief result:

- what was reviewed
- what was fixed, if anything
- what was intentionally left alone
- whether validation ran

If the code is already clean for this rubric, say that directly instead of manufacturing edits.

© Dimillian · MIT · Dimillian/Skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой