Skip to content

refactor(create-expert): reduce template redundancy in ecosystem-builder#391

Merged
FL4TLiN3 merged 2 commits intomainfrom
refactor/381-template-redundancy
Jan 3, 2026
Merged

refactor(create-expert): reduce template redundancy in ecosystem-builder#391
FL4TLiN3 merged 2 commits intomainfrom
refactor/381-template-redundancy

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Jan 3, 2026

Summary

Extracts common error format to a single definition and simplifies ecosystem-builder templates.

Changes

  1. Added shared error format section:
## 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.
  1. Simplified templates:

    • Removed duplicate error handling sections from each template
    • Templates now reference "standard error format" instead of repeating it
    • Reduced verbose explanations
  2. Removed time-based criterion:

    • "Setup expert should complete in < 2 minutes" (untestable)

Before/After comparison

Before (Setup template):

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

After (Setup template):

## On Failure
Suggest running <name>-doctor for diagnostics.

(Error format is now defined once in the shared section)

Closes #381

Test plan

  • CI passes
  • No behavior changes expected (templates simplified, same intent)

Note

Consolidates error handling and simplifies templates in ecosystem-builder.

  • Adds shared "## Error Format (all ecosystem experts)" section and instructs all experts to use it
  • Simplifies Main, Demo, Setup, and Doctor templates: remove duplicated error-handling text, tighten wording, and standardize sections (e.g., "Output"/"On Failure")
  • Updates Design Principles: require the standard error format; remove time-based setup target (<2 minutes)
  • Changes limited to apps/create-expert/src/lib/create-expert-toml.ts and a patch changeset; no runtime behavior changes

Written by Cursor Bugbot for commit 47e4211. This will update automatically on new commits. Configure here.

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
Copy link

codecov bot commented Jan 3, 2026

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
Copy link

Choose a reason for hiding this comment

The 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 <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]".

Fix in Cursor Fix in Web

- "❌ Failed: [what went wrong] | To fix: [specific steps]"
- Suggest running the doctor expert for diagnostics
## On Failure
Suggest running <name>-doctor for diagnostics.
Copy link

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.

Fix in Cursor Fix in Web

@FL4TLiN3 FL4TLiN3 merged commit b4f498b into main Jan 3, 2026
7 checks passed
@FL4TLiN3 FL4TLiN3 deleted the refactor/381-template-redundancy branch January 3, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: reduce template redundancy in ecosystem-builder instruction

1 participant