From code
Team-based code refactoring with analysis and user-approved changes. Use when: "refactor this code", "リファクタリング", "コード整理", "refactor team", "リファクタチーム".
How this skill is triggered — by the user, by Claude, or both
Slash command
/code:refactor-teamThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Resolve target files:
Resolve 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>/
npx claudepluginhub signalcompose/claude-tools --plugin codeOrchestrates a multi-step refactoring pipeline: analyzes code quality, plans improvements, optionally writes tests, implements changes, and reviews results. Routes simple refactors to a lighter workflow.
Safely restructure code in an isolated git worktree with test-preserved, incremental transformations
Refactors existing code for guideline compliance and testability using 4 parallel analysis agents. Use after /optimus:init to align code or before /optimus:unit-test to remove testability barriers.