feat(goose): map commands to recipes and subagents to sub-recipes - #1892
Merged
Conversation
Goose recipes are reusable YAML workflow files discovered in .goose/recipes/ (project) and ~/.config/goose/recipes/ (global). Add two adapters: - GooseCommand: commands -> top-level recipes (.goose/recipes/<name>.yaml). The command body becomes the recipe `prompt`. - GooseSubagent: subagents -> sub-recipes (.goose/recipes/subagents/<name>.yaml), referenced from a parent recipe's `sub_recipes` by relative path. The subagent body becomes the recipe `instructions`. Recipes require version/title/description plus instructions|prompt; title defaults to the file name and description to the rulesync description (falling back to title), version to 1.0.0. Any other recipe field (parameters, extensions, sub_recipes, …) round-trips through the rulesync `goose` section. Subagents live in the `subagents/` subdirectory so the command-recipe and subagent-recipe file sets stay disjoint (the command importer scans .goose/recipes/*.yaml non-recursively), preventing import/orphan-deletion cross-over. Register goose in the commands and subagents processors (both project + global), add gitignore entries, README/docs matrix updates, and unit + E2E happy-path coverage. Refs #1823 (Goose recipes/sub-recipes; skills still tracked by #1115) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Serialize recipes with dump(..., { lineWidth: -1, noRefs: true }) so long
prompt/instructions prose is not YAML line-folded (mid).
- Exclude both body fields (prompt + instructions) from the round-tripped goose
section so an imported recipe's body is never duplicated back into the recipe
on regeneration (mid).
- Build the rulesync command fileContent via stringifyFrontmatter instead of a
body-only string (low).
- Gate GooseCommand constructor parsing behind validate so validate:false never
throws on malformed YAML, matching GooseSubagent (low).
- Add tests: no line-folding for long bodies; body field not echoed into the
goose section for instructions-only / prompt-only recipes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
@dyoshikawa Thank you! |
Merged
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
Adds Goose recipe support, mapping rulesync commands and subagents onto Goose's reusable YAML workflow files. Per maintainer direction (recipes → commands, sub-recipes → subagents).
Goose recipes are discovered in
./.goose/recipes/(project) and~/.config/goose/recipes/(global). A recipe requiresversion,title,description, plus at least one ofinstructions/prompt.Mapping
GooseCommand) at.goose/recipes/<name>.yaml. The command body becomes the recipeprompt.GooseSubagent) at.goose/recipes/subagents/<name>.yaml, referenced from a parent recipe'ssub_recipeslist by relativepath. The subagent body becomes the recipeinstructions.titledefaults to the file name,descriptionto the rulesyncdescription(falling back totitle), andversionto1.0.0, since recipes require all three. Any other recipe field (parameters,extensions,sub_recipes, …) round-trips through the rulesyncgoosesection.Design note: disjoint file sets
Subagents are written under the
subagents/subdirectory so the command-recipe and subagent-recipe file sets never overlap. The command importer scans.goose/recipes/*.yamlnon-recursively (supportsSubdirectory: false), so it never picks up subagent sub-recipes, and orphan deletion for each feature is confined to its own directory.Changes
src/features/commands/goose-command.tsandsrc/features/subagents/goose-subagent.ts(+ unit tests).goosein the commands and subagents processors (project + global).docs/**support-matrix and a "Goose-specific: recipes" file-format section (synced toskills/rulesync/).Scope
Resolves the recipes/sub-recipes surface of the Goose umbrella. Goose skills remain tracked separately by #1115 and are out of scope here.
Closes #1823
🤖 Generated with Claude Code