|
|
@@ -207,34 +207,12 @@ function runUseSkill(skillName) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // Extract frontmatter and content
|
|
|
+ // Extract frontmatter and content using shared core functions
|
|
|
let content, frontmatter;
|
|
|
try {
|
|
|
const fullContent = fs.readFileSync(skillFile, 'utf8');
|
|
|
const { name, description } = skillsCore.extractFrontmatter(skillFile);
|
|
|
-
|
|
|
- // Extract just the content after frontmatter
|
|
|
- const lines = fullContent.split('\n');
|
|
|
- let inFrontmatter = false;
|
|
|
- let frontmatterEnded = false;
|
|
|
- const contentLines = [];
|
|
|
-
|
|
|
- for (const line of lines) {
|
|
|
- if (line.trim() === '---') {
|
|
|
- if (inFrontmatter) {
|
|
|
- frontmatterEnded = true;
|
|
|
- continue;
|
|
|
- }
|
|
|
- inFrontmatter = true;
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- if (frontmatterEnded || !inFrontmatter) {
|
|
|
- contentLines.push(line);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- content = contentLines.join('\n').trim();
|
|
|
+ content = skillsCore.stripFrontmatter(fullContent);
|
|
|
frontmatter = { name, description };
|
|
|
} catch (error) {
|
|
|
console.log(`Error reading skill file: ${error.message}`);
|