affaan-m/ECC · error · Error

${pattern.source} is missing the ${pattern.category} entry

Error message

${pattern.source} is missing the ${pattern.category} entry

What it means

After the AGENTS.md summary line, `parseAgentsDocExpectations` scans the project-structure block for three directory entries: `agents/ — N specialized subagents`, `skills/ — N(+) workflow skills and domain knowledge`, and `commands/ — N slash commands`. The regexes accept em-dash, en-dash, or hyphen (`[—–-]`) as the separator. Each missing entry throws with the source `AGENTS.md project structure` and the affected category.

Source

Thrown at scripts/ci/catalog.js:262

    },
    {
      category: 'skills',
      mode: 'minimum',
      regex: /^\s*skills\/\s*[—–-]\s*(\d+)(\+)?\s+workflow skills and domain knowledge\s*$/im,
      source: 'AGENTS.md project structure'
    },
    {
      category: 'commands',
      mode: 'exact',
      regex: /^\s*commands\/\s*[—–-]\s*(\d+)\s+slash commands\s*$/im,
      source: 'AGENTS.md project structure'
    }
  ];

  for (const pattern of structurePatterns) {
    const match = agentsContent.match(pattern.regex);
    if (!match) {
      throw new Error(`${pattern.source} is missing the ${pattern.category} entry`);
    }

    expectations.push({
      category: pattern.category,
      mode: pattern.mode === 'minimum' && match[2] ? 'minimum' : pattern.mode,
      expected: Number(match[1]),
      source: `${pattern.source} (${pattern.category})`
    });
  }

  return expectations;
}

function parseZhAgentsDocExpectations(agentsContent) {
  const summaryMatch = agentsContent.match(/提供\s+(\d+)\s+个专业代理、\s*(\d+)(\+)?\s*项技能、\s*(\d+)\s+条命令/i);
  if (!summaryMatch) {
    throw new Error('docs/zh-CN/AGENTS.md is missing the catalog summary line');
  }

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Restore each line exactly: `agents/ — N specialized subagents`, `skills/ — N+ workflow skills and domain knowledge`, `commands/ — N slash commands` (any of —/–/- as separator).
  2. Run `node scripts/ci/catalog.js --write` — syncEnglishAgents rewrites only the digit (and optional `+`), preserving the suffix.
  3. Keep the exact descriptive suffix per category: `specialized subagents`, `workflow skills and domain knowledge`, `slash commands`.
  4. Re-run the catalog check to confirm all three entries match.

Example fix

// before (AGENTS.md project structure, commands suffix abbreviated)
agents/          — 68 specialized subagents
skills/          — 284+ workflow skills and domain knowledge
commands/        — 94 commands

// after
agents/          — 68 specialized subagents
skills/          — 284+ workflow skills and domain knowledge
commands/        — 94 slash commands
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
const agents = fs.readFileSync('AGENTS.md', 'utf8');
const entries = [
  { cat: 'agents', re: /^\s*agents\/\s*[—–-]\s*(\d+)\s+specialized subagents\s*$/im },
  { cat: 'skills', re: /^\s*skills\/\s*[—–-]\s*(\d+)(\+)?\s+workflow skills and domain knowledge\s*$/im },
  { cat: 'commands', re: /^\s*commands\/\s*[—–-]\s*(\d+)\s+slash commands\s*$/im },
];
for (const { cat, re } of entries) {
  if (!re.test(agents)) {
    console.error(`AGENTS.md project structure missing ${cat} entry (check exact suffix wording).`);
    process.exit(1);
  }
}

Type guard

function hasStructureEntry(agentsContent, category) {
  const map = {
    agents: /^\s*agents\/\s*[—–-]\s*(\d+)\s+specialized subagents\s*$/im,
    skills: /^\s*skills\/\s*[—–-]\s*(\d+)(\+)?\s+workflow skills and domain knowledge\s*$/im,
    commands: /^\s*commands\/\s*[—–-]\s*(\d+)\s+slash commands\s*$/im,
  };
  return map[category].test(agentsContent);
}

Try / catch

try {
  runCatalogCheck();
} catch (error) {
  if (/AGENTS\.md project structure is missing/i.test(error.message)) {
    console.error('Restore the directory entry with its exact suffix (specialized subagents / workflow skills and domain knowledge / slash commands).');
  }
  throw error;
}

Prevention

When it happens

Trigger: Fires when the project-structure section of AGENTS.md is missing the `agents/`, `skills/`, or `commands/` line, or the descriptive suffix diverges (e.g. `subagents` → `agents`, `slash commands` → `commands`, `workflow skills and domain knowledge` shortened).

Common situations: The project structure block is regenerated or reformatted and the descriptive suffixes are abbreviated. A line is deleted when consolidating the structure. The dash separator is changed to a colon. A new top-level dir is added and the others are rewrapped.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/258ebbe0b3a21b20. Report an issue: GitHub.