Skip to content

feat(goose): map commands to recipes and subagents to sub-recipes - #1892

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-1823-goose-recipes
Jun 16, 2026
Merged

feat(goose): map commands to recipes and subagents to sub-recipes#1892
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-1823-goose-recipes

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

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 requires version, title, description, plus at least one of instructions / prompt.

Mapping

  • commands → top-level recipes (GooseCommand) at .goose/recipes/<name>.yaml. The command body becomes the recipe prompt.
  • subagents → sub-recipes (GooseSubagent) at .goose/recipes/subagents/<name>.yaml, referenced from a parent recipe's sub_recipes list by relative path. The subagent body becomes the recipe instructions.

title defaults to the file name, description to the rulesync description (falling back to title), and version to 1.0.0, since recipes require all three. Any other recipe field (parameters, extensions, sub_recipes, …) round-trips through the rulesync goose section.

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/*.yaml non-recursively (supportsSubdirectory: false), so it never picks up subagent sub-recipes, and orphan deletion for each feature is confined to its own directory.

Changes

  • New src/features/commands/goose-command.ts and src/features/subagents/goose-subagent.ts (+ unit tests).
  • Register goose in the commands and subagents processors (project + global).
  • Goose recipe path constants; gitignore entries for the recipe dirs.
  • README / docs/** support-matrix and a "Goose-specific: recipes" file-format section (synced to skills/rulesync/).
  • E2E happy-path coverage: generate / import / orphan-check, project + global.

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

cm-dyoshikawa and others added 2 commits June 15, 2026 23:47
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>
@dyoshikawa
dyoshikawa merged commit cf7835f into main Jun 16, 2026
8 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-1823-goose-recipes branch June 16, 2026 07:02
@dyoshikawa dyoshikawa mentioned this pull request Jun 17, 2026
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.

Follow up Goose upstream updates: MCP extensions, Agent Skills, and recipes (commands/subagents)

2 participants