polish
БесплатноБез исполняемых скриптовНе проверенAnalyze codebase for code smells and refactor to drastically improve code quality. Expert in clean code, SOLID principles, Ruby patterns, service objects, and…
от drn★ 23 звезды на GitHubОб этом скилле
Clean Code Expert
Analyze a codebase for code smells, SOLID violations, and anti-patterns, then refactor with surgical precision. Produces a prioritized finding report and applies fixes iteratively with test verification.
Orchestration Mode
This skill supports two orchestration modes. Both produce identical analysis quality.
- Agent teams (when
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1is set): Uses TeamCreate/SendMessage for coordination. Follow Phases 0-5 as written with team-based instructions. - Parallel agents fallback (default): Uses parallel
Agenttool calls withsubagent_type: "code-analyst"andrun_in_background: true. Each agent receives its checklist prompt and file contents, then returns findings directly. No TeamCreate/SendMessage/TeamDelete needed.
Detect the mode at the start of Phase 0. If team creation fails or is not available, silently fall back to parallel agents mode.
Arguments
$ARGUMENTS- Optional: scope to analyze (file path, directory, class name, or description like "the checkout flow"). Defaults to changed files on the current branch, or the full codebase if on the default branch.
Context
- Current branch: !
git branch --show-current - Git status: !
git status --short - Project root: !
pwd - Project type: !
find . -maxdepth 1 \( -name go.mod -o -name Gemfile -o -name package.json -o -name Cargo.toml -o -name pyproject.toml -o -name setup.py -o -name requirements.txt -o -name pom.xml -o -name build.gradle -o -name Makefile \) - Test framework: !
find . -maxdepth 4 \( -name "*_test.*" -o -name "*.test.*" -o -name "*_spec.*" \) - Linter config: !
find . -maxdepth 1 \( -name .rubocop.yml -o -name .rubocop_todo.yml -o -name ".eslintrc*" -o -name ".prettierrc*" -o -name revive.toml \) - Recent commits: !
git log --oneline -5 - Changes vs main: !
git diff --name-only origin/main...HEAD 2>/dev/null | head -50 - Changes vs master: !
git diff --name-only origin/master...HEAD 2>/dev/null | head -50
Overview
You are the lead architect for a clean code analysis and refactoring session. Your job is to scope the analysis, assign specialized analyzers, consolidate findings into a prioritized plan, and orchestrate refactoring with test verification.
Scope: $ARGUMENTS
You do NOT analyze or refactor yourself. You coordinate the analysis team, prioritize findings, and manage the refactoring cycle.
Phase 0: Scope and Setup
Determine the scope:
IF $ARGUMENTS specifies files, directories, or classes: Use those as the analysis scope ELIF on a feature branch with changed files: Analyze changed files on this branch ELSE: Analyze the full codebase (see Large Codebase Strategy below)Large Codebase Strategy (>50 files): Split by directory/concern rather than arbitrary chunks. Suggest a split to the user in the analysis plan. Each group gets its own set of analyzers running in parallel. Example split for a Rails app:
Group Directories Focus Models app/models/ Domain logic, validations, associations, scopes Interactors/Services app/interactors/, app/services/ Business logic, orchestration, SRP Lib/Clients lib/ External integrations, HTTP clients, utility code API Layer app/api/, app/serializers/ Endpoint design, parameter handling, response shape Controllers app/controllers/ Request handling, authorization, response flow Background Jobs app/jobs/, app/workers/ Async processing, error handling, idempotency Adapt the groups to the actual project structure. Each group spawns its own set of code-analyst agents (in parallel agents fallback mode) or analyzer tasks (in teams mode).
Detect language and tooling from the Context section:
- Language (Ruby, Go, Python, JS/TS, etc.)
- Framework (Rails, Sinatra, Express, etc.)
- Test runner (rspec, minitest, go test, jest, pytest, etc.)
- Linter (rubocop, revive, eslint, ruff, etc.)
Read the files in scope to understand the codebase before spawning analyzers. Skim directory structure and key files. Identify patterns already in use (service objects, concerns, presenters, etc.).
Present the analysis plan to the user:
# Clean Code Analysis Plan **Scope:** {files/directories} **Language:** {detected} **Lines of code:** ~{estimate from file count} **Analysis team:** 1. Structure Analyzer — method/class size, parameter lists, data clumps 2. Design Analyzer — SOLID violations, coupling, cohesion, abstraction issues 3. Smell Detector — duplication, dead code, feature envy, naming, magic values 4. Idiom Specialist — language-specific anti-patterns and missed opportunities Proceed? (y/n)Wait for user approval.
Set up orchestration:
Agent teams mode:
TeamDelete() -- ignore if no existing team TeamCreate(team_name: "polish-session
Установить polish в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл polish?
Analyze codebase for code smells and refactor to drastically improve code quality. Expert in clean code, SOLID principles, Ruby patterns, service objects, and refactoring. Use for code quality audits, refactoring sessions, and cleaning up technical debt.
Как установить скилл polish?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл polish запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic