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) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue