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

Method apply_argument_hint

src/specify_cli/agents.py:368–392  ·  view source on GitHub ↗

Carry a command's ``argument-hint`` into its generated skill frontmatter. Copies ``argument-hint`` from the parsed source command frontmatter into *skill_frontmatter* (mutated in place) before serialization, so that a folded multi-line ``description`` cannot be split into in

(
        source_frontmatter: Dict[str, Any],
        skill_frontmatter: Dict[str, Any],
        integration: Optional[object] = None,
    )

Source from the content-addressed store, hash-verified

366
367 @staticmethod
368 def apply_argument_hint(
369 source_frontmatter: Dict[str, Any],
370 skill_frontmatter: Dict[str, Any],
371 integration: Optional[object] = None,
372 ) -> None:
373 """Carry a command's ``argument-hint`` into its generated skill frontmatter.
374
375 Copies ``argument-hint`` from the parsed source command frontmatter into
376 *skill_frontmatter* (mutated in place) before serialization, so that a
377 folded multi-line ``description`` cannot be split into invalid YAML. Only
378 integrations that support the field — those exposing
379 ``inject_argument_hint`` (currently Claude) — receive the key, leaving
380 :meth:`build_skill_frontmatter`'s shared shape unchanged for every other
381 agent. Built-in templates carry no ``argument-hint``, so this is a no-op
382 for the core path.
383 """
384 if not isinstance(source_frontmatter, dict) or not isinstance(skill_frontmatter, dict):
385 return
386 argument_hint = source_frontmatter.get("argument-hint")
387 if (
388 argument_hint
389 and integration is not None
390 and hasattr(integration, "inject_argument_hint")
391 ):
392 skill_frontmatter["argument-hint"] = str(argument_hint)
393
394 @staticmethod
395 def resolve_skill_placeholders(

Callers 4

_reconcile_skillsMethod · 0.95
_register_skillsMethod · 0.95
_unregister_skillsMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected