{"record":{"id":"460369b2ead1b780","repo":"anthropics/skills","slug":"skill-md-missing-frontmatter-no-closing","errorCode":null,"errorMessage":"SKILL.md missing frontmatter (no closing ---)","messagePattern":"SKILL\\.md missing frontmatter \\(no closing ---\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/skill-creator/scripts/utils.py","lineNumber":22,"sourceCode":"\n\n\ndef parse_skill_md(skill_path: Path) -> tuple[str, str, str]:\n    \"\"\"Parse a SKILL.md file, returning (name, description, full_content).\"\"\"\n    content = (skill_path / \"SKILL.md\").read_text()\n    lines = content.split(\"\\n\")\n\n    if lines[0].strip() != \"---\":\n        raise ValueError(\"SKILL.md missing frontmatter (no opening ---)\")\n\n    end_idx = None\n    for i, line in enumerate(lines[1:], start=1):\n        if line.strip() == \"---\":\n            end_idx = i\n            break\n\n    if end_idx is None:\n        raise ValueError(\"SKILL.md missing frontmatter (no closing ---)\")\n\n    name = \"\"\n    description = \"\"\n    frontmatter_lines = lines[1:end_idx]\n    i = 0\n    while i < len(frontmatter_lines):\n        line = frontmatter_lines[i]\n        if line.startswith(\"name:\"):\n            name = line[len(\"name:\"):].strip().strip('\"').strip(\"'\")\n        elif line.startswith(\"description:\"):\n            value = line[len(\"description:\"):].strip()\n            # Handle YAML multiline indicators (>, |, >-, |-)\n            if value in (\">\", \"|\", \">-\", \"|-\"):\n                continuation_lines: list[str] = []\n                i += 1\n                while i < len(frontmatter_lines) and (frontmatter_lines[i].startswith(\"  \") or frontmatter_lines[i].startswith(\"\\t\")):\n                    continuation_lines.append(frontmatter_lines[i].strip())\n                    i += 1","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/anthropics/skills/blob/f6656c1256d5a8adfa37db9110046ef20bac644c/skills/skill-creator/scripts/utils.py#L4-L40","documentation":"parse_skill_md() found the opening `---` on line 1 but no second `---` line anywhere after it, so the frontmatter block never closes and name/description cannot be delimited. Raised from the same loop that scans for the closing delimiter.","triggerScenarios":"Calling parse_skill_md() on a SKILL.md whose frontmatter opens but the body begins without a closing `---`; a horizontal rule written as `---` was intended as content but the file genuinely never closes the block; the closing delimiter was indented with tabs or written as `----` (any line whose .strip() != '---' is not accepted, though ---- also fails).","commonSituations":"Truncated files cut off mid-frontmatter; hand-editing that deletes the closing delimiter; using `-----` or `—--` (typo/autocorrect) instead of exactly three hyphens.","solutions":["Add a line containing exactly `---` after the last frontmatter key (name, description)","Verify with: awk 'NR==1{next} /^---[[:space:]]*$/{print \"closes at line \" NR; exit}' SKILL.md — no output means it never closes","Keep frontmatter minimal (name + description) so a stray `---` inside long descriptions cannot confuse you"],"exampleFix":"# before\n---\nname: my-skill\ndescription: Long text that never ended\n\n# Body...\n# after\n---\nname: my-skill\ndescription: Long text that never ended\n---\n\n# Body...","handlingStrategy":"validation","validationCode":"def frontmatter_closes(skill_path: Path) -> bool:\n    lines = (skill_path / \"SKILL.md\").read_text().split(\"\\n\")\n    return lines[0].strip() == \"---\" and any(l.strip() == \"---\" for l in lines[1:])","typeGuard":null,"tryCatchPattern":"try:\n    parse_skill_md(path)\nexcept ValueError as e:\n    if \"closing\" in str(e):\n        print(f\"{path}: add a closing --- line\")\n    raise","preventionTips":["Use an editor linter/markdown preview that highlights unclosed frontmatter","Keep the frontmatter to name+description only so delimiters are hard to lose","Check the file after any automated reformatting pass"],"tags":["markdown","frontmatter","validation","skill-creator"],"backgroundTag":null,"analyzedSha":"f6656c1256d5a8adfa37db9110046ef20bac644c","analyzedAt":"2026-08-14T16:09:17.493Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}