Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/specify_cli/integrations/kimi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def _is_speckit_generated_skill(skill_dir: Path) -> bool:

try:
content = skill_file.read_text(encoding="utf-8")
except OSError:
except (OSError, UnicodeError):
return False

if not content.startswith("---"):
Expand Down
18 changes: 18 additions & 0 deletions tests/integrations/test_integration_kimi.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,24 @@ def test_teardown_preserves_user_skills_in_legacy_dir(self, tmp_path):

assert user_skill.exists()

def test_teardown_preserves_non_utf8_user_skill(self, tmp_path):
i = get_integration("kimi")

user_skill = (
tmp_path
/ ".kimi"
/ "skills"
/ "speckit-user-owned"
/ "SKILL.md"
)
user_skill.parent.mkdir(parents=True)
user_skill.write_bytes(b"\xff\xfe")

m = IntegrationManifest("kimi", tmp_path)
i.teardown(tmp_path, m)

assert user_skill.read_bytes() == b"\xff\xfe"


class TestKimiCommandInvocation:
"""Kimi dispatch must use the native ``/skill:`` slash command."""
Expand Down