Sub-Agent Refactor Command
Development community intermediate
Description
A powerful refactoring orchestrator that uses multiple specialized sub-agents to analyze, plan, implement, and verify code improvements while maintaining functionality.
Installation
Terminal
claude install-skill https://github.com/derek-opdee/subagent-example-script README
Sub-Agent Refactor Command
A powerful refactoring orchestrator that uses multiple specialized sub-agents to analyze, plan, implement, and verify code improvements while maintaining functionality.
Command Syntax
sub-agent-refactor [target] [options]
# Aliases
@refactor [target] [options]
@sar [target] [options]
Parameters
- undefined
Examples
Basic Refactoring
# Auto-detect and refactor a single file
sub-agent-refactor src/components/UserDashboard.tsx
# Refactor an entire directory
sub-agent-refactor src/services/
# Use glob pattern
sub-agent-refactor "src/**/*Service.ts"
Specific Refactoring Types
# Extract repeated code into shared utilities
sub-agent-refactor src/pages/ --type extract-method --create-shared
# Break down large React components
sub-agent-refactor src/components/Dashboard.tsx --type extract-component
# Reduce function complexity
sub-agent-refactor src/utils/calculations.ts --type reduce-complexity --max-function-size 20
# Consolidate duplicate utilities across project
sub-agent-refactor . --type consolidate-utils
Advanced Usage
# Interactive mode with custom test command
sub-agent-refactor src/ --interactive --test-command "npm run test:unit"
# Dry run to preview changes
sub-agent-refactor src/api/ --dry-run --type reduce-complexity
# Strict mode with specific constraints
sub-agent-refactor src/ --strict --max-file-size 200 --max-complexity 8
# Refactor Laravel controllers
sub-agent-refactor app/Http/Controllers/ --type extract-method --create-shared
Agent Orchestration
Stage 1: Analysis Agent
**Prompt:**
Analyze the codebase at [TARGET] for refactoring opportu
Related Agents
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
Development community src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11
Development community Cavecrew Builder
>
Development community Cavecrew Investigator
>
Development community Cavecrew Reviewer
>
Development community Contributing to nanobot
Thank you for being here. nanobot is built with a simple belief: good tools should feel calm, clear, and humane. We care deeply about useful features, but we also believe in achieving more with less:
Development community