spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

fix(skills): preserve non-ASCII characters in skill frontmatter

Open seiya-koji opened this issue 5 months ago • 5 comments

Description

Skill SKILL.md frontmatter description values with non-ASCII characters were escaped to \uXXXX / \xXX, because the yaml.safe_dump(...) calls that render skill frontmatter were missing allow_unicode=True.

# Before
description: "Pr\xFCfe Konformit\xE4t der Implementierung"
# After
description: "Prüfe Konformität der Implementierung"

#1936 fixed this for the YAML I/O that existed then; the skill frontmatter paths added later (native skills migration) regressed it.

This PR adds allow_unicode=True to the 7 skill/command frontmatter safe_dump sites (extensions.py, presets.py, integrations/claude/__init__.py) and adds regression tests for the render and extension-install paths.

Testing

Added regression tests for both frontmatter paths (render and extension-install), ran the full suite (3718 passed, 45 skipped), and confirmed the fix end-to-end on a sample project — a unicode extension's description (CJK + accented Latin + emoji) survived intact in the generated SKILL.md.

  • [x] Tested locally with uv run specify --help
  • [x] Ran existing tests with uv sync && uv run pytest
  • [x] Tested with a sample project (if applicable)

AI Disclosure

  • [ ] I did not use AI assistance for this contribution
  • [x] I did use AI assistance (describe below)

Implemented with Claude Code (Opus 4.8).

seiya-koji avatar Jun 10 '26 15:06 seiya-koji

Addressed Copilot's refactoring suggestion in ae74205. It reaches a few more call sites than the original fix, so the diff is a bit larger.

seiya-koji avatar Jun 10 '26 16:06 seiya-koji

Please address merge conflicts by rebasing on upstream/main

mnriem avatar Jun 11 '26 17:06 mnriem

Rebased the branch onto the latest main.

seiya-koji avatar Jun 12 '26 00:06 seiya-koji

Please resolve conflicts

mnriem avatar Jun 16 '26 20:06 mnriem

Rebased the branch onto the latest main.

seiya-koji avatar Jun 16 '26 20:06 seiya-koji

Rebased onto the latest main again to resolve another conflict.

seiya-koji avatar Jun 17 '26 01:06 seiya-koji

Thank you!

mnriem avatar Jun 17 '26 12:06 mnriem