{"record":{"id":"aadc382d0464b4d5","repo":"Yeachan-Heo/oh-my-codex","slug":"catalog-manifest-invalid-agents","errorCode":null,"errorMessage":"catalog_manifest_invalid:agents","messagePattern":"catalog_manifest_invalid:agents","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/catalog/schema.ts","lineNumber":53,"sourceCode":"}\n\nfunction assertNonEmptyString(value: unknown, field: string): asserts value is string {\n  if (typeof value !== 'string' || value.trim() === '') {\n    throw new Error(`catalog_manifest_invalid:${field}`);\n  }\n}\n\nexport function validateCatalogManifest(input: unknown): CatalogManifest {\n  if (!isObject(input)) throw new Error('catalog_manifest_invalid:root');\n\n  if (typeof input.schemaVersion !== 'number' || !Number.isInteger(input.schemaVersion)) {\n    throw new Error('catalog_manifest_invalid:schemaVersion');\n  }\n\n  assertNonEmptyString(input.catalogVersion, 'catalogVersion');\n\n  if (!Array.isArray(input.skills)) throw new Error('catalog_manifest_invalid:skills');\n  if (!Array.isArray(input.agents)) throw new Error('catalog_manifest_invalid:agents');\n\n  const seenSkills = new Set<string>();\n  const skills: CatalogSkillEntry[] = input.skills.map((entry, index) => {\n    if (!isObject(entry)) throw new Error(`catalog_manifest_invalid:skills[${index}]`);\n    assertNonEmptyString(entry.name, `skills[${index}].name`);\n    assertNonEmptyString(entry.category, `skills[${index}].category`);\n    assertNonEmptyString(entry.status, `skills[${index}].status`);\n\n    if (!SKILL_CATEGORIES.has(entry.category as CatalogSkillCategory)) {\n      throw new Error(`catalog_manifest_invalid:skills[${index}].category`);\n    }\n    if (!ENTRY_STATUSES.has(entry.status as CatalogEntryStatus)) {\n      throw new Error(`catalog_manifest_invalid:skills[${index}].status`);\n    }\n\n    const name = entry.name.trim();\n    if (seenSkills.has(name)) throw new Error(`catalog_manifest_invalid:duplicate_skill:${name}`);\n    seenSkills.add(name);","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/catalog/schema.ts#L35-L71","documentation":"The sibling of the skills check: validateCatalogManifest requires 'agents' to be an array of agent entries. This error fires when agents is missing, an object, or a non-array value. An empty array is valid at this stage.","triggerScenarios":"A manifest where \"agents\" is absent or keyed as an object map rather than a list.","commonSituations":"Skill-only catalogs that omit the agents key entirely, or hand-edits converting lists to maps.","solutions":["Set agents to an array ([] is acceptable if no agents exist)","Regenerate the manifest with the official generator","Validate the built manifest in CI"],"exampleFix":"// before\n(no \"agents\" key)\n\n// after\n\"agents\": []","handlingStrategy":"validation","validationCode":"if (!Array.isArray(raw.agents)) { raw.agents = raw.agents ?? []; /* or reject */ }","typeGuard":"function hasAgentsArray(v: unknown): v is { agents: unknown[] } { return typeof v === 'object' && v !== null && Array.isArray((v as any).agents); }","tryCatchPattern":null,"preventionTips":["Always emit \"agents\": [] even in skill-only catalogs","Validate built manifests in CI"],"tags":["catalog","manifest","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}