Files
mad-skills/silent-failures-are-evil/SKILL.md
T
dckcandClaude Opus 5.5 fe9ad200c4 refactor(no-ambient-authority): rename from ocap-discipline
Name the skill for what triggers it. Cite Wikipedia on capability-based
security and ambient authority, and point newcomers to awesome-ocap.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 18:35:03 -05:00

2.0 KiB


name: silent-failures-are-evil description: No silent failures — use when writing or reviewing error handling: catch blocks, promise rejections, fallbacks for unsupported features, or any branch that treats a result as "didn't work"; when a UI shows a failure with nothing logged; when someone says "silent failure". Every failure path leaves a trace in the logs, and no failure is invented without checking what the API actually returns.

Silent failures are evil

A failure nobody can see is a failure nobody can fix. Every failure path must leave a trace.

the rules

  • Log every failure path: a caught exception, a rejected promise, a falsy result treated as "didn't work", an unsupported-feature fallback. Changing a label on screen is not enough — log it, with an event tag for grepping, and no secrets (no keys, cookies, header or param values).
  • Don't invent failures. Before branching on a result, check what the API actually returns (the spec or MDN, not a guess). A success misreported as failure is as bad as a failure reported as nothing.
  • Say only what you know. When an API can't tell you the outcome, report what it did tell you ("offered", not "saved").
  • Make it testable. Pass the logger in (see no-ambient-authority) so a test can assert that the failure path logged; a discovered silent failure is a goof that owes a test (lazy-tdd).

the goof that prompted this

diigo-cache's password-manager save button said "not saved", with nothing in the console. The code read c ? "saved" : "not saved" on the result of CredentialsContainer.store(), which resolves with undefined per spec — even on success. So every save was reported as a failure, silently. The fix (capsite/diigo-cache/src/pm-save.ts) reports "offered", logs every outcome, and is covered by tests/pm-save.test.ts.