fix(yaml): add parameter definitions for goose recipe validation#2450
Open
zichen0116 wants to merge 1 commit intogithub:mainfrom
Open
fix(yaml): add parameter definitions for goose recipe validation#2450zichen0116 wants to merge 1 commit intogithub:mainfrom
zichen0116 wants to merge 1 commit intogithub:mainfrom
Conversation
Goose recipe validation requires that all template variables (like {{args}})
have corresponding parameter definitions in the parameters field.
Without this, goose recipe validate fails with:
Missing definitions for parameters in the recipe file: args.
Add the parameters field to generated YAML recipes when {{args}} is used.
Fixes github#2423
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to fix Goose recipe validation by teaching the YAML recipe generator to emit parameter metadata for the {{args}} placeholder used in spec-kit command templates. It fits into the integration layer that materializes agent-specific command files from the shared template set.
Changes:
- Extended
YamlIntegration._render_yaml()to optionally include aparametersheader section. - Updated
YamlIntegration.setup()to detect{{args}}in generated recipe bodies and inject anargsparameter definition. - Kept the rest of the Goose YAML recipe structure unchanged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1298
to
+1312
| # Build parameter definitions for template variables used in the body | ||
| params = None | ||
| if "{{args}}" in body: | ||
| params = [ | ||
| { | ||
| "key": "args", | ||
| "input_type": "string", | ||
| "requirement": "user_prompt", | ||
| "description": "Arguments to pass to the command", | ||
| } | ||
| ] | ||
|
|
||
| yaml_content = self._render_yaml( | ||
| title, description, body, f"templates/commands/{src_file.name}" | ||
| title, description, body, f"templates/commands/{src_file.name}", | ||
| parameters=params, |
Comment on lines
+1298
to
+1312
| # Build parameter definitions for template variables used in the body | ||
| params = None | ||
| if "{{args}}" in body: | ||
| params = [ | ||
| { | ||
| "key": "args", | ||
| "input_type": "string", | ||
| "requirement": "user_prompt", | ||
| "description": "Arguments to pass to the command", | ||
| } | ||
| ] | ||
|
|
||
| yaml_content = self._render_yaml( | ||
| title, description, body, f"templates/commands/{src_file.name}" | ||
| title, description, body, f"templates/commands/{src_file.name}", | ||
| parameters=params, |
mnriem
requested changes
May 5, 2026
Collaborator
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback. If not applicable, please explain why
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
parametersfield to generated YAML recipe files when{{args}}placeholder is usedProblem
When running
goose recipe validateon spec-kit generated recipe files, validation fails with:This happens because the generated YAML recipes use
{{args}}in the prompt body but don't define theargsparameter in the recipe header.Fix
_render_yaml()to accept an optionalparametersargument and include it in the YAML headersetup()to detect{{args}}in the prompt body and pass the corresponding parameter definitionTesting
parametersfield when{{args}}is usedFixes #2423