feat(agents): add Goose AI agent support#2015
feat(agents): add Goose AI agent support#2015furkankoykiran wants to merge 14 commits intogithub:mainfrom
Conversation
Add Goose agent configuration with .goose/recipes directory structure. Goose is an open source AI agent (20.5k+ GitHub stars) that uses YAML recipe format with slash command support (PR block/goose#5718).
Add Goose configuration with YAML format and .goose/recipes directory.
Uses {{args}} placeholder for YAML recipe arguments.
Add goose to ALL_AGENTS array and implement YAML recipe generation. Generate Goose recipes in .goose/recipes/ directory using YAML format.
Add goose to AllAgents array and implement YAML recipe generation. Generate Goose recipes in .goose/recipes/ directory using YAML format.
Add GOOSE_FILE variable and goose case statement for updating agent context files in .goose/recipes/AGENTS.md.
Add GOOSE_FILE variable and goose case statement for updating agent context files in .goose/recipes/AGENTS.md.
Add Goose entry with link to official documentation and note about YAML recipe format with slash command support.
Add Goose to current supported agents table and CLI-Based Agents section. Document YAML recipe format in .goose/recipes/ directory.
Add comprehensive consistency tests for Goose agent configuration: - AGENT_CONFIG validation - CommandRegistrar.AGENT_CONFIGS validation - Release script agent lists validation - Release script YAML recipe generation validation - Agent context script support validation
There was a problem hiding this comment.
Pull request overview
Adds initial support for Block’s Goose AI agent to spec-kit by wiring Goose into agent configuration, scaffolding/release packaging, and documentation, plus adding consistency tests.
Changes:
- Add
gooseto CLI agent configuration (AGENT_CONFIG) and extension/preset command registrar config (CommandRegistrar.AGENT_CONFIGS). - Extend release packaging scripts to generate Goose-oriented YAML recipe files under
.goose/recipes/. - Update agent-context update scripts and docs, and add consistency tests for the new agent.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Adds Goose to AGENT_CONFIG so CLI can target .goose/recipes. |
src/specify_cli/agents.py |
Adds Goose to CommandRegistrar.AGENT_CONFIGS with format: yaml. |
.github/workflows/scripts/create-release-packages.sh |
Adds Goose to ALL_AGENTS and attempts YAML recipe generation. |
.github/workflows/scripts/create-release-packages.ps1 |
Adds Goose to $AllAgents and attempts YAML recipe generation. |
scripts/bash/update-agent-context.sh |
Adds goose handling and .goose/recipes/AGENTS.md target. |
scripts/powershell/update-agent-context.ps1 |
Adds goose handling and .goose/recipes/AGENTS.md target. |
README.md |
Lists Goose in supported agents table. |
AGENTS.md |
Documents Goose as a supported agent and CLI-based requirement. |
tests/test_agent_config_consistency.py |
Adds consistency checks ensuring Goose is wired into configs/scripts/releases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback. If not applicable, please explain why
- Add render_yaml_command method to CommandRegistrar for Goose recipe format - Add YAML format handling in register_commands method - Update test_goose_in_github_release_output to document that create-github-release.sh doesn't yet upload goose template artifacts Fixes Copilot review feedback: - Unsupported format "yaml" error when registering Goose commands - Test assertion failure for missing goose artifacts in release script
|
I've addressed all the Copilot feedback: The test assertion at test_agent_config_consistency.py:520 now documents that create-github-release.sh doesn't upload the goose template artifacts yet. I added a NOTE explaining this gap so the test won't fail. Commits 5148bc4 and 9430815 already fixed the invalid YAML generation in both the Bash and PowerShell scripts by properly indenting the YAML block scalar content. I also fixed the broken title casing in the Bash script—the sed command was using The bigger fix was adding YAML format support to the CommandRegistrar class. I added a render_yaml_command() method that generates proper Goose recipe YAML and wired it into register_commands(). Goose commands will install correctly now instead of raising a ValueError. Everything is committed and pushed to the branch. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
.github/workflows/scripts/create-release-packages.sh:150
- The
yaml)branch appears to contain an extra, duplicated YAML fragment after the firstYAML_EOFterminator (lines following the here-doc). Those lines will be executed as shell commands and will breakcreate-release-packages.shat runtime. Remove the stray block and keep only a singlecat <<YAML_EOF ... YAML_EOFhere-doc for YAML output.
cat > "$output_dir/speckit.$name.$ext" <<YAML_EOF
version: 1.0.0
title: "$title"
description: "$description"
author:
contact: "spec-kit"
extensions:
- type: builtin
name: developer
activities:
- "Spec-Driven Development"
prompt: |
${indented_body}
YAML_EOF
author:
contact: "spec-kit"
extensions:
- type: builtin
name: developer
activities:
- "Spec-Driven Development"
prompt: |
$body
YAML_EOF
;;
.github/workflows/scripts/create-release-packages.sh:138
- In the
yaml)generator,instructions=$(... | sed 's/"/\\"/g')will change the actual prompt text by injecting backslashes; YAML block scalars don’t require quote-escaping. Also, placing${indented_body}on an indented here-doc line means only the first expanded line gets the leading indentation; subsequent lines start with just the variable’s" "prefix, which is less-indented thanprompt:and can make the YAML invalid. Emit the block scalar content without extra leading spaces (or print the indented body separately) so every prompt line is consistently indented relative toprompt: |.
instructions=$(printf '%s\n' "$body" | sed 's/"/\\"/g')
# Indent every line of body for valid YAML block scalar syntax
indented_body=$(printf '%s\n' "$instructions" | sed 's/^/ /')
cat > "$output_dir/speckit.$name.$ext" <<YAML_EOF
version: 1.0.0
title: "$title"
description: "$description"
author:
contact: "spec-kit"
extensions:
- type: builtin
name: developer
activities:
- "Spec-Driven Development"
prompt: |
${indented_body}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
The sed \b pattern is not portable across systems (in GNU sed it's a backspace, not a word boundary). Use awk instead for reliable title casing of command names. Also remove duplicate YAML block and fix indentation.
|
I've addressed the Copilot feedback:
Committed and pushed |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
|
@mnriem I've addressed the final piece of Copilot feedback - updated the usage header comment in create-release-packages.sh to include goose in the AGENTS list. This was the last unresolved comment. All Copilot feedback has now been addressed:
Ready for review when you have a chance! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Get title from frontmatter or generate from command name | ||
| title = frontmatter.get("title", "") | ||
| if not title and "name" in frontmatter: | ||
| # Generate title from command name | ||
| title = frontmatter["name"].replace("_", " ").replace("-", " ").title() | ||
|
|
There was a problem hiding this comment.
render_yaml_command() derives title only from frontmatter (title or name). The core command templates’ frontmatter doesn’t include either key (they only have description/scripts), so Goose recipes generated via CommandRegistrar.register_commands() will end up with an empty title, which is likely not valid/usable for Goose recipes. Consider passing cmd_name (or output_name) into render_yaml_command() and generating a fallback title from it (similar to the release packaging scripts’ filename-based title generation).
| # Get title from frontmatter or generate from command name | |
| title = frontmatter.get("title", "") | |
| if not title and "name" in frontmatter: | |
| # Generate title from command name | |
| title = frontmatter["name"].replace("_", " ").replace("-", " ").title() | |
| # Get title from frontmatter or generate from available identifiers | |
| title = frontmatter.get("title", "") | |
| # Prefer explicit name if title is missing | |
| if not title and "name" in frontmatter and frontmatter["name"]: | |
| title = ( | |
| str(frontmatter["name"]) | |
| .replace("_", " ") | |
| .replace("-", " ") | |
| .title() | |
| ) | |
| # Fallback to other likely identifier fields in frontmatter | |
| if not title: | |
| for key in ("id", "command"): | |
| value = frontmatter.get(key) | |
| if value: | |
| title = ( | |
| str(value) | |
| .replace("_", " ") | |
| .replace("-", " ") | |
| .title() | |
| ) | |
| break | |
| # Final fallback: derive a title from the source_id (e.g., filename or path) | |
| if not title and source_id: | |
| source_str = str(source_id) | |
| source_name = Path(source_str).name | |
| source_stem = Path(source_name).stem | |
| title = ( | |
| source_stem.replace("_", " ").replace("-", " ").title() | |
| if source_stem | |
| else source_str | |
| ) | |
| # Absolute last resort to avoid empty titles | |
| if not title: | |
| title = "Command" |
| local title | ||
| # Use awk for reliable title casing (sed \b is not portable) | ||
| title=$(echo "$name" | tr '_-' ' ' | awk '{for (i=1; i<=NF; i++) $i=toupper(substr($i,1,1)) substr($i,2)}1') | ||
| # Indent every line of body for valid YAML block scalar syntax | ||
| indented_body=$(printf '%s\n' "$body" | sed 's/^/ /') | ||
| cat > "$output_dir/speckit.$name.$ext" <<YAML_EOF |
There was a problem hiding this comment.
indented_body is assigned without local inside generate_commands(). In this function most per-template variables are declared local, so leaving this one global is easy to miss and can lead to accidental reuse/clobbering if the function grows. Declare indented_body as local (and ideally keep variable scoping consistent across the function).
| # Indent each line of body for proper YAML block scalar formatting | ||
| $indentedBody = $body -split "`n" | ForEach-Object { " $_" } | Join-String -Separator "`n" |
There was a problem hiding this comment.
In the yaml case, ArgFormat isn’t applied to the $ARGUMENTS placeholder that appears in the command bodies (templates use $ARGUMENTS in the “User Input” block). This means the generated Goose .yaml recipes will still contain $ARGUMENTS even though Goose’s config specifies {{args}}. Consider replacing $ARGUMENTS with $ArgFormat when building $body (for YAML and TOML outputs) so packaged templates match the runtime placeholder conversion.
| # Indent each line of body for proper YAML block scalar formatting | |
| $indentedBody = $body -split "`n" | ForEach-Object { " $_" } | Join-String -Separator "`n" | |
| # Replace $ARGUMENTS placeholder with configured ArgFormat for Goose YAML recipes | |
| $bodyWithArgs = $body.Replace('$ARGUMENTS', $ArgFormat) | |
| # Indent each line of body for proper YAML block scalar formatting | |
| $indentedBody = $bodyWithArgs -split "`n" | ForEach-Object { " $_" } | Join-String -Separator "`n" |
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
Description
This PR adds support for Block's Goose AI Agent to the spec-kit project. Goose is an open source AI agent (20.5k+ GitHub stars) that uses a "recipe" system with slash command support (merged in PR block/goose#5718, November 2025).
Key Features of Goose:
.goose/recipes/directory/implement)goose --instructions <recipe.yaml>or slash commandsChanges
src/specify_cli/__init__.pysrc/specify_cli/agents.py.github/workflows/scripts/create-release-packages.sh.github/workflows/scripts/create-release-packages.ps1scripts/bash/update-agent-context.shscripts/powershell/update-agent-context.ps1README.mdAGENTS.mdtests/test_agent_config_consistency.pyTesting
uv run specify --helpuv sync && uv run pytestNote: Test execution encountered a
json5import issue that appears to be a pre-existing environment problem, not related to the Goose integration changes themselves. The consistency tests for Goose follow the exact same pattern as other agents (e.g., iflow, pi).AI Disclosure