{"record":{"id":"dbc5edf593acdb27","repo":"affaan-m/ECC","slug":"readme-zh-cn-md-is-missing-the-quick-start-catalog","errorCode":null,"errorMessage":"README.zh-CN.md is missing the quick-start catalog summary","messagePattern":"README\\.zh-CN\\.md is missing the quick-start catalog summary","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ci/catalog.js","lineNumber":142,"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 parseZhRootReadmeExpectations(readmeContent) {\n  const match = readmeContent.match(/你现在可以使用\\s+(\\d+)\\s+个代理、\\s*(\\d+)\\s*个技能和\\s*(\\d+)\\s*个命令/i);\n  if (!match) {\n    throw new Error('README.zh-CN.md is missing the quick-start catalog summary');\n  }\n\n  return [\n    { category: 'agents', mode: 'exact', expected: Number(match[1]), source: 'README.zh-CN.md quick-start summary' },\n    { category: 'skills', mode: 'exact', expected: Number(match[2]), source: 'README.zh-CN.md quick-start summary' },\n    { category: 'commands', mode: 'exact', expected: Number(match[3]), source: 'README.zh-CN.md quick-start summary' }\n  ];\n}\n\nfunction parseZhDocsReadmeExpectations(readmeContent) {\n  const expectations = [];\n\n  const quickStartMatch = readmeContent.match(/你现在可以使用\\s+(\\d+)\\s+个智能体、\\s*(\\d+)\\s*项技能和\\s*(\\d+)\\s*个命令了/i);\n  if (!quickStartMatch) {\n    throw new Error('docs/zh-CN/README.md is missing the quick-start catalog summary');\n  }\n\n  expectations.push(","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/ci/catalog.js#L124-L160","documentation":"`parseZhRootReadmeExpectations` extracts the quick-start summary sentence from the Chinese root README (`README.zh-CN.md`). It matches `/你现在可以使用\\s+(\\d+)\\s+个代理、\\s*(\\d+)\\s*个技能和\\s*(\\d+)\\s*个命令/i`. The throw fires when that single sentence is absent or its wording has drifted. The three captured digits are the documented agents/skills/commands counts validated against the real catalog.","triggerScenarios":"Fires when running the catalog check against a `README.zh-CN.md` that lacks the exact sentence `你现在可以使用 N 个代理、 N 个技能和 N 个命令`. Common triggers: the sentence was paraphrased (e.g. 智能体 instead of 代理, or 项技能 instead of 个技能), the `、`/`和` conjunction punctuation changed, or the quick-start block was rewritten.","commonSituations":"A translator updates the Chinese README and swaps 代理 → 智能体 for consistency with `docs/zh-CN/README.md` (which uses 智能体), breaking this regex. Counts are edited but the surrounding wording is also altered. A merge resolves a conflict by deleting the sentence.","solutions":["Restore the exact sentence in README.zh-CN.md: `你现在可以使用 N 个代理、 N 个技能和 N 个命令` with N matching the live catalog counts.","Note this file uses 代理/个技能/个命令 — distinct from docs/zh-CN/README.md which uses 智能体/项技能/个命令了. Keep the two files' wording separate.","Run `node scripts/ci/catalog.js --write` to auto-sync all counts from the filesystem catalog.","Verify the `、` (ideographic comma) after 代理 and `和` before 命令 are present."],"exampleFix":"// before (README.zh-CN.md, wording drifted to 智能体)\n你现在可以使用 68 个智能体、284 项技能和 94 个命令\n\n// after (root zh-CN uses 代理/个/个)\n你现在可以使用 68 个代理、284 个技能和 94 个命令","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst readme = fs.readFileSync('README.zh-CN.md', 'utf8');\nconst re = /你现在可以使用\\s+(\\d+)\\s+个代理、\\s*(\\d+)\\s*个技能和\\s*(\\d+)\\s*个命令/i;\nif (!re.test(readme)) {\n  console.error('README.zh-CN.md missing quick-start summary sentence.');\n  console.error('Expected: 你现在可以使用 N 个代理、 N 个技能和 N 个命令');\n  console.error('Note: root zh-CN uses 代理/个技能/个命令 (distinct from docs/zh-CN which uses 智能体/项/了).');\n  process.exit(1);\n}","typeGuard":"function hasZhRootQuickStart(readmeContent) {\n  return /你现在可以使用\\s+(\\d+)\\s+个代理、\\s*(\\d+)\\s*个技能和\\s*(\\d+)\\s*个命令/i.test(readmeContent);\n}","tryCatchPattern":"try {\n  runCatalogCheck();\n} catch (error) {\n  if (/README\\.zh-CN\\.md is missing the quick-start/i.test(error.message)) {\n    console.error('Restore: 你现在可以使用 N 个代理、 N 个技能和 N 个命令 (root zh-CN wording).');\n  }\n  throw error;\n}","preventionTips":["Keep the two Chinese READMEs' vocabularies distinct: root uses 代理/个技能/个命令; docs/zh-CN uses 智能体/项技能/个命令了.","Preserve the ideographic comma 、 and the conjunction 和.","Run `--write` to sync counts rather than editing the sentence by hand.","After any Chinese copy edit, run the catalog check to catch wording drift."],"tags":["catalog","ci","regex","i18n","chinese","readme","documentation-drift"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}