← ClaudeAtlas

dead-branch-scanlisted

Find unreachable code branches — code after return, conditions that can never be true, and feature flags always on/off.
adnanmokhtar/refract · ★ 1 · AI & Automation · score 77
Install: claude install-skill adnanmokhtar/refract
# dead-branch-scan Static + runtime detection of code that never executes. Dead code hides bugs, inflates bundles, and confuses readers. ## Premise Find real issues, cite `<path:line>` for every finding. "DEFINITELY DEAD" requires either a linter rule firing (`no-unreachable`) or a literal `if (false)` / `if (true)`. "LIKELY DEAD" requires type-narrowing analysis pointing at the specific catch / branch. Feature-flag findings cite the flag name + its current config + the age from `git log`. Coverage-zero branches cite `lcov.info` line + sibling branch hits to confirm reachability is real, not test gap. ## Halt conditions - Refuse to mark "delete" without the linter or coverage data backing the verdict. - **Refuse a clean verdict from an unresolved lane.** No reachability tool for the project's language means the scan did not run; report `NO LANE` with the tool that would settle it (§ Procedure step 0). Zero findings from a tool that was never invoked is the one output of this skill that is indistinguishable from success. - Refuse to flag exhaustiveness `default: const _: never = x` — that's intentional. - Halt if the build doesn't compile — reachability analysis is unreliable on broken types. - Don't auto-delete; propose, get author confirmation, ship as a separate cleanup PR. - Tests intentionally hit "impossible" paths via mocks — exclude the project's test directories + naming patterns (`__tests__/` / `tests/` / `spec/` and `*.spec.<ext>` / `test_*.py` / `*_test.go` /