Review and refactor code within a specified scope. Use when the user asks to clean up, simplify, reduce duplication, remove dead code, or improve code quality in a file, module, or broader area of the codebase.
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Review and refactor code within a specified scope. Use when the user asks to clean up, simplify, reduce duplication, remove dead code, or improve code quality in a file, module, or broader area of the codebase.
Refactor
Input
A file, module, package, feature, diff, or project area to refactor.
Use explicit input first; otherwise infer from context, recent edits, selected files, or branch.
Safest default: ask before refactoring the whole project.
Workflow
Confirm input. If no input is provided or implied, confirm before refactoring the entire project.
Identify surface. Find files and direct dependencies that may need review or change.
Run baseline checks. Use available tests, typecheck, lint, or build commands for the scope. Note missing or failing tooling.
Identify refactors:
Dead code: unused functions, branches, flags, adapters, and stale comments/docs.
Duplication: repeated logic, validation, mapping, and query patterns.
Unnecessary complexity: deep nesting, mixed responsibilities, ambiguous naming, and over-abstraction.
Evidence-backed optimization: hot loops, N+1 queries, repeated expensive work.
Plan changes. Confirm when changes may affect behavior or remove intentional code.