Agent skill

Error Recovery

by Ckokoski in Ckokoski/AuthorAgent

Intelligent error diagnosis, automatic recovery strategies, and prevention of recurring failures

MITAuto-check passed

Install Error Recovery

skills CLI
$ npx skills add Ckokoski/AuthorAgent --skill error-recovery -a claude-code

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

GitHub CLI
$ gh skill install Ckokoski/AuthorAgent error-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/Ckokoski/AuthorAgent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/core/error-recovery .claude/skills/error-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
error-recovery
GitHub stars
124
Token cost
~1.7k tokens
SKILL.md length
453 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

Intelligent error diagnosis, automatic recovery strategies, and prevention of recurring failures

  • Works in 5 steps: AI Provider Errors → Goal Execution Errors → File System Errors → …
  • SKILL.md covers Error Categories, Automatic Recovery System, Error Log and User-Facing Error Reports, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Error Recovery is an agent skill from Ckokoski/AuthorAgent. Intelligent error diagnosis, automatic recovery strategies, and prevention of recurring failures

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: The Autonomous AI Writing Agent — a secure, author-focused AI for fiction and nonfiction authors (Planning, Revision, Promotion, and more). The licence is MIT.

Example prompts

  • “/error-recovery”

Workflow steps

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

  1. AI Provider Errors
  2. Goal Execution Errors
  3. File System Errors
  4. Network/Research Errors
  5. Memory/Context Errors

What it can do on your machine

Read from SKILL.md and the folder at commit 47e9570. 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 json).

    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

Error Recovery loads about 1.7k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 453 words of instructions outside code blocks.

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

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 Ckokoski/AuthorAgent at commit 47e9570, republished under its MIT licence (© Ckokoski). 453 words, ~1,653 tokens.

Download SKILL.mdSave it as .claude/skills/error-recovery/SKILL.md (or your agent's skills folder).
name
error-recovery
description
Intelligent error diagnosis, automatic recovery strategies, and prevention of recurring failures
author
AuthorAgent
version
1.0.0
triggers
error, fix error, something broke, failed, not working, debug, troubleshoot, diagnose, recovery
permissions
file:read, file:write

Error Recovery — Core Skill

When things go wrong, AuthorAgent doesn't just report the error — it diagnoses the root cause, attempts automatic recovery, and remembers the fix for next time.

Error Categories

1. AI Provider Errors

Symptoms: API timeouts, rate limits, auth failures, model unavailability

Error Detected: Gemini API returned 429 (rate limited)

Diagnosis: Too many requests in short period (>60/min)
Recovery Strategy:
  1. ✅ Wait 30 seconds and retry (attempt 1 of 3)
  2. ⏳ Switch to DeepSeek as fallback provider
  3. ⏳ If all providers fail, queue the task for later

Lesson Stored: "Gemini rate limits at ~60 req/min.
Add 500ms delay between batch requests."

Recovery Playbook:

  • 429 Rate Limited → Wait + retry → Switch provider → Queue
  • 401 Unauthorized → Check API key in vault → Alert user if missing
  • 503 Service Unavailable → Retry with backoff → Switch provider
  • Timeout → Reduce prompt length → Retry → Switch provider
  • Content filtered → Rephrase prompt → Retry without triggering content filter
  • Context too long → Truncate prior results → Summarize context → Retry
2. Goal Execution Errors

Symptoms: Step failures, invalid AI output, parsing failures

Error Detected: Goal step "Create character profiles" failed
AI returned unstructured text instead of character profiles

Diagnosis: Prompt was too open-ended for structured output
Recovery Strategy:
  1. ✅ Reformulate prompt with explicit structure requirements
  2. ✅ Add output format example to prompt
  3. ✅ Retry with reformulated prompt

New prompt: "Create character profiles in this exact format:
NAME: [name]
AGE: [age]
ROLE: [protagonist/antagonist/supporting]
..."

Result: ✅ Step succeeded on retry

Recovery Playbook:

  • Unstructured output → Add format constraints → Retry
  • JSON parse error → Strip markdown fences → Extract JSON → Retry with stricter prompt
  • Output too short → Request longer output → Increase max tokens → Retry
  • Repeated failure → Skip step → Flag for user review → Continue goal
  • Nonsensical output → Switch provider → Reduce temperature → Retry
3. File System Errors

Symptoms: Write failures, permission denied, path not found

Error Detected: Cannot write to workspace/projects/my-novel/chapter-1.md
Permission denied

Diagnosis: Directory doesn't exist or wrong permissions
Recovery Strategy:
  1. ✅ Create directory with mkdir -p
  2. ✅ Retry write
  3. If still failing → Check sandbox permissions → Alert user

Result: ✅ Created directory and wrote file successfully

Recovery Playbook:

  • ENOENT (file not found) → Create parent directories → Retry
  • EACCES (permission denied) → Check sandbox rules → Alert user
  • ENOSPC (disk full) → Alert user with disk usage info
  • EISDIR (is a directory) → Correct the path → Retry
4. Network/Research Errors

Symptoms: Fetch timeouts, blocked domains, invalid responses

Recovery Playbook:

  • Timeout → Retry with shorter timeout → Try different URL → Skip
  • Blocked domain → Inform user → Suggest alternative source
  • Empty response → Retry → Try cached version → Use AI knowledge instead
  • SSL error → Alert user (don't bypass)
5. Memory/Context Errors

Symptoms: Context too long, corrupted memory files, missing context

Recovery Playbook:

  • Context overflow → Summarize old context → Trim to fit → Retry
  • Corrupted JSONL → Skip bad lines → Rebuild from valid entries → Alert user
  • Missing memory file → Create empty file → Continue with fresh context
Show full SKILL.md (161 more words)Show less

Automatic Recovery System

The Recovery Loop
1. Error detected
2. Classify error (provider/goal/file/network/memory)
3. Look up recovery playbook
4. Check improvement log for past fixes for this error type
5. Execute recovery strategy (up to 3 attempts)
6. If recovered:
   → Log the successful fix
   → Continue with the task
   → Store lesson for future prevention
7. If not recovered:
   → Pause the goal (don't fail silently)
   → Send clear error report to user
   → Suggest manual intervention steps
   → Store the failure for analysis
Error Prevention

The real power is preventing errors before they happen:

  1. Pre-flight checks — Before each step, verify:

    • AI provider is responsive (quick ping)
    • Required files exist and are readable
    • Sufficient disk space for output
    • API key is still valid (not expired)
  2. Pattern recognition — If an error occurred 3+ times:

    • Add automatic mitigation before the risky step
    • Example: Always add 500ms delay before Gemini calls (learned from rate limits)
  3. Graceful degradation — If the best approach fails:

    • Fall back to simpler approach
    • Use a different provider
    • Reduce scope rather than fail completely

Error Log

All errors and recoveries are logged to workspace/.audit/error-log.jsonl:

json
{
  "timestamp": "2026-02-24T15:30:00Z",
  "category": "provider",
  "error": "Gemini API 429 rate limited",
  "goalId": "goal-5",
  "stepId": "goal-5-step-3",
  "recoveryAttempts": [
    { "strategy": "wait_retry", "success": false },
    { "strategy": "switch_provider", "provider": "deepseek", "success": true }
  ],
  "resolved": true,
  "lesson": "Rate limit hit during batch execution. Added 500ms delay.",
  "preventionRule": "delay_between_gemini_calls_500ms"
}

User-Facing Error Reports

When errors can't be auto-resolved, the user gets a clear report:

⚠️ I hit a problem and couldn't fix it automatically.

What happened: Gemini and DeepSeek both returned errors
while trying to write Chapter 5.

What I tried:
  1. Retry with Gemini (3x) — failed (rate limited)
  2. Switch to DeepSeek — failed (API key expired)
  3. Switch to Ollama — not configured

What you can do:
  • Check your DeepSeek API key (may need renewal)
  • Wait 5 minutes and say "continue" to retry
  • Add an Ollama endpoint as a backup provider

Your goal is paused at step 5/12. No work was lost.

Commands

  • diagnose [error] — Analyze a specific error
  • show error log — View recent errors and recoveries
  • error stats — Error frequency and recovery success rates
  • test recovery — Simulate an error to test recovery
  • prevention rules — Show active error prevention rules

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

Files

Just SKILL.md in skills/core/error-recovery of Ckokoski/AuthorAgent.

Open the folder on GitHubat commit 47e9570

Compare with similar skills

Error 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.

Error Recovery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Error Recovery this skillCkokoski/AuthorAgent124—~1.7kAutomated safety check: PassMIT
Good Strategy Bad Strategywondelai/skills2.4k—~4.8kAutomated safety check: PassMIT
Backup Recoverysickn33/agentic-awesome-skills47k2 repos~3kAutomated safety check: WarnMIT
Disaster Recoverysickn33/agentic-awesome-skills47k2 repos~3kAutomated safety check: PassMIT
Product Strategyphuryn/pm-skills27k—~1.2kAutomated safety check: PassMIT
Marketing Strategy Pmmalirezarezvani/claude-skills28k1 repos~3.1kAutomated safety check: PassMIT

Similar skills

  • Formulate and audit real strategy using Richard Rumelt's "Good Strategy Bad Strategy": an honest diagnosis, a guiding policy, and coherent action instead of goals, vision, and wishful thinking.

    2.4k GitHub stars~4.8k tokensUpdated 29 days ago
    Business, Finance & HRAuto-check passed
  • Backup Recovery

    sickn33/agentic-awesome-skills

    Implement backup and recovery strategies. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3k tokens
    DevOps & CloudAuto-check: warnings
  • Disaster Recovery

    sickn33/agentic-awesome-skills

    Implement disaster recovery strategies and runbooks. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3k tokens
    DevOps & CloudAuto-check passed
  • Product Strategy

    phuryn/pm-skills

    Create a comprehensive product strategy using the 9-section Product Strategy Canvas — vision, segments, costs, value propositions, trade-offs, metrics, growth, capabilities, and defensibility.

    27k GitHub stars~1.2k tokensUpdated today
    Product & Project ManagementAuto-check passed
  • Marketing Strategy Pmm

    alirezarezvani/claude-skills

    Product marketing skill for positioning, GTM strategy, competitive intelligence, and product launches.

    28k GitHub starsUsed in 1 repo~3.1k tokens
    Marketing & SEOAuto-check passed
  • Launch Strategy

    alirezarezvani/claude-skills

    When the user wants to plan a product launch, feature announcement, or release strategy.

    28k GitHub stars~1.4k tokensUpdated 1 mo ago
    Marketing & SEOAuto-check passed

More from Ckokoski/AuthorAgent

All 23 skills in this repo
  • After Action Review

    Ckokoski/AuthorAgent

    Structured post-goal reflection that extracts lessons, evaluates quality, and feeds the self-improvement loop

    124 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed
  • Comp Title Finder

    Ckokoski/AuthorAgent

    Find and analyze comparable titles for query letters, marketing, and positioning strategy

    124 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Continuity Check

    Ckokoski/AuthorAgent

    Scan manuscript for inconsistencies in characters, timeline, settings, and names

    124 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Deep Voice Analysis

    Ckokoski/AuthorAgent

    Advanced 47-marker voice analysis engine — analyzes your writing to build a comprehensive Voice Profile for AuthorClaw

    124 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Dictation Cleanup

    Ckokoski/AuthorAgent

    Transform raw speech-to-text dictation into polished prose while preserving the author's natural voice

    124 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed
  • First Chapter Hook

    Ckokoski/AuthorAgent

    Analyze and rewrite first chapters for maximum reader retention using genre-specific hook patterns

    124 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Error Recovery

What does Error Recovery do?

Intelligent error diagnosis, automatic recovery strategies, and prevention of recurring failures. Error Recovery is an agent skill from Ckokoski/AuthorAgent.

How do I install Error Recovery in Claude Code?

Run `npx skills add Ckokoski/AuthorAgent --skill error-recovery -a claude-code`. Or copy the skill folder (skills/core/error-recovery in Ckokoski/AuthorAgent) into .claude/skills/error-recovery in your project. Claude Code loads it when a task matches its description.

How do I install Error Recovery in Codex?

Run `npx skills add Ckokoski/AuthorAgent --skill error-recovery -a codex`. Or copy the skill folder (skills/core/error-recovery in Ckokoski/AuthorAgent) into .agents/skills/error-recovery in your project. Codex loads it when a task matches its description.

Can I use Error 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 Ckokoski/AuthorAgent --skill error-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/error-recovery, .gemini/skills/error-recovery, .github/skills/error-recovery and .opencode/skills/error-recovery in your project.

What does Error Recovery need to run?

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

Does Error 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 Error 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 Error Recovery use?

Error 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 Error Recovery use?

About 1.7k tokens (SKILL.md is roughly 6.6k 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 Error Recovery?

Skills that share tags, products or a category with Error Recovery: Good Strategy Bad Strategy (wondelai/skills, 2.4k stars), Backup Recovery (sickn33/agentic-awesome-skills, 47k stars), Disaster Recovery (sickn33/agentic-awesome-skills, 47k stars) and Product Strategy (phuryn/pm-skills, 27k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Error Recovery?

Ckokoski (a GitHub user) maintains it in Ckokoski/AuthorAgent, which has 124 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on July 11, 2026.

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