Skip to content

fix(goose): declare args parameter in generated recipes#2402

Open
natelastname wants to merge 2 commits intogithub:mainfrom
natelastname:fix/goose-args-parameter
Open

fix(goose): declare args parameter in generated recipes#2402
natelastname wants to merge 2 commits intogithub:mainfrom
natelastname:fix/goose-args-parameter

Conversation

@natelastname
Copy link
Copy Markdown

Description

Fixes an issue in the Goose integration where generated recipes include {{args}} in the prompt but do not declare a corresponding args parameter.

This causes goose recipe validate to fail with:

Missing definitions for parameters in the recipe file: args.

The fix overrides _render_yaml in GooseIntegration to include a parameters section declaring the args parameter, ensuring all generated recipes are valid.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync --extra test && uv run pytest
  • Tested with a sample project (generated recipes and validated all with goose recipe validate)

AI Disclosure

  • I did use AI assistance (describe below)

Consulted ChatGPT to reason through the root cause and propose an implementation approach. Final code and validation were done manually.

@natelastname natelastname requested a review from mnriem as a code owner April 29, 2026 01:24
Copy link
Copy Markdown
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some positive and negative tests?

@natelastname
Copy link
Copy Markdown
Author

natelastname commented Apr 29, 2026

Can you add some positive and negative tests?

Sure, please let me know if there's anything else I can do.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Goose YAML recipe generation so recipes that include {{args}} also declare an args parameter, preventing goose recipe validate failures.

Changes:

  • Override GooseIntegration._render_yaml to emit a parameters section declaring args.
  • Add integration tests asserting generated Goose recipes declare args when {{args}} appears in the prompt.
  • Add a control test confirming the base YamlIntegration renderer does not declare parameters.
Show a summary per file
File Description
src/specify_cli/integrations/goose/__init__.py Adds Goose-specific YAML rendering that includes an args parameter definition.
tests/integrations/test_integration_goose.py Adds tests verifying the new Goose renderer behavior and documenting the base renderer behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +3 to +4
import re

@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented Apr 29, 2026

Please address Copilot feedback

@natelastname natelastname force-pushed the fix/goose-args-parameter branch from 87641b3 to 5cbe958 Compare April 29, 2026 23:21
@natelastname
Copy link
Copy Markdown
Author

Please address Copilot feedback

I just edited my previous commit to remove the unused import.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Goose integration YAML recipe generation so recipes that reference {{args}} declare a corresponding args parameter, preventing goose recipe validate failures.

Changes:

  • Override GooseIntegration._render_yaml to emit a parameters section containing an args parameter.
  • Add Goose-specific tests to ensure generated recipes that contain {{args}} include an args parameter declaration.
Show a summary per file
File Description
src/specify_cli/integrations/goose/__init__.py Overrides YAML rendering to include an args parameter in the recipe header.
tests/integrations/test_integration_goose.py Adds regression tests for args parameter declaration behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 3

Comment on lines +39 to +51
def test_base_yaml_renderer_does_not_declare_args_parameter(self):
# “Without the Goose-specific override, recipes using {{args}} do NOT declare it.”
rendered = YamlIntegration._render_yaml(
"Test",
"Test recipe",
"{{args}}",
"templates/commands/test.md",
)

data = yaml.safe_load(rendered)

assert "{{args}}" in data["prompt"]
assert "parameters" not in data

def test_setup_declares_args_parameter_for_args_prompt(self, tmp_path):
# “If a Goose recipe uses {{args}}, it correctly declares the args parameter.”
integration = get_integration("goose")
Comment on lines +25 to +35
@staticmethod
def _render_yaml(title: str, description: str, body: str, source_id: str) -> str:
"""Render a Goose YAML recipe with the required args parameter."""

header = {
"version": "1.0.0",
"title": title,
"description": description,
"author": {"contact": "spec-kit"},
"extensions": [{"type": "builtin", "name": "developer"}],
"activities": ["Spec-Driven Development"],
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 1, 2026

Please address Copilot feedback. If not applicable, please explain why

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.

3 participants