diff --git a/.changeset/add-error-recovery-guidance.md b/.changeset/add-error-recovery-guidance.md new file mode 100644 index 00000000..0d79c1d7 --- /dev/null +++ b/.changeset/add-error-recovery-guidance.md @@ -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" diff --git a/apps/create-expert/src/lib/create-expert-toml.ts b/apps/create-expert/src/lib/create-expert-toml.ts index 586663b3..db4e42f9 100644 --- a/apps/create-expert/src/lib/create-expert-toml.ts +++ b/apps/create-expert/src/lib/create-expert-toml.ts @@ -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."".skills."@perstack/base"] @@ -194,6 +199,11 @@ Help users configure required dependencies quickly and correctly. ## Success Output "✓ Setup complete! Try: npx perstack run \\"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] '''