Claude Code narrow-bare-rescue skill: Review Elixir exception handling
Trace the calls inside a broad rescue and identify which exceptions represent expected failures. The skill helps preserve the fallback for those cases while exposing unexpected programming errors.
中文Install in Claude Code
Use a practice Elixir and Mix project. Keep the bundled exception taxonomy and patterns with the skill.
- Download the repository snapshot at the linked commit. Copy the entire plugins/elixir-phoenix/skills/narrow-bare-rescue/ directory into .claude/skills/narrow-bare-rescue/ in your practice project.
- Check that SKILL.md is directly inside .claude/skills/narrow-bare-rescue/. Open Claude Code from the project root.
- Enter /narrow-bare-rescue to start the example below.
Example task
Write a sample function that calls String.to_integer and returns :invalid from a broad rescue. Run /narrow-bare-rescue for the file and ask which exception to handle and which inputs to test.What to check
Look for a proposal to handle ArgumentError and tests for a valid number and a malformed string. Compile and run the relevant tests after applying a change.
Original SKILL.md on GitHub · Updated
Frequently asked question
How can I keep expected failures working after narrowing rescue?
List the expected failure paths, confirm the exception type for each, and test the expected success and failure inputs.