MCPcopy Index your code
hub / github.com/github/spec-kit / render_skill_command

Method render_skill_command

src/specify_cli/agents.py:306–346  ·  view source on GitHub ↗

Render a command override as a SKILL.md file. SKILL-target agents should receive the same skills-oriented frontmatter shape used elsewhere in the project instead of the original command frontmatter. Technical debt note: Spec-kit currently has multiple SKILL.

(
        self,
        agent_name: str,
        skill_name: str,
        frontmatter: dict,
        body: str,
        source_id: str,
        source_file: str,
        project_root: Path,
    )

Source from the content-addressed store, hash-verified

304 return YamlIntegration._render_yaml(title, description, body, source_id)
305
306 def render_skill_command(
307 self,
308 agent_name: str,
309 skill_name: str,
310 frontmatter: dict,
311 body: str,
312 source_id: str,
313 source_file: str,
314 project_root: Path,
315 ) -> str:
316 """Render a command override as a SKILL.md file.
317
318 SKILL-target agents should receive the same skills-oriented
319 frontmatter shape used elsewhere in the project instead of the
320 original command frontmatter.
321
322 Technical debt note:
323 Spec-kit currently has multiple SKILL.md generators (template packaging,
324 init-time conversion, and extension/preset overrides). Keep the skill
325 frontmatter keys aligned (name/description/compatibility/metadata, with
326 metadata.author and metadata.source subkeys) to avoid drift across agents.
327 """
328 if not isinstance(frontmatter, dict):
329 frontmatter = {}
330
331 agent_config = self.AGENT_CONFIGS.get(agent_name, {})
332 if agent_config.get("extension") == "/SKILL.md":
333 body = self.resolve_skill_placeholders(
334 agent_name, frontmatter, body, project_root
335 )
336
337 description = frontmatter.get(
338 "description", f"Spec-kit workflow command: {skill_name}"
339 )
340 skill_frontmatter = self.build_skill_frontmatter(
341 agent_name,
342 skill_name,
343 description,
344 f"{source_id}:{source_file}",
345 )
346 return self.render_frontmatter(skill_frontmatter) + "\n" + body
347
348 @staticmethod
349 def build_skill_frontmatter(

Callers 1

register_commandsMethod · 0.95

Calls 4

render_frontmatterMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected