anthropics/skills · error · ValueError
SKILL.md missing frontmatter (no closing ---)
Error message
SKILL.md missing frontmatter (no closing ---)
What it means
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.
Source
Thrown at skills/skill-creator/scripts/utils.py:22
def parse_skill_md(skill_path: Path) -> tuple[str, str, str]:
"""Parse a SKILL.md file, returning (name, description, full_content)."""
content = (skill_path / "SKILL.md").read_text()
lines = content.split("\n")
if lines[0].strip() != "---":
raise ValueError("SKILL.md missing frontmatter (no opening ---)")
end_idx = None
for i, line in enumerate(lines[1:], start=1):
if line.strip() == "---":
end_idx = i
break
if end_idx is None:
raise ValueError("SKILL.md missing frontmatter (no closing ---)")
name = ""
description = ""
frontmatter_lines = lines[1:end_idx]
i = 0
while i < len(frontmatter_lines):
line = frontmatter_lines[i]
if line.startswith("name:"):
name = line[len("name:"):].strip().strip('"').strip("'")
elif line.startswith("description:"):
value = line[len("description:"):].strip()
# Handle YAML multiline indicators (>, |, >-, |-)
if value in (">", "|", ">-", "|-"):
continuation_lines: list[str] = []
i += 1
while i < len(frontmatter_lines) and (frontmatter_lines[i].startswith(" ") or frontmatter_lines[i].startswith("\t")):
continuation_lines.append(frontmatter_lines[i].strip())
i += 1View on GitHub (pinned to f6656c1256)
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
Example fix
# before --- name: my-skill description: Long text that never ended # Body... # after --- name: my-skill description: Long text that never ended --- # Body...
Defensive patterns
Strategy: validation
Validate before calling
def frontmatter_closes(skill_path: Path) -> bool:
lines = (skill_path / "SKILL.md").read_text().split("\n")
return lines[0].strip() == "---" and any(l.strip() == "---" for l in lines[1:]) Try / catch
try:
parse_skill_md(path)
except ValueError as e:
if "closing" in str(e):
print(f"{path}: add a closing --- line")
raise Prevention
- 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
When it happens
Trigger: 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).
Common situations: Truncated files cut off mid-frontmatter; hand-editing that deletes the closing delimiter; using `-----` or `—--` (typo/autocorrect) instead of exactly three hyphens.
Related errors
- SKILL.md missing frontmatter (no opening ---)
- {word} not found (not an unpacked .docx?)
- parent comment {parent_id} not found
- relationship target is not a POSIX part name: {target!r}
- relationship target resolves to nothing: {target!r}
AI-assisted analysis of anthropics/skills@f6656c1256 (2026-08-14).
Data as JSON: /api/errors/460369b2ead1b780.
Report an issue: GitHub.