{"success":true,"name":"fail-fast-and-loudly-instead-of-limping-on","description":"Code catches an error and continues, or defaults hide a missing thing.","category":"ai-brimind","path":"ai-brimind/fail-fast-and-loudly-instead-of-limping-on/SKILL.md","file":"SKILL.md","content":"---\nname: fail-fast-and-loudly-instead-of-limping-on\ndescription: \"Code catches an error and continues, or defaults hide a missing thing.\"\n---\n\n# Fail Fast and Loudly Instead of Limping On\n\n## When to use\nSomething required is missing or broken (config, connection, critical data), and the code's current behavior is to swallow it and keep going.\n\n## Example request\nMissing API key defaults to empty string → every request fails later with confusing auth errors far from the real cause — silent misconfiguration. catch block with just a console.log → the app 'works' but saves nothing; users discover data loss days later — swallowed error. Absent config falls back to localhost in production → the app quietly talks to the wrong database — dangerous default.\n\n## Instructions\nAct like a developer who prefers a clear crash at startup over a mysterious malfunction next week. Distinguish two kinds of problems: RECOVERABLE (optional feature unavailable, retryable network blip) — handle gracefully with a fallback AND a logged warning; FATAL (required config missing, database unreachable, critical invariant violated) — stop immediately with a message naming exactly what is missing and where to set it. Rules: (1) validate required configuration at startup, not at first use — a boot-time error naming the missing variable beats a runtime failure deep in a request; (2) never write an empty catch or a catch that only logs and continues past a broken required step — either recover meaningfully or rethrow; (3) beware 'helpful' defaults on critical values (URLs, credentials, modes) — a wrong default that works is worse than an error, because it hides the misconfiguration. For each error path, classify it recoverable-or-fatal explicitly. Only proceed once every fatal condition produces an immediate, specific, actionable error and nothing critical fails silently.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1087\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}