Team-based code refactoring with analysis and user-approved changes. Use when: "refactor this code", "リファクタリング", "コード整理", "refactor team", "リファクタチーム".
Analyzes code for refactoring opportunities and executes user-approved changes with a team of AI agents.
/plugin marketplace add signalcompose/claude-tools/plugin install code@claude-toolsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/analysis-criteria.mdResolve target files:
git diff --name-only <base-branch> for changed filesDetect context:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||' (fallback: main)package.json, Makefile, pytest.ini, etc.MANDATORY: Use TeamCreate to create the team, then spawn agents with Task tool.
Team structure:
Team Lead (yourself)
├─ Analyzer: pr-review-toolkit:code-simplifier
└─ Refactorer: general-purpose (refactorer)
MANDATORY: Always specify an explicit model parameter when spawning each agent. Choose the appropriate model based on task complexity (haiku for lightweight, sonnet for standard, opus for complex reasoning). Never omit model (default inherit may fail in parallel spawning).
Analyzer examines target files using criteria from ${CLAUDE_PLUGIN_ROOT}/skills/refactor-team/references/analysis-criteria.md.
Analysis output format:
| # | Category | File:Line | Description | Priority | Risk |
|---|---|---|---|---|---|
| 1 | DRY | src/a.ts:42 | ... | High | Low |
| 2 | Naming | src/c.ts:8 | ... | Medium | None |
MANDATORY: Present the analysis table to user and wait for approval. Do NOT proceed without explicit user selection of which items to execute.
User selects items by number (e.g., "1, 3, 5" or "all").
For each approved item:
refactor: <description>Rules:
refactor:Report summary:
Send shutdown_request to all agents individually via SendMessage (one message per agent):
Wait up to 30 seconds for shutdown_response from each agent.
Then call TeamDelete.
If TeamDelete fails (agents did not respond to shutdown):
dangerouslyDisableSandbox: true:
rm -rf ~/.claude/teams/<team-name>/ ~/.claude/tasks/<team-name>/
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.