From 9d32cdffb1f2e12f30bdd6b05fff9207fd689562 Mon Sep 17 00:00:00 2001 From: GRayHook Date: Wed, 17 Jun 2026 10:31:45 +0700 Subject: [PATCH] =?UTF-8?q?Phase=204:=20add=20expandSkill=20=E2=80=94=20sk?= =?UTF-8?q?ill=20meta=20to=20injectable=20user=20text.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compose readBody, formatBlock, and appendSuffix for reinject and /skill-reinject now (SPEC §5.3). Co-authored-by: Cursor --- src/expand.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/expand.ts b/src/expand.ts index 61e48b9..6cc654f 100644 --- a/src/expand.ts +++ b/src/expand.ts @@ -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); +}