{"record":{"id":"dbb25fa08b7834cd","repo":"garrytan/gstack","slug":"skill-md-frontmatter-block-not-terminated-expecte","errorCode":null,"errorMessage":"SKILL.md frontmatter block not terminated (expected \"\\n---\")","messagePattern":"SKILL\\.md frontmatter block not terminated \\(expected \"\\\\n---\"\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/browser-skills.ts","lineNumber":138,"sourceCode":"  } catch {}\n  // Source/dev fallback: walk up from this file's dir to a directory that has both browse/ and browser-skills/.\n  // browse/src/browser-skills.ts → ../../  (the gstack root).\n  return path.resolve(__dirname, '..', '..');\n}\n\n// ─── Frontmatter parsing ────────────────────────────────────────\n\n/**\n * Parse a SKILL.md into { frontmatter, bodyMd }. Throws if the file is\n * missing required fields (host, triggers, args).\n */\nexport function parseSkillFile(content: string, opts: { skillName?: string } = {}): { frontmatter: SkillFrontmatter; bodyMd: string } {\n  if (!content.startsWith('---\\n')) {\n    throw new Error('SKILL.md missing frontmatter block (expected starting \"---\\\\n\")');\n  }\n  const fmEnd = content.indexOf('\\n---', 4);\n  if (fmEnd === -1) {\n    throw new Error('SKILL.md frontmatter block not terminated (expected \"\\\\n---\")');\n  }\n  const fmText = content.slice(4, fmEnd);\n  const bodyMd = content.slice(fmEnd + 4).replace(/^\\n+/, '');\n  const fm = parseFrontmatterFields(fmText);\n\n  // Validate required fields.\n  const errors: string[] = [];\n  const name = fm.name ?? opts.skillName ?? '';\n  if (!name) errors.push('missing required field: name (or skillName hint)');\n  if (!fm.host) errors.push('missing required field: host');\n  // triggers and args may be omitted — empty list is valid.\n  if (errors.length > 0) {\n    throw new Error(`SKILL.md validation failed: ${errors.join('; ')}`);\n  }\n\n  const frontmatter: SkillFrontmatter = {\n    name,\n    description: fm.description,","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/browser-skills.ts#L120-L156","documentation":"Error \"SKILL.md frontmatter block not terminated (expected \"\\n---\")\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/browser-skills.ts:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}