Solution 0x2a7b6a284a867d4e10849050698c3956c5f7840a3bc29190fc7798287e6da0b9
All checks were successful
elffuss/validation Validation passed
All checks were successful
elffuss/validation Validation passed
T2T-Item: 0x2a7b6a284a867d4e10849050698c3956c5f7840a3bc29190fc7798287e6da0b9 T2T-Issue: 0xce1f03063035e40185e7b2778dce2cf95081649b1257ecb171218cf78a9dda3c
This commit is contained in:
@@ -131,11 +131,12 @@ export async function installFromRepo(entry) {
|
||||
|
||||
// SKILL.md → { name, description, content }
|
||||
export function parseSkill(md, fallbackName = 'skill') {
|
||||
const fm = md.match(/^---\n([\s\S]*?)\n---/);
|
||||
const normalizedMd = md.replace(/\r\n/g, '\n');
|
||||
const fm = normalizedMd.match(/^---\n([\s\S]*?)\n---/);
|
||||
const meta = fm?.[1] || '';
|
||||
const name = meta.match(/^name:\s*(.+)$/m)?.[1]?.trim() || fallbackName;
|
||||
const description = (meta.match(/^description:\s*([\s\S]+?)(?:\n\w+:|$)/m)?.[1] || '').replace(/\s+/g, ' ').trim();
|
||||
const content = md.replace(/^---\n[\s\S]*?\n---\n?/, '').trim();
|
||||
const content = normalizedMd.replace(/^---\n[\s\S]*?\n---\n?/, '').trim();
|
||||
return { name, description, content };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user