Phase 4: add expandSkill — skill meta to injectable user text.

Compose readBody, formatBlock, and appendSuffix for reinject and /skill-reinject now (SPEC §5.3).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-17 10:31:45 +07:00
parent 049a11a7d5
commit 9d32cdffb1
+7
View File
@@ -27,3 +27,10 @@ export function appendSuffix(block: string, suffix: string | undefined): string
}
return `${block}\n\n${trimmed}`;
}
/** Read SKILL.md and format full user message text for re-inject (SPEC §5.3). */
export function expandSkill(meta: SkillBlockMeta, suffix?: string): string {
const body = readSkillBody(meta.filePath);
const block = formatBlock(meta, body);
return appendSuffix(block, suffix);
}