{"record":{"id":"a274315b95a1418d","repo":"warpdotdev/warp","slug":"skill-md-missing-frontmatter-no-closing","errorCode":null,"errorMessage":"SKILL.md missing frontmatter (no closing ---)","messagePattern":"SKILL\\.md missing frontmatter \\(no closing ---\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"resources/bundled/skills/create-skill/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/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/resources/bundled/skills/create-skill/scripts/utils.py#L4-L40","documentation":"Companion check to the opening delimiter in parse_skill_md(): after '---' on line 1, the parser scans for a second '---' line to close the frontmatter; if none exists before EOF it raises this ValueError. Without a closing delimiter there is no boundary between YAML metadata and the markdown body.","triggerScenarios":"Frontmatter that opens with --- but whose second delimiter is missing, spelled '----' (four dashes do not equal '---' after strip), or written as '...' or '***' separators; a truncated file cut off mid-frontmatter.","commonSituations":"Long descriptions where the author kept typing YAML and never closed the block; merges that dropped the closing line; templates using non-standard separators.","solutions":["Add a line containing exactly --- after the last frontmatter key","Use exactly three dashes for both delimiters — ---- or '- - -' will not match","Sanity-check with grep -n -- '---' SKILL.md and confirm a matching pair at the top of the file"],"exampleFix":"# before\n---\nname: my-skill\ndescription: A very long description that never ends because the author\n  forgot to close the frontmatter block\n\n# Body starts here\n\n# after\n---\nname: my-skill\ndescription: A long description properly closed.\n---\n\n# Body starts here","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nlines = (skill_path / 'SKILL.md').read_text().split('\\n')\nhas_open = bool(lines) and lines[0].strip() == '---'\nhas_close = has_open and any(l.strip() == '---' for l in lines[1:])\nif not (has_open and has_close):\n    raise ValueError('frontmatter must be a --- delimited block at the top')","typeGuard":null,"tryCatchPattern":"try:\n    parse_skill_md(skill_path)\nexcept ValueError as e:\n    if 'closing' in str(e):\n        # append the missing --- after the last frontmatter key, then retry\n        ...\n    raise","preventionTips":["Use exactly three dashes for both delimiters","grep -n -- '---' SKILL.md as a pre-commit check for a matched pair","Close the frontmatter before writing the description body"],"tags":["markdown","frontmatter","parsing","skills"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}