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:
parent
1b11b90b35
commit
8d0e49cc28
|
|
@ -280,8 +280,15 @@ class ManifestGenerator {
|
||||||
if (frontmatterMatch) {
|
if (frontmatterMatch) {
|
||||||
const skillMeta = yaml.parse(frontmatterMatch[1]);
|
const skillMeta = yaml.parse(frontmatterMatch[1]);
|
||||||
|
|
||||||
if (!skillMeta || typeof skillMeta !== 'object' || !skillMeta.name || !skillMeta.description) {
|
if (
|
||||||
if (debug) console.log(`[DEBUG] parseSkillMd: SKILL.md in "${dir}" is missing name or description — skipping`);
|
!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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue