{"record":{"id":"9622057f1ed09ae1","repo":"conductor-oss/conductor","slug":"invalid-skill-md-frontmatter-e-getmessage","errorCode":null,"errorMessage":"Invalid SKILL.md frontmatter: {e.getMessage()}","messagePattern":"Invalid SKILL\\.md frontmatter: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java","lineNumber":583,"sourceCode":"        Matcher matcher = FRONTMATTER_PATTERN.matcher(skillMd);\n        if (!matcher.matches()) {\n            throw new IllegalArgumentException(\"SKILL.md is missing required YAML frontmatter\");\n        }\n        try {\n            LoaderOptions options = new LoaderOptions();\n            Yaml yaml = new Yaml(new SafeConstructor(options));\n            Object value = yaml.load(matcher.group(1));\n            if (value == null) {\n                return Map.of();\n            }\n            if (!(value instanceof Map<?, ?> map)) {\n                throw new IllegalArgumentException(\"SKILL.md frontmatter must be a mapping\");\n            }\n            return MAPPER.convertValue(map, MAP_TYPE);\n        } catch (IllegalArgumentException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new IllegalArgumentException(\n                    \"Invalid SKILL.md frontmatter: \" + e.getMessage(), e);\n        }\n    }\n\n    private String decodeUtf8(String path, byte[] data) {\n        try {\n            return StandardCharsets.UTF_8\n                    .newDecoder()\n                    .onMalformedInput(CodingErrorAction.REPORT)\n                    .onUnmappableCharacter(CodingErrorAction.REPORT)\n                    .decode(ByteBuffer.wrap(data))\n                    .toString();\n        } catch (CharacterCodingException e) {\n            throw new IllegalArgumentException(\"Skill file must be UTF-8 text: \" + path, e);\n        }\n    }\n\n    private boolean isRootAgentFile(String path) {","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java#L565-L601","documentation":"Generic fallback thrown by the frontmatter parser when SnakeYAML itself (or the Jackson convertValue step) raises something other than IllegalArgumentException — typically a YAML scanner/parser error such as a bad indent, a stray tab, or an unterminated quote. The original exception's message is concatenated into the IllegalArgumentException so the author sees the underlying YAML problem.","triggerScenarios":"SKILL.md frontmatter contains malformed YAML: tab indentation, unclosed quote, duplicate merge keys, or a tag SnakeYAML's SafeConstructor refuses (`!java/object:...`). The `catch (Exception e)` path wraps it.","commonSituations":"Editor inserts tabs; copy-paste from a markdown renderer that mangled spaces; author pasted a YAML anchor/alias SafeConstructor blocks; frontmatter ends mid-value due to a missing closing `---`.","solutions":["Read the appended `e.getMessage()` text — it names the YAML line/column of the failure; fix that line.","Lint the frontmatter locally with `yamllint` or `yq` before packaging the skill.","Confirm no tabs are used for indentation (YAML requires spaces).","If using anchors/aliases or custom tags, inline the values — SafeConstructor will not honor them."],"exampleFix":"// before\n---\nname: my-skill\ndescription: \"unclosed quote\n---\n// after\n---\nname: my-skill\ndescription: \"properly closed quote\"\n---","handlingStrategy":"try-catch","validationCode":"// Pre-validate the YAML before submitting to the registry.\nprivate static void validateFrontmatterYaml(String skillMd) {\n    Matcher m = FRONTMATTER_PATTERN.matcher(skillMd);\n    if (!m.matches()) throw new IllegalArgumentException(\"missing frontmatter fences\");\n    try {\n        new Yaml(new SafeConstructor(new LoaderOptions())).load(m.group(1));\n    } catch (Exception e) {\n        throw new IllegalArgumentException(\"frontmatter YAML invalid: \" + e.getMessage(), e);\n    }\n}","typeGuard":"boolean isValidFrontmatterYaml(String skillMd) {\n    Matcher m = FRONTMATTER_PATTERN.matcher(skillMd);\n    if (!m.matches()) return false;\n    try { new Yaml(new SafeConstructor(new LoaderOptions())).load(m.group(1)); return true; }\n    catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n    skillRegistry.publish(skillMd);\n} catch (IllegalArgumentException e) {\n    // message already contains the underlying YAML error line/column\n    return badRequest(\"SKILL.md frontmatter error: \" + e.getMessage());\n}","preventionTips":["Lint every SKILL.md with `yamllint` before packaging.","Never use tabs for indentation; configure the editor to insert spaces.","Close all quotes and brackets; run `yq` locally as a smoke test."],"tags":["skill-registry","yaml","frontmatter","parse-error"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}