Extract the description: field from SKILL.md frontmatter.
(skill_dir: Path)
| 144 | |
| 145 | |
| 146 | def _read_description(skill_dir: Path) -> str: |
| 147 | """Extract the description: field from SKILL.md frontmatter.""" |
| 148 | skill_md = skill_dir / "SKILL.md" |
| 149 | text = skill_md.read_text(encoding="utf-8") |
| 150 | fm = extract_frontmatter(text) |
| 151 | if fm is None: |
| 152 | raise RuntimeError(f"{skill_md} has no YAML frontmatter.") |
| 153 | meta = yaml.safe_load(fm) or {} |
| 154 | desc = meta.get("description") |
| 155 | if not isinstance(desc, str) or not desc: |
| 156 | raise RuntimeError(f"{skill_md} has no description: field.") |
| 157 | return desc |
| 158 | |
| 159 | |
| 160 | def _read_body(skill_dir: Path) -> str: |