Skip to content

Commit 6af35e4

Browse files
committed
fix(goose): declare args parameter in generated recipes
1 parent 9483e5c commit 6af35e4

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

src/specify_cli/integrations/goose/__init__.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Goose integration — Block's open source AI agent."""
22

3+
import yaml
4+
35
from ..base import YamlIntegration
46

57

@@ -19,3 +21,35 @@ class GooseIntegration(YamlIntegration):
1921
"extension": ".yaml",
2022
}
2123
context_file = "AGENTS.md"
24+
25+
@staticmethod
26+
def _render_yaml(title: str, description: str, body: str, source_id: str) -> str:
27+
"""Render a Goose YAML recipe with the required args parameter."""
28+
29+
header = {
30+
"version": "1.0.0",
31+
"title": title,
32+
"description": description,
33+
"author": {"contact": "spec-kit"},
34+
"extensions": [{"type": "builtin", "name": "developer"}],
35+
"activities": ["Spec-Driven Development"],
36+
"parameters": [
37+
{
38+
"key": "args",
39+
"input_type": "string",
40+
"requirement": "optional",
41+
"default": "",
42+
"description": "User input passed to the command.",
43+
}
44+
],
45+
}
46+
header_yaml = yaml.safe_dump(
47+
header,
48+
sort_keys=False,
49+
allow_unicode=True,
50+
default_flow_style=False,
51+
).strip()
52+
53+
indented = "\n".join(f" {line}" for line in body.split("\n"))
54+
lines = [header_yaml, "prompt: |", indented, "", f"# Source: {source_id}"]
55+
return "\n".join(lines) + "\n"

0 commit comments

Comments
 (0)