MCPcopy
hub / github.com/github/spec-kit / render_yaml_command

Method render_yaml_command

src/specify_cli/agents.py:271–304  ·  view source on GitHub ↗

Render command in YAML recipe format for Goose. Args: frontmatter: Command frontmatter body: Command body content source_id: Source identifier (extension or preset ID) cmd_name: Command name used as title fallback Returns:

(
        self,
        frontmatter: dict,
        body: str,
        source_id: str,
        cmd_name: str = "",
    )

Source from the content-addressed store, hash-verified

269 return f'"{escaped}"'
270
271 def render_yaml_command(
272 self,
273 frontmatter: dict,
274 body: str,
275 source_id: str,
276 cmd_name: str = "",
277 ) -> str:
278 """Render command in YAML recipe format for Goose.
279
280 Args:
281 frontmatter: Command frontmatter
282 body: Command body content
283 source_id: Source identifier (extension or preset ID)
284 cmd_name: Command name used as title fallback
285
286 Returns:
287 Formatted YAML recipe file content
288 """
289 from specify_cli.integrations.base import YamlIntegration
290
291 title = frontmatter.get("title", "") or frontmatter.get("name", "")
292 if not isinstance(title, str):
293 title = str(title) if title is not None else ""
294 if not title and cmd_name:
295 title = YamlIntegration._human_title(cmd_name)
296 if not title and source_id:
297 title = YamlIntegration._human_title(Path(str(source_id)).stem)
298 if not title:
299 title = "Command"
300
301 description = frontmatter.get("description", "")
302 if not isinstance(description, str):
303 description = str(description) if description is not None else ""
304 return YamlIntegration._render_yaml(title, description, body, source_id)
305
306 def render_skill_command(
307 self,

Callers 1

register_commandsMethod · 0.95

Calls 3

_human_titleMethod · 0.80
_render_yamlMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected