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

code-simplifier · pproenca — скилл для Claude Code: упрощает код без смены

Скилл для ИИ-агентов: чистит недавно изменённый код, снижает вложенность и дублирование, сохраняя поведение программы.

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

Что делает code-simplifier

Скилл code-simplifier — это набор правил для ИИ-агента, который упрощает код. Внутри 47 правил, разбитых на 8 категорий по приоритету: от критичных (поиск контекста проекта, сохранение поведения) до второстепенных (идиомы конкретных языков). У каждого правила есть объяснение, примеры «как неправильно / как правильно» и метрики влияния.

Ключевые принципы такие. Сначала агент изучает конвенции проекта, потом меняет только то, как написан код, а не то, что он делает. Правки держит маленькими и трогает только недавно изменённые файлы. Публичные сигнатуры функций, сообщения об ошибках и побочные эффекты остаются на месте. В категориях есть правила вроде flow-early-return — ранние возвраты вместо глубокой вложенности, name-intention-revealing — имена, объясняющие смысл, dead-delete-not-comment — удалять мёртвый код, а не комментировать его.

Скилл ставится в шесть платформ, включая Claude, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Для Claude файл ложится в ~/.claude/skills/code-simplifier/SKILL.md. Это повод проверить: если в проекте нет CLAUDE.md и конфигов линтера, агенту будет не на что опираться при выборе стиля, и правила из категории Context Discovery сработают вхолостую.

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

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

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

  • Упрости код в src/parser.ts, который я только что менял, поведение не трогай
  • Прогони code-simplifier по последнему коммиту и покажи диф
  • Снизь вложенность в этой функции через ранние возвраты

Как установить code-simplifier

1Через Skills CLI (Vercel)

npx skills add pproenca/dot-skills --skill code-simplifier -a claude-code

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

~/.claude/skills/code-simplifier/SKILL.md

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

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

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

react-hook-form Оптимизирует клиентские формы на React Hook Form 7.82.0 и защищает от лишних ререндеров при подписках на поля, валидации и интеграции UI-библиотек. CX Codex +1 3 000установок emilkowal-animations Набор из 58 правил веб-анимации на базе подходов Эмиля Ковальски для React и CSS. Помогает настроить кривые плавности, жесты и тайминги. CX Codex +1 2 800установок nuqs Скилл с 39 правилами по nuqs: типизированные парсеры, адаптеры, интеграция с Server Components и оптимизация обновлений URL. Пригодится, когда агент пишет или рефакторит код с URL-состоянием. CX Codex +1 2 300установок clean-architecture Скилл с 42 правилами из книги Роберта Мартина: подсказывает агенту, куда направлять зависимости и где проводить границы слоёв. CX Codex +1 2 000установок expo-react-native-performance Набор из 42 правил оптимизации приложений на Expo и React Native. Помогает настроить запуск, списки на FlashList, анимации и рендеринг без ручного поиска узких мест. CX Codex +1 1 500установок framer-motion Скилл оптимизирует анимации Framer Motion в React: предотвращает лишние ререндеры, уменьшает размер бандла и настраивает переходы жестов или скролла. CX Codex +1 1 100установок msw Скилл с 45 правилами по MSW v2: настройка, хендлеры, интеграция с тестами, GraphQL. Пригодится, когда агент пишет или правит моки HTTP-запросов. CX Codex +1 842установок clean-code Скилл для ревью и рефакторинга: 48 правил из книги Роберта Мартина с современными поправками. Пригодится, когда агент пишет или разбирает код. CX Codex +1 842установок

Другие версии code-simplifier

Похожие

simplify brianlovin Переписывает код, который вы только что написали: снимает лишнюю вложенность, дубли и неудачные имена. Поведение программы остаётся прежним. CX Codex +1 20 100установок principle-minimize-reader-load backnotprop Скилл помогает найти лишние слои абстракции и спрятанное состояние, которое замедляет понимание кода. Применяй при ревью сложных участков, когда трудно проследить логику. CX Codex +1 5 200установок principal-engineering riekelt Скилл задаёт строгие инженерные правила перед правками: запрещает заглушать ошибки, требует чекпоинт рисков и проверку работы реальным кодом, а не догадками. CX Codex +1 18 000установок antislop-code miqdadbadjuber Скилл фильтрует из кода комментарии, которые выглядят как результат работы ИИ — повторяют очевидное, нарезают текст на шаги или украшают разделители. Оставляет комментарии с реальной информацией и никогда не трогает сам код. CX Codex +1 5 800установок gem-code-simplifier официальный github Субагент для безопасного рефакторинга: вычищает мертвый код и снижает сложность. Пригодится, когда нужно причесать кодовую базу и не сломать логику. ★ 40 418звёзд репо improve-code-quality wondelai Пошагово переводит сырой прототип в рабочий проект с тестами, границами архитектуры и планом надёжности. Пригодится, когда страшно трогать работающий код без тестов. CX Codex +1 2 300установок

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

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

Вопросы о code-simplifier

Как установить code-simplifier в Claude?

Выполните npx skills add pproenca/dot-skills --skill code-simplifier -a claude-code. Скилл окажется в ~/.claude/skills/code-simplifier/SKILL.md.

Что делает code-simplifier?

Даёт агенту 47 правил упрощения кода в 8 категориях: контекст проекта, сохранение поведения, границы правок, контроль потока, имена, дублирование, мёртвый код и языковые идиомы. Агент меняет форму кода, но не его поведение.

Для каких платформ подходит скилл?

Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Команда установки отличается только флагом платформы, например -a cursor или -a codex.

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

SKILL.md · MIT
---
name: code-simplifier
description: Code simplification skill for improving clarity, consistency, and maintainability while preserving exact behavior. Use when simplifying code, reducing complexity, cleaning up recent changes, applying refactoring patterns, or improving readability. Triggers on tasks involving code cleanup, simplification, refactoring, or readability improvements.
---

# Community Code Simplification Best Practices

Comprehensive code simplification guide for AI agents and LLMs. Contains 47 rules across 8 categories, prioritized by impact from critical (context discovery, behavior preservation) to incremental (language idioms). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics.

## Core Principles

1. **Context First**: Understand project conventions before making any changes
2. **Behavior Preservation**: Change how code is written, never what it does
3. **Scope Discipline**: Focus on recently modified code, keep diffs small
4. **Clarity Over Brevity**: Explicit, readable code beats clever one-liners

## When to Apply

Reference these guidelines when:
- Simplifying or cleaning up recently modified code
- Reducing nesting, complexity, or duplication
- Improving naming and readability
- Applying language-specific idiomatic patterns
- Reviewing code for maintainability issues

## Rule Categories by Priority

| Priority | Category | Impact | Prefix | Rules |
|----------|----------|--------|--------|-------|
| 1 | Context Discovery | CRITICAL | `ctx-` | 4 |
| 2 | Behavior Preservation | CRITICAL | `behave-` | 6 |
| 3 | Scope Management | HIGH | `scope-` | 5 |
| 4 | Control Flow Simplification | HIGH | `flow-` | 9 |
| 5 | Naming and Clarity | MEDIUM-HIGH | `name-` | 6 |
| 6 | Duplication Reduction | MEDIUM | `dup-` | 5 |
| 7 | Dead Code Elimination | MEDIUM | `dead-` | 5 |
| 8 | Language Idioms | LOW-MEDIUM | `idiom-` | 7 |

## Quick Reference

### 1. Context Discovery (CRITICAL)

- [`ctx-read-claude-md`](references/ctx-read-claude-md.md) - Always read CLAUDE.md before simplifying
- [`ctx-detect-lint-config`](references/ctx-detect-lint-config.md) - Check for linting and formatting configs
- [`ctx-follow-existing-patterns`](references/ctx-follow-existing-patterns.md) - Match existing code style in file and project
- [`ctx-project-over-generic`](references/ctx-project-over-generic.md) - Project conventions override generic best practices

### 2. Behavior Preservation (CRITICAL)

- [`behave-preserve-outputs`](references/behave-preserve-outputs.md) - Preserve all return values and outputs
- [`behave-preserve-errors`](references/behave-preserve-errors.md) - Preserve error messages, types, and handling
- [`behave-preserve-api`](references/behave-preserve-api.md) - Preserve public function signatures and types
- [`behave-preserve-side-effects`](references/behave-preserve-side-effects.md) - Preserve side effects (logging, I/O, state changes)
- [`behave-no-semantics-change`](references/behave-no-semantics-change.md) - Forbid subtle semantic changes
- [`behave-verify-before-commit`](references/behave-verify-before-commit.md) - Verify behavior preservation before finalizing

### 3. Scope Management (HIGH)

- [`scope-recent-code-only`](references/scope-recent-code-only.md) - Focus on recently modified code only
- [`scope-minimal-diff`](references/scope-minimal-diff.md) - Keep changes small and reviewable
- [`scope-no-unrelated-refactors`](references/scope-no-unrelated-refactors.md) - No unrelated refactors
- [`scope-no-global-rewrites`](references/scope-no-global-rewrites.md) - Avoid global rewrites and architectural changes
- [`scope-respect-boundaries`](references/scope-respect-boundaries.md) - Respect module and component boundaries

### 4. Control Flow Simplification (HIGH)

- [`flow-early-return`](references/flow-early-return.md) - Use early returns to reduce nesting
- [`flow-guard-clauses`](references/flow-guard-clauses.md) - Use guard clauses for preconditions
- [`flow-no-nested-ternaries`](references/flow-no-nested-ternaries.md) - Never use nested ternary operators
- [`flow-explicit-over-dense`](references/flow-explicit-over-dense.md) - Prefer explicit control flow over dense expressions
- [`flow-flatten-nesting`](references/flow-flatten-nesting.md) - Flatten deep nesting to maximum 2-3 levels
- [`flow-single-responsibility`](references/flow-single-responsibility.md) - Each code block should do one thing
- [`flow-positive-conditions`](references/flow-positive-conditions.md) - Prefer positive conditions over double negatives
- [`flow-optional-chaining`](references/flow-optional-chaining.md) - Use optional chaining and nullish coalescing
- [`flow-boolean-simplification`](references/flow-boolean-simplification.md) - Simplify boolean expressions

### 5. Naming and Clarity (MEDIUM-HIGH)

- [`name-intention-revealing`](references/name-intention-revealing.md) - Use intention-revealing names
- [`name-nouns-for-data`](references/name-nouns-for-data.md) - Use nouns for data, verbs for actions
- [`name-avoid-abbreviations`](references/name-avoid-abbreviations.md) - Avoid cryptic abbreviations
- [`name-consistent-vocabulary`](references/name-consistent-vocabulary.md) - Use consistent vocabulary throughout
- [`name-avoid-generic`](references/name-avoid-generic.md) - Avoid generic names
- [`name-string-interpolation`](references/name-string-interpolation.md) - Prefer string interpolation over concatenation

### 6. Duplication Reduction (MEDIUM)

- [`dup-rule-of-three`](references/dup-rule-of-three.md) - Apply the rule of three
- [`dup-no-single-use-helpers`](references/dup-no-single-use-helpers.md) - Avoid single-use helper functions
- [`dup-extract-for-clarity`](references/dup-extract-for-clarity.md) - Extract only when it improves clarity
- [`dup-avoid-over-abstraction`](references/dup-avoid-over-abstraction.md) - Prefer duplication over premature abstraction
- [`dup-data-driven`](references/dup-data-driven.md) - Use data-driven patterns over repetitive conditionals

### 7. Dead Code Elimination (MEDIUM)

- [`dead-remove-unused`](references/dead-remove-unused.md) - Delete unused code artifacts
- [`dead-delete-not-comment`](references/dead-delete-not-comment.md) - Delete code, never comment it out
- [`dead-remove-obvious-comments`](references/dead-remove-obvious-comments.md) - Remove comments that state the obvious
- [`dead-keep-why-comments`](references/dead-keep-why-comments.md) - Keep comments that explain why, not what
- [`dead-remove-todo-fixme`](references/dead-remove-todo-fixme.md) - Remove stale TODO/FIXME comments

### 8. Language Idioms (LOW-MEDIUM)

- [`idiom-ts-strict-types`](references/idiom-ts-strict-types.md) - Use strict types over any (TypeScript)
- [`idiom-ts-const-assertions`](references/idiom-ts-const-assertions.md) - Use const assertions and readonly (TypeScript)
- [`idiom-rust-question-mark`](references/idiom-rust-question-mark.md) - Use ? for error propagation (Rust)
- [`idiom-rust-iterator-chains`](references/idiom-rust-iterator-chains.md) - Use iterator chains when clearer (Rust)
- [`idiom-python-comprehensions`](references/idiom-python-comprehensions.md) - Use comprehensions for simple transforms (Python)
- [`idiom-go-error-handling`](references/idiom-go-error-handling.md) - Handle errors immediately (Go)
- [`idiom-prefer-language-builtins`](references/idiom-prefer-language-builtins.md) - Prefer language and stdlib builtins

## Workflow

1. **Discover context**: Read CLAUDE.md, lint configs, examine existing patterns
2. **Identify scope**: Focus on recently modified code unless asked to expand
3. **Apply transformations**: Use rules in priority order (CRITICAL first)
4. **Verify behavior**: Ensure outputs, errors, and side effects remain identical
5. **Keep diffs minimal**: Small, focused changes that are easy to review

## How to Use

Read individual reference files for detailed explanations and code examples:

- [Section definitions](references/_sections.md) - Category structure and impact levels
- [Rule template](assets/templates/_template.md) - Template for adding new rules

## Reference Files

| File | Description |
|------|-------------|
| [references/_sections.md](references/_sections.md) | Category definitions and ordering |
| [assets/templates/_template.md](assets/templates/_template.md) | Template for new rules |
| [metadata.json](metadata.json) | Version and reference information |

© pproenca · MIT · pproenca/dot-skills

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

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

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