Dead Branches Cleanup
Removes unreachable or obsolete logic branches caused by legacy flags, impossible conditions, or retired compatibility paths while preserving intentional behavior.
SKILL.mdskills/quality/no-dead-code/dead-branches-cleanup/SKILL.md
GitHubDead Branches Cleanup
Purpose
Use this skill to remove unreachable or obsolete logic branches.
The goal is to simplify control flow after migrations, flag removals, or compatibility drops.
The core rule is simple:
Delete only branches you can prove are dead.
When to Use
Use this skill when:
- old feature flags are retired
- legacy compatibility paths are gone
- impossible conditions remain
- code after return or throw is still present
Do
Verify the branch against:
- current feature flags
- current versions
- runtime contracts
- tests
Do Not
Avoid removing branches that still serve real compatibility.
Avoid broad refactors that are unrelated to the dead branch.
Review Checklist
- The branch is provably dead.
- Compatibility implications were checked.
- Tests still describe the intended behavior.
Expected Output
- Prove the branch is dead.
- Remove it safely.
- Keep compatibility in view.
- Validate behavior.
- Keep the cleanup bounded.