refactor
Invoke IMMEDIATELY via python script when user requests refactoring analysis, technical debt review, or code quality improvement. Do NOT explore first - the script orchestrates exploration.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
--- name: "refactor" description: "Invoke IMMEDIATELY via python script when user requests refactoring analysis, technical debt review, or code quality improvement. Do NOT explore first - the script orchestrates exploration." license: "Apache-2.0" --- # Refactor When this skill activates, IMMEDIATELY invoke the script. The script IS the workflow. ## Invocation <invoke working-dir=".claude/skills/scripts" cmd="python3 -m skills.refactor.refactor --step 1 --total-steps 5 --n 10" /> | Argument | Required | Description | | --------------- | -------- | --------------------------------------------- | | `--step` | Yes | Current step (starts at 1) | | `--total-steps` | Yes | Total steps (5 for full workflow) | | `--n` | No | Number of categories to explore (default: 10) | Do NOT explore or analyze first. Run the script and follow its output. ## Workflow Phases 1. **Dispatch** - Launch parallel Explore agents (one per category) 2. **Triage** - Structure smell findings with IDs 3. **Cluster** - Group smells by shared root cause 4. **Contextualize** - Extract user intent, prioritize issues 5. **Synthesize** - Generate actionable work items ## Determining N (category count) Default: N = 10 Adjust based on user request scope: - SMALL (single file, specific concern, "quick look"): N = 5 - MEDIUM (directory, module, standard analysis): N = 10 - LARGE (entire codebase, "thorough", "comprehensive"): N = 25 The script randomly selects N categories from the 38 available code quality categories defined in conventions/code-quality/.
More Refactoring skills
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
analyze-project
lllllllama/rigorpilot-skills
Rigor Analyze / Rigor Audit read-only skill for deep learning research repositories. Use when the user wants to read and understand a repository, inspect model structure and training or inference entrypoints, review configs and insertion points, or flag suspicious implementation patterns without modifying code or running heavy jobs. Do not use for active command execution, broad refactoring, speculative code adaptation, or automatic bug fixing.
request-refactor-plan
mattpocock/skills
Create a detailed refactor plan with tiny commits via user interview, then file it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

