fallback-required

fallback-required is a skill for Claude Code, Codex from RBraga01/builder-ai. It costs 51 tokens per session (1,193 once invoked), scanned A, original, MIT.

A reliability checklist for software that calls a large language model, requiring a defined safe response for timeouts, invalid output, low confidence, and refusals.

In plain words
What is it for?
Use it when adding or changing model calls, streaming generation, asynchronous generation, tool use, or agent workflows.
Why use it?
It prevents model failures from reaching users as broken results or unexplained errors.

Skill for Claude CodeCodex

Part of the builder-ai plugin — 8 skills, 5 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/rbraga01/builder-ai/fallback-required
Any agent
npx skills add RBraga01/builder-ai --skill fallback-required
Clone the repo
git clone --depth 1 https://github.com/RBraga01/builder-ai

Made for: Claude Code, Codex.

Or install builder-ai, the plugin that ships this one along with the rest of its 8 skills, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fallback-required

README.md
[![agentmods](https://agentmods.dev/badge/skills/rbraga01/builder-ai/fallback-required.svg)](https://agentmods.dev/skills/rbraga01/builder-ai/fallback-required)
Your own site
<a href="https://agentmods.dev/skills/rbraga01/builder-ai/fallback-required"><img src="https://agentmods.dev/badge/skills/rbraga01/builder-ai/fallback-required.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,193 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00051 $0.01193
Opus 5 $0.00026 $0.00596
Sonnet 5 $0.00010 $0.00239
Haiku 4.5 $0.00005 $0.00119

Measured 4d ago against content hash 891e5cb1eb9c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fallback-required scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/fallback-required/SKILL.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fallback Required

The Law

LLM CALLS WITHOUT FALLBACKS ARE TICKING FAILURES.
Every model times out. Every model returns garbage sometimes.
"The model is reliable" is a claim about averages — users experience tails.
A defined, tested fallback path for each failure mode IS reliability.

When to Use

Trigger on every PR that:

  • Adds a new LLM API call
  • Changes existing error handling on a model call
  • Adds streaming or async generation
  • Introduces tool use or agentic function calls

When NOT to Use

  • Offline batch jobs where failures can be retried with human review and no user is waiting
  • Exploratory prototypes not going to production

The Four Failure Modes

Every LLM call must handle all four:

Failure Mode What Happens Required Response
Timeout / API error Network down, provider outage, slow response Retry with exponential backoff (max 3), then graceful degradation
Malformed output Wrong format, truncated JSON, schema violation Schema validation → fallback to rule-based default
Low confidence Model expresses uncertainty, output score below threshold Route to fallback model, simpler rule, or human review
Refusal Model declines to answer, content filter triggered Detect refusal pattern → user-friendly error, do not surface raw refusal

The Process

Step 1 — Define the Fallback Before Writing the Call

Before writing the LLM call, answer: what does this feature return when the model fails?

The fallback must be:

  • User-safe — no error stack traces, no raw model output
  • Defined — not "we'll figure it out" but a concrete response or behaviour
  • Logged — every fallback invocation records the reason

Step 2 — Implement All Four Handlers

async def call_llm(prompt: str) -> Result:
    for attempt in range(MAX_RETRIES):
        try:
            response = await llm.complete(
                prompt, timeout=TIMEOUT_SECONDS
            )
            parsed = parse_and_validate(response)   # raises OutputParseError on bad schema
            if parsed.confidence < CONFIDENCE_THRESHOLD:  # default 0.7; use 0.85 for high-stakes domains
                log_fallback("low_confidence", attempt)
                return fallback_result(reason="low_confidence")
            return parsed
        except TimeoutError:
            if attempt == MAX_RETRIES - 1:
                log_fallback("timeout", attempt)
                return fallback_result(reason="timeout")
            await backoff(attempt)
        except OutputParseError:
            log_fallback("malformed_output", attempt)
            return fallback_result(reason="malformed_output")
        except RefusalError:
            log_fallback("refused", attempt)
            return fallback_result(reason="refused")
    return fallback_result(reason="max_retries_exceeded")

Read the full file on GitHub · 131 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 131 lines · 51 tokens per session scan A 891e5cb1eb9c

Subscribe to this mod's changes

fallback-required is a skill published in the GitHub repository RBraga01/builder-ai (2 stars, last pushed 1mo ago), licensed MIT. It adds 51 tokens to every session and 1,193 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

promptfoo-evals

Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions, model-graded rubrics, transforms, datasets, exports, and CI gates. Use for non-redteam eval coverage, regression tests, or new eval matrices. Do not use for adversarial redteam plugin or strategy…

promptfoo/promptfoo · 79 tokens

prompt-master

Generates optimized prompts for AI tools. Activates only when the user explicitly asks to write, fix, improve, or adapt a prompt for a specific AI tool (LLM, Cursor, Midjourney, image AI, video AI, coding agents, etc.). Does not activate for general conversation, coding tasks, document writing, or other…

nidhinjs/prompt-master · 78 tokens

prompt-optimization

Improves LLM-facing context while preserving intent, execution boundaries, and proportional work. Use when creating or reviewing prompts, agent definitions, skill definitions, or other instructions for an LLM.

shinpr/rashomon · 42 tokens

ai-engineering-toolkit

AI Engineering Toolkit workflow skill. Use this skill when the user needs 6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching and the operator…

diegosouzapw/awesome-omni-skills · 81 tokens

recipe-eval-prompt

Compares original and optimized prompts through repeated blind paired execution in git worktrees. Use when evaluating prompt improvement effects or learning prompt engineering through concrete examples.

shinpr/rashomon · 36 tokens

rag-answerer

RAG answerer that only answers from supplied context.

lizhiyao/oh-my-knowledge · 15 tokens