{"record":{"id":"b1d408c991f4a99e","repo":"affaan-m/ECC","slug":"cannot-adapt-antigravity-agent-label-missing-y","errorCode":null,"errorMessage":"Cannot adapt Antigravity agent ${label}: missing YAML frontmatter","messagePattern":"Cannot adapt Antigravity agent (.+?): missing YAML frontmatter","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/install/antigravity-agent.js","lineNumber":23,"sourceCode":"  Write: 'write_to_file',\n  Edit: 'replace_file_content',\n  Grep: 'grep_search',\n  Glob: 'find_by_name',\n  Bash: 'run_command',\n  WebSearch: 'search_web',\n  WebFetch: 'read_url_content',\n});\n\nconst MODEL_NAMES = Object.freeze({\n  haiku: 'flash',\n  sonnet: 'pro',\n  opus: 'pro',\n});\n\nfunction splitFrontmatter(source, label) {\n  const match = String(source || '').match(/^---\\r?\\n([\\s\\S]*?)\\r?\\n---\\r?\\n/);\n  if (!match) {\n    throw new Error(`Cannot adapt Antigravity agent ${label}: missing YAML frontmatter`);\n  }\n\n  // Keep YAML loading behind the transform boundary. Public help commands load\n  // the installer graph without executing a transform, including in hermetic\n  // packed-artifact checks where runtime dependencies are intentionally absent.\n  const frontmatter = require('js-yaml').load(match[1]);\n  if (!frontmatter || typeof frontmatter !== 'object' || Array.isArray(frontmatter)) {\n    throw new Error(`Cannot adapt Antigravity agent ${label}: frontmatter must be an object`);\n  }\n\n  return {\n    frontmatter,\n    body: source.slice(match[0].length),\n  };\n}\n\nfunction normalizeToolNames(value) {\n  const names = Array.isArray(value) ? value : String(value || '').split(',');","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/lib/install/antigravity-agent.js#L5-L41","documentation":"splitFrontmatter regex-matched the Antigravity agent markdown source and found no '--- ... ---' YAML frontmatter block at the top of the file. Without frontmatter the adapter cannot read the agent's name, description, or model, so adaptation aborts.","triggerScenarios":"Thrown at scripts/lib/install/antigravity-agent.js:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add YAML frontmatter (--- ... ---) with at least name and description to the agent markdown file.","Copy the frontmatter shape from an existing working agent file."],"exampleFix":"printf -- '---\\nname: my-agent\\ndescription: what it does\\n---\\n' | cat - agent.md > fixed.md","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}