Agent skill · Security

narrow-bare-rescue

Narrow bare rescue in Elixir so real errors like KeyError and typos propagate instead of being swallowed. Use to audit rescues and refactor error handling.

oliver-kriskagithub.com/oliver-kriskaGitHub ↗
claude-codeMIT
Install
npx skills add oliver-kriska/claude-elixir-phoenix --skill narrow-bare-rescue --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 3
SKILL.md size: 5 KB
Bundled scripts: none
Path: plugins/elixir-phoenix/skills/narrow-bare-rescue/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 515
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Narrow Bare Rescue Turn `rescue _ -> fallback` into `rescue _ in [ExceptionType1, ExceptionType2] -> fallback` so programmer bugs propagate while known failure modes stay handled. ## Why this matters Bare rescues (`rescue _ ->`, `rescue e ->` — any form without an `in` clause) swallow **every** exception, including `UndefinedFunctionError` from typos, `KeyError` from misspelled map keys, and `CompileError` from bad HEEx templates. The symptom isn't a stack trace — it's a silent `{:error, :generic}` or a `nil` fallback. Bugs that should surface in tests or error reporters become quiet degradations. The Erlang [Secure Coding Guide](https://www.erlang.org/doc/system/secure_coding.html) makes the same case at the BEAM level — rule **LNG-002** ("Do Not Use `catch`") warns that the legacy catch-all form conflates normal returns, throws, and errors. Bare `rescue` in Elixir is the direct analogue. ## Iron Laws 1. **Never leave `rescue _ ->` or `rescue e ->` without an `in` clause.** Every rescue must list exact exception types. The Credo check enforces this after cleanup lands. 2. **Cover every exception the code path can actually raise.** Narrowing that drops a real exception is a behav

What's inside
Steps it walks through
  1. Why this matters
  2. Iron Laws
  3. The core transform
  4. Workflow
  5. Step 1 — Find the sites
  6. Step 2 — Determine the exception set for each bare site
  7. Step 3 — Apply the narrowing
  8. Step 4 — Verify
  9. Scope
  10. References
Ships with 2 files
  • references/patterns.md
  • references/taxonomy.md
Commands it runs
grep -rn "^\s*rescue\s*$" <scope> | head -200
grep -rn "defexception" deps/<libname>/lib/ | head -10
mix compile --warnings-as-errors
mix format <files_changed>
mix test <test_files_for_affected_modules>
More from claude-elixir-phoenix
All skills →
About this skill
What does the narrow-bare-rescue skill do?

Narrow bare rescue in Elixir so real errors like KeyError and typos propagate instead of being swallowed. Use to audit rescues and refactor error handling.

How do I install it?

Run `npx skills add oliver-kriska/claude-elixir-phoenix --skill narrow-bare-rescue --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From oliver-kriska/claude-elixir-phoenix, a repository with 515 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going