{"record":{"id":"61b062b97d01c981","repo":"affaan-m/ECC","slug":"agents-md-is-missing-the-catalog-summary-line","errorCode":null,"errorMessage":"AGENTS.md is missing the catalog summary line","messagePattern":"AGENTS\\.md is missing the catalog summary line","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ci/catalog.js","lineNumber":224,"sourceCode":"    if (!match) {\n      throw new Error(`${pattern.source} is missing the ${pattern.category} row`);\n    }\n\n    expectations.push({\n      category: pattern.category,\n      mode: 'exact',\n      expected: Number(match[1]),\n      source: `${pattern.source} (${pattern.category})`\n    });\n  }\n\n  return expectations;\n}\n\nfunction parseAgentsDocExpectations(agentsContent) {\n  const summaryMatch = agentsContent.match(/providing\\s+(\\d+)\\s+specialized agents,\\s+(\\d+)(\\+)?\\s+skills,\\s+(\\d+)\\s+commands/i);\n  if (!summaryMatch) {\n    throw new Error('AGENTS.md is missing the catalog summary line');\n  }\n\n  const expectations = [\n    { category: 'agents', mode: 'exact', expected: Number(summaryMatch[1]), source: 'AGENTS.md summary' },\n    {\n      category: 'skills',\n      mode: summaryMatch[3] ? 'minimum' : 'exact',\n      expected: Number(summaryMatch[2]),\n      source: 'AGENTS.md summary'\n    },\n    { category: 'commands', mode: 'exact', expected: Number(summaryMatch[4]), source: 'AGENTS.md summary' }\n  ];\n\n  const structurePatterns = [\n    {\n      category: 'agents',\n      mode: 'exact',\n      regex: /^\\s*agents\\/\\s*[—–-]\\s*(\\d+)\\s+specialized subagents\\s*$/im,","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/ci/catalog.js#L206-L242","documentation":"`parseAgentsDocExpectations` reads AGENTS.md and matches the summary line `/providing\\s+(\\d+)\\s+specialized agents,\\s+(\\d+)(\\+)?\\s+skills,\\s+(\\d+)\\s+commands/i`. This is the headline catalog sentence at the top of AGENTS.md (e.g. 'providing 68 specialized agents, 284+ skills, 94 commands'). The optional `(\\+)?` after the skills count marks a minimum/floor expectation rather than exact. The throw fires when the sentence is absent.","triggerScenarios":"Triggered by `node scripts/ci/catalog.js` when AGENTS.md's opening summary lacks the `providing N specialized agents, N(+) skills, N commands` sentence. Drift in any connector (`specialized`, `skills`, `commands`), missing comma, or absent `providing` prefix causes failure.","commonSituations":"AGENTS.md is rewritten and the summary line is paraphrased (e.g. 'offers 68 agents...'). The `+` floor marker is removed or added without intent. The line is split across paragraphs. A version bump changes the headline but the wording is altered.","solutions":["Restore the exact sentence in AGENTS.md: `providing 68 specialized agents, 284+ skills, 94 commands` (use `+` only if skills is a floor).","Keep the word `providing`, the comma separators, and the unit words `specialized agents`/`skills`/`commands`.","Run `node scripts/ci/catalog.js --write` to auto-sync the three counts from the live catalog.","Confirm the skills count mode (exact vs minimum) matches your intent — `+` makes it a `>=` check."],"exampleFix":"// before (AGENTS.md, paraphrased)\n...offers 68 agents, 284 skills and 94 commands...\n\n// after\n**Version:** 2.2.0\n\nThis is a **production-ready AI coding plugin** providing 68 specialized agents, 284+ skills, 94 commands ...","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst agents = fs.readFileSync('AGENTS.md', 'utf8');\nconst re = /providing\\s+(\\d+)\\s+specialized agents,\\s+(\\d+)(\\+)?\\s+skills,\\s+(\\d+)\\s+commands/i;\nif (!re.test(agents)) {\n  console.error('AGENTS.md missing catalog summary line.');\n  console.error('Expected: providing N specialized agents, N(+) skills, N commands');\n  process.exit(1);\n}","typeGuard":"function hasAgentsSummary(agentsContent) {\n  const m = agentsContent.match(/providing\\s+(\\d+)\\s+specialized agents,\\s+(\\d+)(\\+)?\\s+skills,\\s+(\\d+)\\s+commands/i);\n  return m !== null && Number.isInteger(Number(m[1])) && Number.isInteger(Number(m[2])) && Number.isInteger(Number(m[4]));\n}","tryCatchPattern":"try {\n  runCatalogCheck();\n} catch (error) {\n  if (/AGENTS\\.md is missing the catalog summary line/i.test(error.message)) {\n    console.error('Restore: providing N specialized agents, N(+) skills, N commands');\n  }\n  throw error;\n}","preventionTips":["Keep the verb `providing` and the unit words `specialized agents`, `skills`, `commands`.","Use `+` after skills only when the count is a floor (minimum mode).","Run `--write` to sync the three counts.","Validate after any AGENTS.md headline rewrite."],"tags":["catalog","ci","regex","agents-md","documentation-drift"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}