Phase 4: add readSkillBody — SKILL.md read with frontmatter strip.

Mirror agent-session _expandSkillCommand body extraction via public stripFrontmatter API (SPEC §5.3, §10).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-17 10:30:58 +07:00
parent 69611685d4
commit 584a8fa342
+8
View File
@@ -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();
}