factorizelisted
Install: claude install-skill Vleickzs/claude-conf
Scan the codebase to detect duplicated code, repeated patterns, and factorization opportunities. Unlike `/simplify` (which refines recently changed code), this command performs a **project-wide** analysis.
**Modes:**
- `/factorize` — full scan, all source files
- `/factorize src/services` — scoped to a specific directory
- `/factorize --dry-run` — report only, no code changes
- `/factorize --scope small` — override auto-detected project size
## Step 1 — Context
1. Read `CLAUDE.md` to understand:
- Stack (language, framework, conventions)
- Project structure (where source lives, what's generated/vendored)
- Naming conventions and existing abstractions
2. Detect project size:
- Count source files (exclude tests, config, generated, vendor, node_modules)
- **Small** (< 30 files): 1 analysis agent
- **Medium** (30-100 files): 2 agents (split by directory)
- **Large** (> 100 files): 3 agents (split by layer/concern)
3. Present the plan:
```
FACTORIZE — [project name]
Stack: [detected]
Scope: [full / directory]
Size: [X source files] → [small/medium/large]
Agents: [1-3]
Mode: [analysis + refactor / dry-run (report only)]
Proceed? [Y/n]
```
## Step 2 — Detection phase
Launch agents in parallel (subagent_type: `feature-dev:code-explorer`).
Each agent receives its assigned files and this mission:
```
You are analyzing [project name] ([stack]) for factorization opportunities.
Your assigned files: [list].
Scan for these patterns: