code-simplifier · simonwong — скилл для Claude Code: упрощает свежий код
Скилл разбирает недавно изменённый код и переписывает его читаемее, не меняя поведение. Полезен сразу после крупной правки.
npx skills add simonwong/skills --skill code-simplifier -a claude-codeЧто делает code-simplifier
code-simplifier работает как специалист по упрощению: он берёт участки, которые вы только что тронули в текущей сессии, и приводит их к более явному виду. Логика остаётся той же — меняется только форма записи.
Внутри — набор правил из CLAUDE.md: сортировка импортов, явные типы возврата у функций верхнего уровня, типы Props в React-компонентах, единые имена. Отдельно оговорён запрет на вложенные тернарники — вместо них предлагаются switch или цепочка if/else. Скилл сам решает, что считать лишним: убирает дублирование, лишние абстракции и комментарии, которые пересказывают очевидное.
Границы заданы жёстко. Переусердствовать нельзя: если упрощение мешает отладке или склеивает несколько задач в одну функцию, оно не применяется. И по умолчанию скилл смотрит только на свежие изменения — за более широкий разбор нужно попросить отдельно. Если в проекте нет CLAUDE.md, правила придётся задать самому, иначе скилл будет опираться на общие соображения.
Какие задачи решает
- разгрести свежую правку и убрать лишние вложенности
- привести импорты и имена к стандарту проекта
- заменить вложенные тернарники на понятные ветвления
- вычистить комментарии, которые дублируют код
- сократить дублирование после рефакторинга
Примеры запросов агенту
- упрости код, который я только что изменил
- приведи этот файл к стандартам из CLAUDE.md, поведение не меняй
- разбери свежие правки и убери лишние абстракции
Как установить code-simplifier
1Через Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a claude-code2Вручную: положить файлы
~/.claude/skills/code-simplifier/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/code-simplifier/
1Через Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a codex2Вручную: положить файлы
.agents/skills/code-simplifier/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a cursor2Вручную: положить файлы
.cursor/skills/code-simplifier/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install simonwong/skills code-simplifier2Вручную: положить файлы
.github/skills/code-simplifier/SKILL.md1Через Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a gemini-cli2Командой платформы
gemini skills install https://github.com/simonwong/skills --path skills/engineering/code-simplifierВручную: положить файлы
.devin/skills/code-simplifier/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Другие версии code-simplifier
Похожие
Рядом в теме «Код-ревью и рефакторинг»
Всё по теме «Код-ревью и рефакторинг» →Вопросы о code-simplifier
Как установить code-simplifier в Claude?
Выполните npx skills add simonwong/skills --skill code-simplifier -a claude-code. Файл скилла окажется в ~/.claude/skills/code-simplifier/SKILL.md.
Что делает code-simplifier?
Переписывает недавно изменённый код ради читаемости и единообразия. Функциональность при этом сохраняется полностью.
Он трогает весь проект или только свежие правки?
По умолчанию только то, что менялось в текущей сессии. Более широкий разбор нужно запросить явно.
Исходный текст
SKILL.md · MIT
--- name: code-simplifier description: Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise. license: MIT disable-model-invocation: true metadata: author: anthropics version: "1.0.0" --- You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result your years as an expert software engineer. You will analyze recently modified code and apply refinements that: 1. **Preserve Functionality**: Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact. 2. **Apply Project Standards**: Follow the established coding standards from CLAUDE.md including: - Use ES modules with proper import sorting and extensions - Use explicit return type annotations for top-level functions - Follow proper React component patterns with explicit Props types - Use proper error handling patterns (avoid try/catch when possible) - Maintain consistent naming conventions 3. **Enhance Clarity**: Simplify code structure by: - Reducing unnecessary complexity and nesting - Eliminating redundant code and abstractions - Improving readability through clear variable and function names - Consolidating related logic - Removing unnecessary comments that describe obvious code - IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions - Choose clarity over brevity - explicit code is often better than overly compact code 4. **Maintain Balance**: Avoid over-simplification that could: - Reduce code clarity or maintainability - Create overly clever solutions that are hard to understand - Combine too many concerns into single functions or components - Remove helpful abstractions that improve code organization - Prioritize "fewer lines" over readability (e.g., nested ternaries, dense one-liners) - Make the code harder to debug or extend 5. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope. Your refinement process: 1. Identify the recently modified code sections 2. Analyze for opportunities to improve elegance and consistency 3. Apply project-specific best practices and coding standards 4. Ensure all functionality remains unchanged 5. Verify the refined code is simpler and more maintainable 6. Document only significant changes that affect understanding You operate autonomously and proactively, refining code immediately after it's written or modified without requiring explicit requests. Your goal is to ensure all code meets the highest standards of elegance and maintainability while preserving its complete functionality.
© anthropics · MIT · simonwong/skills