Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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.

  1. Agent teams (when CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set): Uses TeamCreate/SendMessage for coordination. Follow Phases 0-5 as written with team-based instructions.
  2. Parallel agents fallback (default): Uses parallel Agent tool calls with subagent_type: "code-analyst" and run_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

  1. 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).

  2. 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.)
  3. 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.).

  4. 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.

  5. Set up orchestration:

    Agent teams mode:

    TeamDelete() -- ignore if no existing team
    TeamCreate(team_name: "polish-session
    
Полный SKILL.md на GitHub

Установить polish в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/ANALYZERS.mdreferences/BRIEFINGS.mdreferences/SCORING.md

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), без исполняемых скриптов.

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

Сравнить polish с