What problem does it solve?
Bare rescue _ -> clauses in Elixir swallow every exception, including UndefinedFunctionError from typos and KeyError from misspelled map keys, turning real bugs into silent {:error, :generic} fallbacks. This Skill audits those rescues and rewrites them to catch only the exception types the code path can actually raise.
Core Features & Use Cases
- Rescue auditing: Finds bare
rescue _ -> and rescue e -> sites across a single file, a directory, or the whole project, skipping already-typed rescues.
- Verified exception taxonomy: Ships reference tables of exact exception types per work category (Jason, Ecto/Postgrex, Req, ExAws, ExCmd, Money/Decimal, Plug, LiveView HEEx, NimbleCSV), including gotchas like
Phoenix.LiveView.Tokenizer.ParseError and internal NimbleCSV structs.
- Refactoring patterns: Provides module-attribute hoisting for repeated rescue sets, Oban log-and-reraise with
__STACKTRACE__, is_exception/1 replacements, large-cleanup partitioning, and a Credo check to prevent regressions.
- Use Case: Run it on
lib/my_app/ to convert every bare rescue into a typed list, then verify with mix compile --warnings-as-errors and the affected tests.
Quick Start
Ask the AI to audit and narrow all bare rescue clauses in lib/my_app/util/ using the narrow-bare-rescue skill, then compile and run the affected tests.