Skip to content

fix(agents): resolve skill placeholders in Goose (yaml) command output#3374

Open
jawwad-ali wants to merge 1 commit into
github:mainfrom
jawwad-ali:fix/goose-yaml-skill-placeholders
Open

fix(agents): resolve skill placeholders in Goose (yaml) command output#3374
jawwad-ali wants to merge 1 commit into
github:mainfrom
jawwad-ali:fix/goose-yaml-skill-placeholders

Conversation

@jawwad-ali

Copy link
Copy Markdown
Contributor

Description

CommandRegistrar.register_commands resolves command-body placeholders — {SCRIPT}, __AGENT__ (via resolve_skill_placeholders) and $ARGUMENTS (via _convert_argument_placeholder) — in the markdown and toml branches, but the yaml branch (Goose recipes) called render_yaml_command directly and skipped both:

elif agent_config["format"] == "yaml":
    output = self.render_yaml_command(frontmatter, body, source_id, cmd_name)

So an extension/preset command installed for Goose kept the literal {SCRIPT}, __AGENT__, and unrewritten repo-relative script paths in the generated .goose/recipes/*.yaml prompt. Reproduced on main @ 92b7cf7: the same command body renders correctly for claude (skills) and gemini (toml) but Goose emitted Run {SCRIPT} for agent __AGENT__ with $ARGUMENTS. verbatim.

Fix

Mirror the markdown/toml branches — run resolve_skill_placeholders + _convert_argument_placeholder on body before render_yaml_command. (body is reassigned before the downstream alias loop, so aliases inherit the resolved text too.)

Testing

New TestGooseCommandPlaceholderResolution: registers a command whose body has {SCRIPT}/__AGENT__/$ARGUMENTS for goose, then asserts the generated .goose/recipes/speckit.example.yaml contains 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 check clean.

AI Disclosure

  • I did use AI assistance (describe below)

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.

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>
@jawwad-ali jawwad-ali requested a review from mnriem as a code owner July 6, 2026 20:12
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.

1 participant