fix(agents): resolve skill placeholders in Goose (yaml) command output#3374
Open
jawwad-ali wants to merge 2 commits into
Open
fix(agents): resolve skill placeholders in Goose (yaml) command output#3374jawwad-ali wants to merge 2 commits into
jawwad-ali wants to merge 2 commits into
Conversation
CommandRegistrar.register_commands resolves {SCRIPT}/__AGENT__ and the
$ARGUMENTS placeholder in the markdown and toml branches, but the yaml
branch (Goose recipes) called render_yaml_command directly, skipping
both. So extension/preset command bodies installed for Goose kept literal
{SCRIPT}, __AGENT__, and repo-relative script paths in the generated
.goose/recipes/*.yaml prompt. Mirror the markdown/toml branches: run
resolve_skill_placeholders + _convert_argument_placeholder on the body
before render_yaml_command.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Goose (YAML recipe) command generation so command-body placeholders like {SCRIPT}, __AGENT__, and $ARGUMENTS are resolved consistently with the markdown and toml output branches when CommandRegistrar.register_commands() renders commands.
Changes:
- Apply
resolve_skill_placeholders()for the YAML (Goose) branch before rendering recipes. - Apply
_convert_argument_placeholder()for the YAML (Goose) branch after placeholder resolution so newly-introduced$ARGUMENTS(via{ARGS}/{SCRIPT}) are converted. - Add a regression test ensuring Goose-generated recipes do not emit the placeholder literals verbatim.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/agents.py |
Resolves {SCRIPT} / __AGENT__ and converts $ARGUMENTS in the YAML (Goose) branch before rendering the recipe. |
tests/integrations/test_integration_goose.py |
Adds a regression test covering placeholder resolution behavior for Goose recipe output. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Low
Per review: parse the generated recipe with yaml.safe_load and assert the
prompt contains the resolved values (.specify/scripts/, 'agent goose',
{{args}}), not merely that the literal tokens are absent — a wrong output
that happens to omit the exact strings would otherwise pass.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Description
CommandRegistrar.register_commandsresolves command-body placeholders —{SCRIPT},__AGENT__(viaresolve_skill_placeholders) and$ARGUMENTS(via_convert_argument_placeholder) — in the markdown and toml branches, but the yaml branch (Goose recipes) calledrender_yaml_commanddirectly and skipped both:So an extension/preset command installed for Goose kept the literal
{SCRIPT},__AGENT__, and unrewritten repo-relative script paths in the generated.goose/recipes/*.yamlprompt. Reproduced on main @92b7cf7: the same command body renders correctly forclaude(skills) andgemini(toml) but Goose emittedRun {SCRIPT} for agent __AGENT__ with $ARGUMENTS.verbatim.Fix
Mirror the markdown/toml branches — run
resolve_skill_placeholders+_convert_argument_placeholderonbodybeforerender_yaml_command. (bodyis reassigned before the downstream alias loop, so aliases inherit the resolved text too.)Testing
New
TestGooseCommandPlaceholderResolution: registers a command whose body has{SCRIPT}/__AGENT__/$ARGUMENTSforgoose, then asserts the generated.goose/recipes/speckit.example.yamlcontains none of the literals (they resolve to.specify/scripts/...,agent goose,{{args}}). Fails before (literals present — verified by source-stash), passes after. Full goose suite: 25 passed.uvx ruff checkclean.AI Disclosure
Found and fixed with Claude Code (Claude Fable 5) under my direction. AI flagged the yaml branch as the odd one out across the three format branches; I reproduced the literal-placeholder leak against the claude/gemini baselines, verified fail-before/pass-after, and reviewed the diff.