/** * Strip a SKILL.md YAML frontmatter block, leaving only the body the * skill editor edits. * * The block is `---` … `---` at the START of the file. The anchor is `^` * (string start) — `\A` is a Python-ism that JS silently treats as a * literal, which made the strip a no-op and let every save re-wrap the * whole file in a new frontmatter layer (HEL-613 rework). */ const FRONTMATTER_RE = /^---\s*\n[\s\S]*?\n---\s*\n?/; export function stripSkillFrontmatter(text: string): string { const m = text.match(FRONTMATTER_RE); return m ? text.slice(m[0].length) : text; }