Skip to main content
skill CX Codex

handling-failures — Claude Code skill: no silent error swallows

handling-failures — a skill that forces AI assistants to write honest error paths. Every failure either gets logged and rethrown, returns a typed error, or shifts the system into an explicit degraded mode.

no license 25,500 installs ★ 6 updated 2026-09-11

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add riekelt/principal-engineer --skill handling-failures -a claude-code
Open on GitHub

What handling-failures does

The core contract is simple: a failure path does one of three things. Log at WARN or ERROR and rethrow. Log and return a typed failure the caller must handle. Or log and enter a documented degraded mode with something observable marking the state. Bare catch-and-continue, returning an empty list or null, and ?? fallbacks that hide a failed primary are all forbidden.

Several rules follow from this. A missing required entry in a registry or config is a build or startup failure, never a quiet default. Retries of side-effecting operations have to be idempotent. Degraded modes need a named, operator-tunable threshold where degradation becomes abort. Observability ships with the fix — the log line, counter, and alert are part of the minimum.

This skill depends on the principal-engineering skill from the same repository. When you edit code that already swallows errors, the skill demands either fixing it in the same task or flagging it as owed debt with a note on what it hides. A new silent swallow in review is an automatic blocker.

What it helps with

  • catch blocks that log nothing and keep running
  • defaulting to null or an empty list on failure
  • fallbacks that mask a broken primary source
  • degraded modes with no documented stop threshold
  • replaying non-idempotent side effects

Example prompts for the agent

  • This catch swallows an exception — rewrite it to log at ERROR and rethrow.
  • Show me how to make this ?? fallback surface the primary source failure.
  • Review this file for silent error swallows and propose fixes.

How to install handling-failures

1Skills CLI (Vercel)

npx skills add riekelt/principal-engineer --skill handling-failures -a claude-code

2Manually: put the files in place

~/.claude/skills/handling-failures/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/handling-failures/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about handling-failures

How do I install handling-failures in Claude Code?

Run npx skills add riekelt/principal-engineer --skill handling-failures -a claude-code. The skill lands in ~/.claude/skills/handling-failures/SKILL.md.

What does handling-failures do?

It sets rules for every error path: catch blocks, fallbacks, default values, retries, degraded modes. A failure must be loud — logged and rethrown, returned as a typed error, or handled through a documented degraded mode.

What does the skill depend on?

It requires the principal-engineering skill from the same riekelt/principal-engineer repository.

Similar skills

All skills for Code review and refactoring →

From the same set11

The whole set →
keeping-one-source-of-truth keeping-one-source-of-truth — an agent skill that keeps each fact in exactly one place and stops copies from drifting apart. Useful the moment a value begs to be pasted elsewhere. CX Codex +1 25,600installs testing-changes testing-changes defines test requirements for code changes, enforcing regression tests for bug fixes, edge-case coverage, and strict checks against empty test diffs. CX Codex +1 25,600installs guarding-architecture guarding-architecture enforces system boundaries by turning structural invariants into breaking build tests. Useful when code crosses module limits or adds unwanted cross-package imports. CX Codex +1 25,600installs grounding-before-coding The grounding-before-coding skill makes the agent inspect code and data before changing a project or explaining a bug. It fits unfamiliar repositories and non-trivial work. CX Codex +1 25,600installs verifying-before-done verifying-before-done — an agent skill that forces a check on the changed code's real surface and a pasted verify output before any completion claim goes out. CX Codex +1 25,600installs adding-dependencies The adding-dependencies skill helps decide whether a project needs a dependency and how to assess and update it. Use it before adding a package, SDK, or GitHub Action. CX Codex +1 25,500installs operating-safely operating-safely sets safety guards for destructive commands, secret handling, and parallel edits. It activates before dangerous operations like deleting data or restarting live processes. CX Codex +1 25,500installs scoping-changes scoping-changes is a Claude Code skill for keeping a change tied to the issue that prompted it. It activates when a fix starts expanding or parts of an agreed plan are being dropped. CX Codex +1 25,500installs

Project sponsors

Companies that keep this analytics open