Agent skill

Cascade Failure Recovery

by HKUDS in HKUDS/OpenSpace

“Handle cascading data retrieval tool failures by falling back to embedded knowledge generation”

— description from SKILL.md by HKUDS
MITAuto-check passedAgent Workflows

Install Cascade Failure Recovery

skills CLI
$ npx skills add HKUDS/OpenSpace --skill cascade-fail-recovery -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/OpenSpace cascade-fail-recovery --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/benchmarks/gdpval/skills/cascade-fail-recovery .claude/skills/cascade-fail-recovery && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cascade-fail-recovery
GitHub stars
7.8k
Token cost
~765 tokens
SKILL.md length
253 words
Files
2
Skills in repo
199
Repo updated
First seen
Licence
MIT

At a glance

  • Works in 4 steps: Recognize Cascading Failure → Preserve Task Context → Invoke Fallback Strategy → …
  • SKILL.md covers Purpose, When to Apply, Recovery Procedure and Example Application, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

About this skill

Cascade Failure Recovery is a skill in HKUDS/OpenSpace (7.8k stars). Its SKILL.md is about 765 tokens, with 1 other file in the folder. Licence: MIT.

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Recognize Cascading Failure
  2. Preserve Task Context
  3. Invoke Fallback Strategy
  4. Execute write_file

What it can do on your machine

Read from SKILL.md and the folder at commit 3827781. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cascade Failure Recovery loads about 765 tokens when it runs. Until then it costs about 29 tokens; SKILL.md has 253 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~29
When it runs · the whole SKILL.md, loaded when a task matches
~765

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/OpenSpace at commit 3827781, republished under its MIT licence (© HKUDS). 253 words, ~765 tokens.

Download SKILL.mdSave it as .claude/skills/cascade-fail-recovery/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
cascade-fail-recovery
description
Handle cascading data retrieval tool failures by falling back to embedded knowledge generation

Cascade Failure Recovery

Purpose

When multiple data retrieval tools (read_webpage, search_web) fail in succession, immediately fall back to generating content from embedded knowledge rather than attempting repairs or abandoning the task. This preserves task context and ensures completion.

When to Apply

Use this pattern when you observe:

  • 2+ consecutive failures from data retrieval tools
  • Network/access errors preventing web content retrieval
  • Risk of task abandonment due to tool errors

Recovery Procedure

Step 1: Recognize Cascading Failure

Identify the failure pattern:

Iteration N: read_webpage failed - connection error
Iteration N+1: search_web failed - timeout/unavailable
Iteration N+2: [risk] Agent may abandon task or switch objectives
Step 2: Preserve Task Context

Before switching strategies, explicitly restate the original objective:

ORIGINAL OBJECTIVE: [Restate the core task goal]
CONTEXT PRESERVED: [Key requirements, constraints, deliverables]
Step 3: Invoke Fallback Strategy

Immediately switch to embedded knowledge generation:

  1. Acknowledge the limitation: Note that external data sources are unavailable
  2. Activate internal knowledge: Use pre-trained knowledge relevant to the task
  3. Generate content: Use write_file to create the deliverable from available knowledge
  4. Document the fallback: Note in the output what information could not be verified externally
Step 4: Execute write_file

Generate the required document:

python
# Fallback to generating from embedded knowledge
write_file(
    path="output/document.md",
    content="[Generate content from internal knowledge base]"
)

Example Application

Scenario: PACT Act veterans benefits document needed, but web access failing

Wrong approach (observed failure):

Iter 11: read_webpage failed - access error
Iter 12: search_web failed - unavailable
Iter 13: [ABANDONED] Switched to unrelated musician payroll task

Correct approach (with this skill):

Iter 11: read_webpage failed - access error
Iter 12: search_web failed - unavailable
Iter 13: CASCADE FAIL DETECTED - invoking fallback
Iter 14: write_file - generate PACT Act document from embedded knowledge
      - Note: "External verification unavailable; content based on training knowledge"

Guidelines

  1. Threshold: Trigger fallback after 2 consecutive retrieval failures
  2. No endless retries: Do not attempt more than 1 repair/retry cycle
  3. Preserve objective: Never switch to unrelated tasks when tools fail
  4. Transparency: Clearly mark any content that lacks external verification
  5. Document limitations: Note what could not be verified due to tool failures
  • write-file-fallback: Generate documents when data sources unavailable
  • task-context-preservation: Maintain objective continuity through errors

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in benchmarks/gdpval/skills/cascade-fail-recovery of HKUDS/OpenSpace.

  • SKILL.md
  • .skill_id

Open the folder on GitHubat commit 3827781

Compare with similar skills

Cascade Failure Recovery next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cascade Failure Recovery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cascade Failure Recovery this skillHKUDS/OpenSpace7.8k—~765Automated safety check: PassMIT
Show Me Your Work Decision Logcursor/plugins11k8 repos~1.6kAutomated safety check: PassNone
Scope Creep Guardlennney/stop-that-shit2.5k1 repos~2kAutomated safety check: PassMIT
Verification Before Completionfarm-fe/farm5.6k47 repos~1kAutomated safety check: PassMIT
PUA High-Agency Governancetanweai/pua20k—~502Automated safety check: PassMIT
Loop Change Verifiercobusgreyling/loop-engineering11k1 repos~709Automated safety check: PassMIT

Similar skills

  • Official

    Keeps a TSV decision log for long or unattended agent runs, one row per decision with what, why, evidence and result, so a reviewer can check the work later.

    11k GitHub starsUsed in 8 repos~1.6k tokens
    Agent WorkflowsAuto-check passed
  • Scope Creep Guard

    lennney/stop-that-shit

    Keeps an agent focused on the requested work by applying a five-step ladder that checks for direct solutions, real gaps and speculative defenses before adding anything.

    2.5k GitHub starsUsed in 1 repo~2k tokens
    Agent WorkflowsAuto-check passed
  • A skill your agent uses when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any…

    5.6k GitHub starsUsed in 47 repos~1k tokens
    Agent WorkflowsAuto-check passed
  • Pushes an agent to keep verifying and changing approach after repeated failures, using a diagnosis line, evidence-based completion and confirmation before risky edits.

    20k GitHub stars~502 tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Loop Change Verifier

    cobusgreyling/loop-engineering

    Acts as a skeptical checker for changes an implementer sub-agent made, running the tests, confirming the diff scope and returning approve, reject or escalate to a human.

    11k GitHub starsUsed in 1 repo~709 tokens
    Agent WorkflowsAuto-check passed
  • Incremental Implementation

    addyosmani/agent-skills

    Delivers a change in thin vertical slices, each implemented, tested, verified and committed before the next, using vertical, contract-first or risk-first slicing.

    105k GitHub starsUsed in 1 repo~2.3k tokens
    Agent WorkflowsAuto-check passed

More from HKUDS/OpenSpace

All 199 skills in this repo
  • Walks through producing a master audio track plus stems in Python, from checking a reference file and timing sections by BPM to effects, a zip archive and final verification.

    7.8k GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Gives an agent a workaround when its code-execution sandbox keeps failing: save the Python script to a file and run it through the shell instead.

    7.8k GitHub stars~588 tokensUpdated 1 mo ago
    Auto-check passed
  • A recovery routine for agents whose sandboxed code runner keeps failing: save the Python script to disk, then run it through the shell and read the output.

    7.8k GitHub stars~652 tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback ladder for failed sandboxed code runs, plus the habit of fixing the working directory first so generated files land in the right place.

    7.8k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback workflow for executing Python code when executecodesandbox fails repeatedly

    7.8k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Generate documents with writefile when retrieval tools fail, with explicit guardrails against task context drift

    7.8k GitHub stars~2.6k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Cascade Failure Recovery

How do I install Cascade Failure Recovery in Claude Code?

Run `npx skills add HKUDS/OpenSpace --skill cascade-fail-recovery -a claude-code`. Or copy the skill folder (benchmarks/gdpval/skills/cascade-fail-recovery in HKUDS/OpenSpace) into .claude/skills/cascade-fail-recovery in your project. Claude Code loads it when a task matches its description.

How do I install Cascade Failure Recovery in Codex?

Run `npx skills add HKUDS/OpenSpace --skill cascade-fail-recovery -a codex`. Or copy the skill folder (benchmarks/gdpval/skills/cascade-fail-recovery in HKUDS/OpenSpace) into .agents/skills/cascade-fail-recovery in your project. Codex loads it when a task matches its description.

Can I use Cascade Failure Recovery in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/OpenSpace --skill cascade-fail-recovery -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cascade-fail-recovery, .gemini/skills/cascade-fail-recovery, .github/skills/cascade-fail-recovery and .opencode/skills/cascade-fail-recovery in your project.

What does Cascade Failure Recovery need to run?

SKILL.md names no scripts, command-line tools or credentials: Cascade Failure Recovery is instructions for the agent only.

Does Cascade Failure Recovery access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cascade Failure Recovery safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cascade Failure Recovery use?

Cascade Failure Recovery is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cascade Failure Recovery use?

About 765 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cascade Failure Recovery?

Skills that share tags, products or a category with Cascade Failure Recovery: Show Me Your Work Decision Log (cursor/plugins, 11k stars), Scope Creep Guard (lennney/stop-that-shit, 2.5k stars), Verification Before Completion (farm-fe/farm, 5.6k stars) and PUA High-Agency Governance (tanweai/pua, 20k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cascade Failure Recovery?

HKUDS (a GitHub organization) maintains it in HKUDS/OpenSpace, which has 7,754 GitHub stars. The repository holds 199 skills in this directory. The repository was last updated on August 12, 2026.

Source: HKUDS/OpenSpace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.