Skip to content
Back to skills

Error Audit

ASecurity

Audit code for silent error swallowing, fallbacks to degraded alternatives, backwards compatibility shims, and UI that fails to show errors to the user. Finds and fixes all occurrences in the specified scope.

  • 182 stars
  • 0 votes
  • 0 copies
  • 9 views
  • Added September 8, 2026
developmentgoapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add markmdev/meridian --skill error-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Error Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Error Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/markmdev-error-audit/badge)](https://www.skillsdirectory.com/skills/markmdev-error-audit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: error-audit
description: Audit code for silent error swallowing, fallbacks to degraded alternatives, backwards compatibility shims, and UI that fails to show errors to the user. Finds and fixes all occurrences in the specified scope.
---

# Error Audit

The core principle: **every error belongs to the user**. Not to a catch block, not to a console, not to a null return. Scan the specified code, fix every violation, report what changed.

## Step 0: Understand the app's error mechanisms

Before fixing anything, identify how this app surfaces errors to users — toast notifications, error banners, error boundaries, returned error states, alert dialogs, inline messages. Use these patterns exclusively. Don't invent a new one.

## Anti-patterns to find and fix

**Silent error swallowing — backend/logic layer:**
- Empty catch blocks: `catch(e) {}`
- Log-and-continue: `catch(e) { console.error(e) }` with execution proceeding normally
- `.catch(() => {})` on promises
- Functions returning `null`, `undefined`, or empty defaults on failure instead of throwing

**Silent error swallowing — UI layer:**
- Data fetching catches an error and returns null/empty → component renders blank with no explanation
- Error boundaries that catch but show nothing (or a generic "something went wrong" with no recovery path)
- `try/catch` in a loader or server action that swallows the error and returns partial/empty data
- Async operations where the UI has no error state at all — success renders fine, failure renders identical to loading or empty

**Fallbacks to degraded alternatives:**
- Catch → silently switch to a worse model, API, or service
- Catch → return cached or stale data without telling the user
- Catch → offline/degraded mode with no visible indication

**Backwards compatibility shims:**
- `if (legacyFormat)` or `if (oldVersion)` branches
- Deprecated fields still being populated alongside new ones
- Old code paths running in parallel with new ones

**Config defaults that hide misconfiguration:**
- `process.env.X || 'fallback'` for required values — missing required config is a startup crash, not a default
- Optional environment variables that should be required

**Optional chaining hiding missing required data:**
- `user?.profile?.name ?? 'Guest'` when profile must always exist — the absence is a bug, not an edge case to handle silently

## Fix principles

- Throw or re-throw rather than catch-and-continue
- In the UI: every error path must render something visible — use the app's established error display mechanism
- Required config missing at startup → log a clear message and exit
- Delete fallback branches — don't comment them out
- When unsure if a fallback was intentional, flag it in your report rather than guessing

## Reference files
- `references/error-patterns.md` — Concrete anti-patterns with structural descriptions, bad/good code examples, and false positive notes. Read this before starting the audit.

## Report

After fixing, summarize by file: what was found, what the fix was. Be specific — file paths and the pattern removed.

Files in this skill

  • SKILL.md3 KB
  • references/error-patterns.md24.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.