fix(cli): validate frontmatter name/description are strings in parseSkillMd

Prevents cleanForCSV() crash when YAML parses name or description as
a non-string type (number, object, boolean).
This commit is contained in:
Alex Verkhovsky 2026-03-09 01:32:39 -06:00
parent 1b11b90b35
commit 8d0e49cc28
1 changed files with 9 additions and 2 deletions

View File

@ -280,8 +280,15 @@ class ManifestGenerator {
if (frontmatterMatch) {
const skillMeta = yaml.parse(frontmatterMatch[1]);
if (!skillMeta || typeof skillMeta !== 'object' || !skillMeta.name || !skillMeta.description) {
if (debug) console.log(`[DEBUG] parseSkillMd: SKILL.md in "${dir}" is missing name or description — skipping`);
if (
!skillMeta ||
typeof skillMeta !== 'object' ||
typeof skillMeta.name !== 'string' ||
typeof skillMeta.description !== 'string' ||
!skillMeta.name ||
!skillMeta.description
) {
if (debug) console.log(`[DEBUG] parseSkillMd: SKILL.md in "${dir}" is missing name or description (or wrong type) — skipping`);
return null;
}