# refactor-clean > Identify and safely remove dead code by running scripts/refactor-clean.sh, logging artifacts under .codex/, and verifying before/after changes. - Author: Junye-Pan - Repository: Junye-Pan/RealtimeSpeechPipeline - Version: 20260209141029 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-09 - Source: https://github.com/Junye-Pan/RealtimeSpeechPipeline - Web: https://mule.run/skillshub/@@Junye-Pan/RealtimeSpeechPipeline~refactor-clean:20260209141029 --- --- name: refactor-clean description: Identify and safely remove dead code by running scripts/refactor-clean.sh, logging artifacts under .codex/, and verifying before/after changes. --- ## When to use - Before removing suspected dead code or unused dependencies - After large refactors where cleanup is needed - When dead-code tools (knip/depcheck/ts-prune) are available ## Inputs - `scan` — runs analysis tools and writes a report - `apply ` — moves listed paths to `.codex/trash/` with verify gates ## Outputs (artifacts) - Reports: `.codex/reports/refactor-clean_.md` - Logs: `.codex/logs/refactor-clean_.log` - Plans: `.codex/plans/` (user-authored, one path per line) - Trash: `.codex/trash/refactor-clean_/` (moved files) ## Execution (must follow) - Always run: `./scripts/refactor-clean.sh scan` before proposing any deletions. - Do NOT claim code was removed unless `apply` ran and exited 0. - Apply path removals by moving to `.codex/trash/` (never delete directly). - On `apply`, the script runs `./scripts/verify.sh full` before and after changes. - If verification fails, the script restores moved paths and reports failure. ## Report format REFACTOR CLEAN REPORT ====================== Status: [OK/FAILED/SKIPPED] Artifacts: - Report: - Log: Next step: [review log | create plan | apply plan]