MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / _normalize_skill_frontmatter

Function _normalize_skill_frontmatter

openspace/skill_engine/patch.py:41–52  ·  view source on GitHub ↗

Re-quote SKILL.md frontmatter in-place so values are valid YAML.

(skill_dir: Path)

Source from the content-addressed store, hash-verified

39
40
41def _normalize_skill_frontmatter(skill_dir: Path) -> None:
42 """Re-quote SKILL.md frontmatter in-place so values are valid YAML."""
43 skill_file = skill_dir / SKILL_FILENAME
44 if not skill_file.exists():
45 return
46 try:
47 raw = skill_file.read_text(encoding="utf-8")
48 normalized = normalize_frontmatter(raw)
49 if normalized != raw:
50 skill_file.write_text(normalized, encoding="utf-8")
51 except Exception as e:
52 logger.debug(f"frontmatter normalize skipped for {skill_dir.name}: {e}")
53
54
55class PatchType(str, Enum):

Callers 3

fix_skillFunction · 0.85
derive_skillFunction · 0.85
create_skillFunction · 0.85

Calls 1

normalize_frontmatterFunction · 0.85

Tested by

no test coverage detected