refactor(create-expert): reduce template redundancy in ecosystem-builder#391
refactor(create-expert): reduce template redundancy in ecosystem-builder#391
Conversation
Extract common error format to single definition and simplify templates. Changes: - Add "Error Format (all ecosystem experts)" section with standard format - Remove duplicate error handling sections from each template - Simplify template instructions (remove redundant explanations) - Reference "standard error format" instead of repeating it - Remove "Setup expert should complete in < 2 minutes" (time-based, untestable) Before: Each template had its own error handling section with slight variations After: Single error format definition, templates reference it Closes #381 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| ## Output Format | ||
| For issues: "❌ Issue: [problem] | To fix: [steps]" | ||
| ## Output | ||
| For issues: Use standard error format |
There was a problem hiding this comment.
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 <name>-doctor expert is created from this template, its instruction won't include what "standard error format" means since that definition is outside the template's instruction = '''...''' block. The original code explicitly included the format inline: "❌ Issue: [problem] | To fix: [steps]".
| - "❌ Failed: [what went wrong] | To fix: [specific steps]" | ||
| - Suggest running the doctor expert for diagnostics | ||
| ## On Failure | ||
| Suggest running <name>-doctor for diagnostics. |
There was a problem hiding this comment.
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.
Summary
Extracts common error format to a single definition and simplifies ecosystem-builder templates.
Changes
Simplified templates:
Removed time-based criterion:
Before/After comparison
Before (Setup template):
After (Setup template):
(Error format is now defined once in the shared section)
Closes #381
Test plan
Note
Consolidates error handling and simplifies templates in
ecosystem-builder.Main,Demo,Setup, andDoctortemplates: remove duplicated error-handling text, tighten wording, and standardize sections (e.g., "Output"/"On Failure")apps/create-expert/src/lib/create-expert-toml.tsand a patch changeset; no runtime behavior changesWritten by Cursor Bugbot for commit 47e4211. This will update automatically on new commits. Configure here.