handle-operation-failure

Diagnose and design failure handling, recovery, and propagation for software operations.

Updated May 19, 2026
One-click install
npx skills add https://github.com/wenyue/SmartKit --skill handle-operation-failure-wenyue
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: handle-operation-failure
Source: https://github.com/wenyue/SmartKit/tree/main/docs/zh-CN/skills/handle-operation-failure
Command: npx skills add https://github.com/wenyue/SmartKit --skill handle-operation-failure-wenyue

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Failure paths in software are often inconsistent: errors get swallowed, retries duplicate side effects, and recovery logic loses data without authorization. This Skill provides a structured workflow to evaluate, diagnose, and design how an operation fails, propagates errors, recovers, and reports final outcomes. ## Core Features & Use Cases - Failure Path Tracing: Follow each outcome from origin through transformation, async completion, cleanup, and final handling, including cancellation and partial side effects. - Recovery & Compensation Design: Determine valid result states, acceptable data loss and its authorization, retry safety, stop boundaries, and compensation actions. - Persisted Data Recovery: Analyze corrupted files, serialized state, and migration metadata to choose supported recovery strategies without unauthorized data loss. - Use Case: A remote create succeeds but the required local refresh fails. The Skill guides you to decide whether to retry only the refresh, compensate the creation, or report a supported partial result, then verify each path through the responsible public operation. ## Quick Start Ask the AI to evaluate the failure handling of a specific operation in your codebase, including its propagation, recovery, retry safety, and final reporting paths.

Frequently Asked Questions about handle-operation-failure

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

FAQPage Schema
How do I design failure handling for an operation in my code?▼

Start by identifying the operation's contract: success, expected absence, accepted degradation, and failure. Then trace each outcome through propagation, cleanup, and final handling, and decide supported recovery, compensation, or reporting at the responsible boundary.

How to decide whether retrying a failed operation is safe?▼

Retry safety depends on side effects like persisted writes, remote modifications, and sent events. Replay the full path including recovery and compensation; without an established idempotency mechanism, retry only the failed stage, compensate, or hand the residual state to the final owner.

When should I use this failure handling workflow?▼

Use it when writing or substantially modifying failure paths, or when choosing failure contracts, recovery, retry, data loss, or remediation strategies. It is not needed when simply following an explicitly existing propagation policy.

How do I handle corrupted persisted data or invalid serialized state?▼

First establish the data contract: owner, recovery authority, acceptable loss, and whether a default or rebuild is valid. Distinguish content-invalid evidence from I/O failure, and preserve original bytes when loss authorization is unresolved.

What are the limitations of this failure handling approach?▼

It does not grant additional remote or destructive operation permissions beyond existing authorization, and unresolved decisions about acceptable loss or ownership pause dependent implementation. Evidence gaps cannot be reported as verified paths or completed fixes.