Skip to content

Commit 83f2533

Browse files
dhilipkumarsmnriem
authored andcommitted
fix: review comments
1 parent 1c10844 commit 83f2533

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/specify_cli/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,9 @@ def install_ai_skills(project_path: Path, selected_ai: str, tracker: StepTracker
10901090
if content.startswith("---"):
10911091
parts = content.split("---", 2)
10921092
if len(parts) >= 3:
1093-
frontmatter = yaml.safe_load(parts[1]) or {}
1093+
frontmatter = yaml.safe_load(parts[1])
1094+
if not isinstance(frontmatter, dict):
1095+
frontmatter = {}
10941096
body = parts[2].strip()
10951097
else:
10961098
# File starts with --- but has no closing ---
@@ -1102,6 +1104,11 @@ def install_ai_skills(project_path: Path, selected_ai: str, tracker: StepTracker
11021104
body = content
11031105

11041106
command_name = command_file.stem
1107+
# Normalize: extracted commands may be named "speckit.<cmd>.md";
1108+
# strip the "speckit." prefix so skill names stay clean and
1109+
# SKILL_DESCRIPTIONS lookups work.
1110+
if command_name.startswith("speckit."):
1111+
command_name = command_name[len("speckit."):]
11051112
skill_name = f"speckit-{command_name}"
11061113

11071114
# Create skill directory (additive — never removes existing content)

tests/test_ai_skills.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def test_existing_commands_preserved_gemini(self, project_dir, templates_dir, co
427427
"""install_ai_skills must NOT remove pre-existing .gemini/commands files."""
428428
assert len(list(commands_dir_gemini.glob("speckit.*"))) == 3
429429

430-
install_ai_skills(project_dir, "claude")
430+
install_ai_skills(project_dir, "gemini")
431431

432432
remaining = list(commands_dir_gemini.glob("speckit.*"))
433433
assert len(remaining) == 3

0 commit comments

Comments
 (0)