| name | refactor-team |
| description | Team-based code refactoring with analysis and user-approved changes.
Use when: "refactor this code", "リファクタリング", "コード整理",
"refactor team", "リファクタチーム".
|
| user-invocable | false |
Refactor Team
Step 1: Identify Target Files & Detect Context
Resolve target files:
- If user specified path: use that
- Otherwise:
git diff --name-only <base-branch> for changed files
Detect context:
- Base branch:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||' (fallback: main)
- Test command: detect from
package.json, Makefile, pytest.ini, etc.
- Project rules: read project's CLAUDE.md if present
Step 2: Create Refactor Team
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).
Step 3: Run Analysis
Analyzer examines target files using criteria from .