Skip to content

Commit 5670d63

Browse files
jawwad-aliclaude
andcommitted
fix(presets): address review - guard skill_frontmatter type and tighten apply_argument_hint annotations
Add a symmetric isinstance(skill_frontmatter, dict) guard so the helper stays a safe no-op if a caller passes a non-dict, and annotate the parameters as Dict[str, Any] with an optional integration to match real call-site usage. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 94ee240 commit 5670d63

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/specify_cli/agents.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ def build_skill_frontmatter(
358358

359359
@staticmethod
360360
def apply_argument_hint(
361-
source_frontmatter: dict,
362-
skill_frontmatter: dict,
363-
integration: object,
361+
source_frontmatter: Dict[str, Any],
362+
skill_frontmatter: Dict[str, Any],
363+
integration: Optional[object] = None,
364364
) -> None:
365365
"""Carry a command's ``argument-hint`` into its generated skill frontmatter.
366366
@@ -373,7 +373,7 @@ def apply_argument_hint(
373373
agent. Built-in templates carry no ``argument-hint``, so this is a no-op
374374
for the core path.
375375
"""
376-
if not isinstance(source_frontmatter, dict):
376+
if not isinstance(source_frontmatter, dict) or not isinstance(skill_frontmatter, dict):
377377
return
378378
argument_hint = source_frontmatter.get("argument-hint")
379379
if (

0 commit comments

Comments
 (0)