Advanced Skill Creator
Advanced patterns for creating complex, multi-step skills with error handling and state management.
When to Use
- Multi-step workflows with dependencies
- Skills requiring state persistence
- Complex error handling scenarios
- Integration with external APIs
Patterns
State Machine Pattern
# STATE.yaml
step: 2
status: in_progress
completed:
- step_1_auth
remaining:
- step_2_fetch
- step_3_process
errors: []
Error Recovery
# Retry with backoff
for attempt in range(3):
try:
result = api.call()
break
except APIError as e:
if attempt == 2:
raise
time.sleep(2 ** attempt)
Best Practices
- Define clear entry/exit points
- Validate inputs before processing
- Log all state transitions
- Provide rollback on failure