Ash Framework — resources, actions, policies, aggregates; Use when generating resources via mix ash.codegen, editing…
日本語の概要は準備中です。原文の説明を表示しています。
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.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Turn rescue _ -> fallback into rescue _ in [ExceptionType1, ExceptionType2] -> fallback
so programmer bugs propagate while known failure modes stay handled.
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 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.
rescue _ -> or rescue e -> without an in clause. Every rescue must
list exact exception types. The Credo check enforces this after cleanup lands.UndefinedFunctionError,
CompileError, BadFunctionError, and BadArityError must propagate.reraise e, __STACKTRACE__, never reraise e, []. Preserve the original stack
trace so Oban retry metadata and error reporters show the real origin.mix compile --warnings-as-errors before committing. Typos in exception module
names only surface at compile time — the code looks fine until it loads.# Before — masks programmer bugs
def parse(body) do
Jason.decode!(body)
rescue
_ -> %{}
end
# After — catches only what can actually fail here
def parse(body) do
Jason.decode!(body)
rescue
_ in [Jason.DecodeError, ArgumentError] -> %{}
end
Applies identically to try … rescue … and to function-body def … rescue ….
The skill operates in three modes depending on scope:
/narrow-bare-rescue path/to/file.ex/narrow-bare-rescue lib/my_app/util//narrow-bare-rescue --allWhatever the scope, follow this sequence.
grep -rn "^\s*rescue\s*$" <scope> | head -200
For each hit, read the 3 lines after to classify:
rescue _ -> or rescue var -> — bare, needs narrowingrescue _ in [...] -> or rescue var in Something -> — already typed, skiprescue ExceptionType -> (no variable binding) — already typed, skipRead the try / def body and trace what each call can raise. Don't guess from the
function name — verify. Consult order:
Check ${CLAUDE_SKILL_DIR}/references/taxonomy.md for the work type (JSON, Ecto, Money, HTTP, etc.).
Most sites map cleanly to one row.
Grep deps for defexception when a specific library isn't in the taxonomy:
grep -rn "defexception" deps/<libname>/lib/ | head -10
Check raise calls in the code path itself — if the body explicitly raises
RuntimeError, include it.
Priorities: cover everything the code can actually raise, exclude programmer-bug
exceptions (see Iron Law #3), and prefer specific types (Jason.DecodeError beats
ArgumentError if both could apply).
For files with ≥3 rescues sharing a taxonomy, hoist to a module attribute — see
${CLAUDE_SKILL_DIR}/references/patterns.md for the module-attribute pattern, Oban reraise, ExCmd exit
errors, and is_exception/1 replacements.
After changes in each file (or cluster of files), run:
mix compile --warnings-as-errors
mix format <files_changed>
mix test <test_files_for_affected_modules>
The compile step catches typos in exception module names — a real risk since you're writing module names from memory.
This skill narrows bare rescue clauses. It does not:
rescue e in [X] ->) — those are correctcatch clauses — throws and exits from the process are a separate concerntry/rescue with with or error-tuple plumbing — that's a larger refactor${CLAUDE_SKILL_DIR}/references/taxonomy.md — verified exception types per work
category, plus library-specific gotchas (NimbleCSV, Plug, Phoenix LiveView tokenizer)${CLAUDE_SKILL_DIR}/references/patterns.md — special patterns: is_exception/1,
Oban reraise, ExCmd exit errors, module-attribute hoisting, partitioning large
cleanups, the regression-prevention Credo checkcatch
— BEAM-level rationale for preferring narrow try ... catch / try ... rescue over
the legacy catch-all formまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Ash Framework — resources, actions, policies, aggregates; Use when generating resources via mix ash.codegen, editing…
日本語の概要は準備中です。原文の説明を表示しています。
Ash Framework — resources, actions, policies, aggregates, calculations, AshPhoenix.Form, LiveView, migrations. Use when generating resources via mix ash.codegen, editing changes, checks, types, validations, or domain code interfaces.
日本語の概要は準備中です。原文の説明を表示しています。
Compatibility alias for the Elixir/Phoenix plugin's LiveView assigns audit. Invoke explicitly with /lv:assigns.
日本語の概要は準備中です。原文の説明を表示しています。
Inspect LiveView socket assigns for memory bloat — missing temporary_assigns, unused assigns, unbounded lists needing streams, memory estimates. Use when LiveView memory grows or you need to add temporary_assigns.
日本語の概要は準備中です。原文の説明を表示しています。
Project health audit and health check — architecture, performance, tests, dependencies, code quality. Use when assessing overall project health, before releases, or after refactors.
日本語の概要は準備中です。原文の説明を表示しています。
Analyze Phoenix context boundaries and module coupling via mix xref. Use when checking cross-context calls, validating dependencies, before splitting modules, or reviewing architecture.
日本語の概要は準備中です。原文の説明を表示しています。