refactoring-team
This skill uses Claude hooks which can execute code automatically in response to events. Review carefully before installing.
STARTER_CHARACTER = 💎
Prerequisites
Agent teams must be enabled in settings:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
If not set, offer to add it before proceeding.
Setup
If $ARGUMENTS provided, use as target path. Otherwise ask for:
- Target path (files or folder to refactor)
- Test command to verify changes
Verify the target path exists and tests pass before proceeding.
Launch the Team
Generate a short random ID: head -c 3 /dev/urandom | xxd -p | head -c 3
Use it to name the teammates:
- Worker:
worker-ID(e.g.worker-a3f) - Reviewer:
reviewer-ID(e.g.reviewer-a3f)
Read the spawn prompts:
- Worker: references/worker-prompt.md
- Reviewer: references/reviewer-prompt.md
Before spawning, replace these placeholders in both prompts:
TARGET_PATH→ actual target pathTEST_COMMAND→ actual test commandLENSES_DIR→${CLAUDE_SKILL_DIR}/references/lensesGUIDES_DIR→${CLAUDE_SKILL_DIR}/references/reviewer-guidesWORKER_NAME→ the worker's name (e.g.worker-a3f)REVIEWER_NAME→ the reviewer's name (e.g.reviewer-a3f)
After Launch
Tell the user:
- Shift+Down cycles between worker and reviewer
- For split panes: set
teammateMode: "tmux"in settings
Monitor Progress
When a worker goes idle, read .refactoring-state to check the lens number. If it skipped a value, message the reviewer to go back and complete the skipped lens first.
More from lexler/skill-factory
hexagonal-architecture
Applies hexagonal (ports & adapters) architecture. Use when designing application structure, separating domain from infrastructure, creating testable boundaries, or when user mentions ports, adapters, hexagonal, or clean architecture.
13using-uv
Python package and project management with UV. Use when creating Python scripts, initializing projects, or managing dependencies.
5approval-tests
Writes approval tests (snapshot/golden master testing) for Python, JavaScript/TypeScript, or Java. Use when verifying complex output, characterization testing legacy code, testing combinations, or working with .approved/.received files.
5refactoring
Refactoring process. Invoke immediately when user or document mentions refactoring, or proactively when code gets too complex or messy.
5git-worktrees
Creates git worktrees for parallel development. Use when creating a git worktree, setting up multiple working directories, or working on features in parallel.
5nullables
Writes tests without mocks using Nullables. Use when writing tests, especially testing code with external I/O (HTTP, files, databases, clocks, random numbers), designing infrastructure wrappers or replacing mocking libraries.
5