fix(opencode-plugin): enrich workflow parameter description from YAML metadata#277
Merged
Conversation
… metadata
The OpenCode plugin's start-development tool previously showed only
"Workflow name" as the workflow parameter description, missing rich
metadata (complexity, bestFor, examples) from workflow YAML files.
Root cause: generateWorkflowDescription() and buildWorkflowEnum() in
@codemcp/workflows-server were not exported, making them unavailable
to external consumers like the OpenCode plugin.
Fix:
- Export generateWorkflowDescription() and buildWorkflowEnum() from
@codemcp/workflows-server package index.ts
- Update opencode-plugin to use z.enum(buildWorkflowEnum()) with
.describe(generateWorkflowDescription()) instead of plain
z.string().describe("Workflow name")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The OpenCode plugin's
start-developmenttool previously showed only"Workflow name"as the workflow parameter description, missing the rich metadata (complexity, bestFor, examples) defined in each workflow YAML file. This meant LLMs using the plugin had no context about which workflow to choose.Root Cause
generateWorkflowDescription()andbuildWorkflowEnum()in@codemcp/workflows-server(MCP server) were not re-exported from the package'sindex.ts, making them unavailable to external consumers like the OpenCode plugin.Fix
Export helpers from MCP server package (
packages/mcp-server/src/index.ts): Added re-export ofgenerateWorkflowDescription()andbuildWorkflowEnum()from./server-helpers.jsUpdate plugin to use rich descriptions (
packages/opencode-plugin/src/tool-handlers/start-development.ts):z.string().describe('Workflow name')toz.enum(buildWorkflowEnum(workflowNames)).describe(generateWorkflowDescription(availableWorkflows))Before/After
Before:
workflow: z.string().describe('Workflow name')After: The
workflowparameter now shows for each workflow its displayName, description, complexity, bestFor, and examples from the YAML definition. For example, theepccworkflow description includes:Testing