{"record":{"id":"ce45cc334863e842","repo":"OpenBMB/ChatDev","slug":"missing-frontmatter","errorCode":null,"errorMessage":"missing frontmatter","messagePattern":"missing frontmatter","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"entity/configs/node/skills.py","lineNumber":50,"sourceCode":"            continue\n        try:\n            frontmatter = _parse_frontmatter(skill_file)\n        except Exception:\n            continue\n        raw_name = frontmatter.get(\"name\")\n        raw_description = frontmatter.get(\"description\")\n        if not isinstance(raw_name, str) or not raw_name.strip():\n            continue\n        if not isinstance(raw_description, str) or not raw_description.strip():\n            continue\n        discovered.append((raw_name.strip(), raw_description.strip()))\n    return discovered\n\n\ndef _parse_frontmatter(skill_file: Path) -> Mapping[str, object]:\n    text = skill_file.read_text(encoding=\"utf-8\")\n    if not text.startswith(\"---\"):\n        raise ValueError(\"missing frontmatter\")\n    lines = text.splitlines()\n    end_idx = None\n    for idx in range(1, len(lines)):\n        if lines[idx].strip() == \"---\":\n            end_idx = idx\n            break\n    if end_idx is None:\n        raise ValueError(\"missing closing delimiter\")\n    payload = \"\\n\".join(lines[1:end_idx])\n    data = yaml.safe_load(payload) or {}\n    if not isinstance(data, Mapping):\n        raise ValueError(\"frontmatter must be a mapping\")\n    return data\n\n\n@dataclass\nclass AgentSkillSelectionConfig(BaseConfig):\n    name: str","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/entity/configs/node/skills.py#L32-L68","documentation":"_parse_frontmatter in skills.py reads a skill markdown file and requires it to begin with '---'. A file that does not start with the frontmatter delimiter raises ValueError('missing frontmatter'). It is called during default skill discovery, so a malformed bundled/local skill file surfaces here.","triggerScenarios":"A skill .md file in the skills directory that lacks the leading '---' line (e.g. starts with prose, a BOM, or blank line) while _discover_default_skills parses it.","commonSituations":"Hand-authored skill files missing frontmatter; editors adding a BOM or leading blank line; renaming non-skill markdown files into the skills directory.","solutions":["Start the skill file with '---' on the first line followed by YAML frontmatter and a closing '---'","Remove any BOM or leading blank lines from the file","Remove non-skill markdown files from the skills directory"],"exampleFix":"# before\n# My skill doc\nSome prose...\n# after\n---\nname: my-skill\ndescription: does a thing\n---\nSome prose...","handlingStrategy":"validation","validationCode":"text = path.read_text(encoding='utf-8')\nassert text.startswith('---'), 'skill file must start with frontmatter'","typeGuard":null,"tryCatchPattern":"try:\n    _discover_default_skills(skills_dir)\nexcept ValueError as e:\n    if 'missing frontmatter' in str(e):\n        # skip/repair the offending file, log its path\n        ...","preventionTips":["Skill authoring template starting with '---'","Save skill files as UTF-8 without BOM","Lint skill files in CI"],"tags":["skills","frontmatter","markdown","parsing"],"backgroundTag":"malformed-frontmatter","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}