diff --git a/packages/core/src/skills/skillLoader.test.ts b/packages/core/src/skills/skillLoader.test.ts index 9fa20bd70c..5513928ac6 100644 --- a/packages/core/src/skills/skillLoader.test.ts +++ b/packages/core/src/skills/skillLoader.test.ts @@ -343,4 +343,28 @@ description: A long description: with a colon expect(skills[0].name).toBe('my-skill'); expect(skills[0].description).toBe('A long description: with a colon'); }); + + it('should not treat "Note:" as a new key in multi-line description in simple parser', async () => { + const skillDir = path.join(testRootDir, 'simple-parser-note'); + await fs.mkdir(skillDir, { recursive: true }); + const skillFile = path.join(skillDir, 'SKILL.md'); + // Forces YAML failure, triggers simple parser + await fs.writeFile( + skillFile, + `--- +name: note-skill +description: This is a description + Note: This should be part of the description +--- +`, + ); + + const skills = await loadSkillsFromDir(testRootDir); + + expect(skills).toHaveLength(1); + expect(skills[0].name).toBe('note-skill'); + expect(skills[0].description).toBe( + 'This is a description Note: This should be part of the description', + ); + }); }); diff --git a/packages/core/src/skills/skillLoader.ts b/packages/core/src/skills/skillLoader.ts index 99c7a08ceb..4c02bce57f 100644 --- a/packages/core/src/skills/skillLoader.ts +++ b/packages/core/src/skills/skillLoader.ts @@ -92,8 +92,11 @@ function parseSimpleFrontmatter( while (i + 1 < lines.length) { const nextLine = lines[i + 1]; // If next line is indented, it's a continuation of the description, - // UNLESS it looks like another key (e.g. "name:") - if (nextLine.match(/^[ \t]+\S/) && !nextLine.match(/^\s*\w+\s*:/)) { + // UNLESS it looks like another known key (e.g. "name:") + if ( + nextLine.match(/^[ \t]+\S/) && + !nextLine.match(/^\s*(name|description)\s*:/i) + ) { descLines.push(nextLine.trim()); i++; } else {