error-handling

Convert tool errors into readable LLM feedback with typed propagation.

5|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/TechyMT/claude-code-superpowers --skill error-handling-techymt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/TechyMT/claude-code-superpowers/tree/main/skills/error-handling
Command: npx skills add https://github.com/TechyMT/claude-code-superpowers --skill error-handling-techymt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Surface structured tool errors to the LLM to produce readable, actionable feedback during tool execution and tool result interpretation.

Core Features & Use Cases

  • Typed error propagation: throw typed errors from tools and formatError translates them into clean LLM messages.
  • Abort handling: propagate AbortError to signal clean cancellation instead of raw stack traces.
  • User-facing context: convert common errors like ENOENT into helpful, actionable prompts for resolution.
  • Use Case: when a tool reads a file or runs a subprocess, the skill ensures failures are reported with context.

Quick Start

Wrap tool calls in try-catch blocks, throw typed errors when failures occur, and let the framework format them for the LLM.

Frequently Asked Questions about error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I surface structured tool errors to an LLM for actionable feedback?

To surface structured tool errors to an LLM, wrap tool calls in try-catch blocks and throw typed errors. The framework translates these into clean, readable messages, providing actionable feedback for tool result interpretation.

What is the best way to handle ENOENT errors in tool-based workflows?

Handling ENOENT errors involves converting them into user-facing context. The framework transforms common file or subprocess errors into helpful, actionable prompts, ensuring failures are reported with clear guidance for resolution.

How do I propagate AbortError to signal clean cancellation instead of stack traces?

Propagating AbortError involves throwing the typed error during tool execution. The framework catches it to signal a clean cancellation, preventing raw stack traces from surfacing to the LLM or user interface.

Does this approach work with typed error propagation for shell errors?

Yes, typed error propagation works with shell errors. You can throw typed ShellError objects from tools, and the formatError function translates them into clean LLM messages, maintaining structured error context.

Why do raw stack traces appear in LLM messages during tool execution?

Raw stack traces appear because typed errors are not being propagated or formatted correctly. By enforcing typed error propagation and using formatError, the system ensures failures are reported with context instead of raw traces.