Skip to content

trackbed:code:refactor-opportunities

Find refactoring candidates, tech debt, and implicit state machines in a repo, PR, path, or feature, or before a change (--for); --ranked ranks weaknesses.

/trackbed:code:refactor-opportunities [--subagent-model <model>] [full | pr | path <file-or-folder> | feature <name>] [--for <spec-file | description>] [--ranked [--solo] [--output <path>] [--max-findings N] [--base <ref>]]

Scan the full codebase, current PR, a path, or a feature for refactoring candidates and implicit state machines. Use when the user asks to find refactor opportunities, audit code quality, identify tech debt, wants a codebase health check, or asks what to refactor before a planned change (--for). Flags themes whose fix edits over 500 lines as automation candidates. User-only --ranked ranks the biggest maintainability, readability, and correctness weaknesses into CODEBASE_WEAKNESS_REPORT.md.