From 584a8fa3429342d01f88cd8ab8da811fd4f55f92 Mon Sep 17 00:00:00 2001 From: GRayHook Date: Wed, 17 Jun 2026 10:30:58 +0700 Subject: [PATCH] =?UTF-8?q?Phase=204:=20add=20readSkillBody=20=E2=80=94=20?= =?UTF-8?q?SKILL.md=20read=20with=20frontmatter=20strip.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror agent-session _expandSkillCommand body extraction via public stripFrontmatter API (SPEC §5.3, §10). Co-authored-by: Cursor --- src/expand.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/expand.ts diff --git a/src/expand.ts b/src/expand.ts new file mode 100644 index 0000000..d4109fc --- /dev/null +++ b/src/expand.ts @@ -0,0 +1,8 @@ +import { readFileSync } from "node:fs"; +import { stripFrontmatter } from "@earendil-works/pi-coding-agent"; + +/** mirror agent-session `_expandSkillCommand` — SKILL.md body without YAML frontmatter (SPEC §5.3, §10). */ +export function readSkillBody(filePath: string): string { + const content = readFileSync(filePath, "utf-8"); + return stripFrontmatter(content).trim(); +}