4.3 Error Handling
Error Handling in Skills
Make your Skills robust and fault-tolerant
Robust Skills handle the unexpected gracefully. Planning for errors is what separates amateur Skills from production-ready ones.
Error Handling Strategies
Add Fallback Instructions
Tell Claude what to do when something goes wrong. Never let a skill fail silently.
Tell Claude When to Ask
If information is missing, Claude should ask instead of guessing. Guessing leads to wrong outputs.
Include Validation Checks
Have Claude verify its own output before presenting it. Self-validation catches most errors.
Handle Missing Inputs
Not every user provides perfect information. Plan for incomplete, malformed, or missing data.
Error Handling Template
## Common Issues ### MCP Connection Failure If you see "Connection refused": 1. Verify that the MCP server is running 2. Confirm that the API key is valid 3. Try reconnecting: Settings > Extensions > Reconnect ### Missing Data If required fields are empty: 1. Ask the user which fields to fill in 2. Suggest default values where appropriate 3. Never proceed with critical missing data
Defensive Instructions
Always include a 'what if' section in your Skill. For every step that could fail, write what Claude should do instead.
Error Handling Rule
A Skill without error handling is a Skill waiting to fail. Cover the top 3-5 most likely failure modes, and your Skill will handle 95 percent of real-world situations gracefully.
Jak udělat Skill odolný vůči neočekávaným vstupům.
There are no comments for now.