Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/add-error-recovery-guidance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"create-expert": patch
---

Add error recovery guidance to expert templates

Added explicit error handling sections to:
- Main Expert Template: Format for error messages with "To fix:" guidance
- Setup Expert Template: Error handling with suggestion to run doctor expert

Reinforces Design Principle #7: "All errors must include 'To fix: ...' guidance"
10 changes: 10 additions & 0 deletions apps/create-expert/src/lib/create-expert-toml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ version = "1.0.0"
description = "Brief description of main functionality"
instruction = '''
Your role and capabilities...

## Error Handling
When errors occur, provide actionable guidance:
- "❌ Error: [what went wrong] | To fix: [specific steps]"
- Never fail silently - always explain what happened and how to resolve it
'''

[experts."<name>".skills."@perstack/base"]
Expand Down Expand Up @@ -194,6 +199,11 @@ Help users configure required dependencies quickly and correctly.
## Success Output
"✓ Setup complete! Try: npx perstack run <name> \\"your query\\""

## Error Handling
When setup fails, guide the user:
- "❌ Failed: [what went wrong] | To fix: [specific steps]"
- Suggest running the doctor expert for diagnostics

## Required Dependencies
[List the specific dependencies this expert needs]
'''
Expand Down