{"record":{"id":"258ebbe0b3a21b20","repo":"affaan-m/ECC","slug":"pattern-source-is-missing-the-pattern-category-entry","errorCode":null,"errorMessage":"${pattern.source} is missing the ${pattern.category} entry","messagePattern":"(.+?) is missing the (.+?) entry","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ci/catalog.js","lineNumber":262,"sourceCode":"    },\n    {\n      category: 'skills',\n      mode: 'minimum',\n      regex: /^\\s*skills\\/\\s*[—–-]\\s*(\\d+)(\\+)?\\s+workflow skills and domain knowledge\\s*$/im,\n      source: 'AGENTS.md project structure'\n    },\n    {\n      category: 'commands',\n      mode: 'exact',\n      regex: /^\\s*commands\\/\\s*[—–-]\\s*(\\d+)\\s+slash commands\\s*$/im,\n      source: 'AGENTS.md project structure'\n    }\n  ];\n\n  for (const pattern of structurePatterns) {\n    const match = agentsContent.match(pattern.regex);\n    if (!match) {\n      throw new Error(`${pattern.source} is missing the ${pattern.category} entry`);\n    }\n\n    expectations.push({\n      category: pattern.category,\n      mode: pattern.mode === 'minimum' && match[2] ? 'minimum' : pattern.mode,\n      expected: Number(match[1]),\n      source: `${pattern.source} (${pattern.category})`\n    });\n  }\n\n  return expectations;\n}\n\nfunction parseZhAgentsDocExpectations(agentsContent) {\n  const summaryMatch = agentsContent.match(/提供\\s+(\\d+)\\s+个专业代理、\\s*(\\d+)(\\+)?\\s*项技能、\\s*(\\d+)\\s+条命令/i);\n  if (!summaryMatch) {\n    throw new Error('docs/zh-CN/AGENTS.md is missing the catalog summary line');\n  }","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/ci/catalog.js#L244-L280","documentation":"Generic guard in parseAgentsDocExpectations' structurePatterns loop: thrown when the AGENTS.md project-structure block lacks the entry for one category (agents, skills, or commands), e.g. a 'skills/ — N workflow skills' line. The faulting input is the missing project-tree entry named by pattern.category.","triggerScenarios":"Thrown at scripts/ci/catalog.js:262 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-add the missing agents/skills/commands entry with its count to the AGENTS.md project structure block.","Regenerate the structure counts with the catalog tooling.","Update structurePatterns if the line format (dash style, plus sign for minimums) changed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}