-
Notifications
You must be signed in to change notification settings - Fork 1
refactor(create-expert): reduce template redundancy in ecosystem-builder #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "create-expert": patch | ||
| --- | ||
|
|
||
| Reduce template redundancy in ecosystem-builder | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,6 +119,16 @@ When external dependencies exist (API keys, services, environment variables): | |
| - **Setup Expert**: Guides users through configuration | ||
| - **Doctor Expert**: Diagnoses configuration issues | ||
|
|
||
| ## Error Format (all ecosystem experts) | ||
|
|
||
| All errors must follow this format: | ||
| \`\`\` | ||
| ❌ [Type]: [description] | To fix: [actionable steps] | ||
| \`\`\` | ||
|
|
||
| Where [Type] is: Error, Failed, or Issue depending on context. | ||
| Never fail silently - always explain what happened and how to resolve it. | ||
|
|
||
| ## Expert Templates | ||
|
|
||
| ### Main Expert Template | ||
|
|
@@ -129,10 +139,7 @@ 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 | ||
| [Include domain knowledge, policies, and expected behavior] | ||
| ''' | ||
|
|
||
| [experts."<name>".skills."@perstack/base"] | ||
|
|
@@ -150,33 +157,13 @@ description = "Interactive demo with sample data - no setup required" | |
| instruction = ''' | ||
| You demonstrate the capabilities of <name> using built-in sample data. | ||
|
|
||
| ## Your Role | ||
| Show users what the expert can do WITHOUT requiring any setup or API keys. | ||
|
|
||
| ## Demo Mode | ||
| - Use the embedded sample data below (do NOT make API calls) | ||
| - Demonstrate key features with realistic examples | ||
| - Use embedded sample data (do NOT make API calls) | ||
| - Show expected output format | ||
| - Explain what would happen with real configuration | ||
| - Explain what real configuration would enable | ||
|
|
||
| ## Embedded Sample Data | ||
| IMPORTANT: Include actual sample data here, not placeholders. | ||
| Example for a search expert: | ||
| \`\`\`json | ||
| { | ||
| "query": "machine learning tutorials", | ||
| "results": [ | ||
| {"title": "ML Basics", "url": "https://example.com/ml", "snippet": "Learn the fundamentals..."}, | ||
| {"title": "Deep Learning Guide", "url": "https://example.com/dl", "snippet": "Advanced neural networks..."} | ||
| ] | ||
| } | ||
| \`\`\` | ||
|
|
||
| ## Output | ||
| Provide a realistic demonstration that helps users understand: | ||
| 1. What this expert does | ||
| 2. What kind of input it expects | ||
| 3. What output they will get | ||
| [Include actual sample data - not placeholders] | ||
| ''' | ||
|
|
||
| [experts."<name>-demo".skills."@perstack/base"] | ||
|
|
@@ -194,26 +181,19 @@ description = "Automated setup wizard for <name>" | |
| instruction = ''' | ||
| You guide users through setting up <name>. | ||
|
|
||
| ## Your Role | ||
| Help users configure required dependencies quickly and correctly. | ||
|
|
||
| ## Configuration Policies | ||
| - Check .env file and environment variables first | ||
| - Check .env file and environment first | ||
| - For missing items: explain purpose, provide signup URL, validate format | ||
| - Save configuration to .env file | ||
| - Verify with a simple test before confirming success | ||
| - Target: Complete setup in under 2 minutes | ||
| - Save to .env file and verify before confirming | ||
|
|
||
| ## 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 | ||
| ## On Failure | ||
| Suggest running <name>-doctor for diagnostics. | ||
|
|
||
| ## Required Dependencies | ||
| [List the specific dependencies this expert needs] | ||
| [List specific dependencies] | ||
| ''' | ||
|
|
||
| [experts."<name>-setup".skills."@perstack/base"] | ||
|
|
@@ -231,16 +211,13 @@ description = "Diagnose and fix issues with <name>" | |
| instruction = ''' | ||
| You diagnose and help fix issues with <name>. | ||
|
|
||
| ## Your Role | ||
| Run diagnostics and provide actionable fixes for common problems. | ||
|
|
||
| ## Diagnostic Areas | ||
| - Environment: Verify variables exist and are properly formatted | ||
| - Connectivity: Test network access to required services | ||
| - Configuration: Run test query and analyze errors | ||
| - Environment: Verify variables exist and format | ||
| - Connectivity: Test network access | ||
| - Configuration: Run test query and analyze | ||
|
|
||
| ## Output Format | ||
| For issues: "❌ Issue: [problem] | To fix: [steps]" | ||
| ## Output | ||
| For issues: Use standard error format | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doctor template references undefined "standard error format"The doctor expert template instruction says "Use standard error format" but this references a definition (lines 122-130) that only exists in the ecosystem-builder's meta-instructions. When an actual |
||
| If healthy: "✓ All checks passed! <name> is ready to use." | ||
| ''' | ||
|
|
||
|
|
@@ -257,8 +234,7 @@ pick = ["readTextFile", "exec", "attemptCompletion"] | |
| 3. Use @perstack/base for file/shell operations | ||
| 4. ALWAYS use pick for minimal privilege | ||
| 5. Demo expert must work WITHOUT any setup | ||
| 6. Setup expert should complete in < 2 minutes | ||
| 7. All errors must include "To fix: ..." guidance | ||
| 6. All errors must follow the standard error format above | ||
| ` | ||
|
|
||
| const FUNCTIONAL_MANAGER_INSTRUCTION = `You verify functional quality through three test categories. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setup template removes error format guidance entirely
The setup expert template's "On Failure" section now only instructs to suggest running the doctor expert, but completely omits guidance on how to format the error message itself. The original template explicitly included
"❌ Failed: [what went wrong] | To fix: [specific steps]"before suggesting the doctor. Unlike the doctor template which at least references "standard error format", this template has no error formatting instruction at all, meaning created setup experts may not report failures in the expected format.