affaan-m/ECC · error · Error

unable to read

Error message

unable to read ${label}

What it means

findDocsSkillFiles' inner readDirectories helper throws when fs.readdirSync fails on a docs locale or skills directory (permission problem, missing dir raced away). The faulting input is the directory named by `label`, e.g. 'docs directory'.

Solutions

  1. Check that the docs directory exists and is readable by the current user.
  2. Recreate the locale directory if it was deleted mid-run.
  3. Run with elevated permissions only if the directory ownership demands it.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at scripts/ci/validate-skills.js:302 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/626726b1ccdb3582. Report an issue: GitHub.

Appendix: source

Thrown at scripts/ci/validate-skills.js:302

  return { fatal: false };
}

/**
 * Find every SKILL.md under docs/{locale}/skills/*, mirroring the
 * curated skills/ layout one locale directory deeper.
 *
 * @param {string} docsDir
 * @returns {Array<{skillMd: string, label: string}>}
 */
function findDocsSkillFiles(docsDir) {
  if (!fs.existsSync(docsDir)) return [];

  const readDirectories = (directory, label) => {
    try {
      return fs.readdirSync(directory, { withFileTypes: true });
    } catch {
      throw new Error(`unable to read ${label}`);
    }
  };

  const locales = readDirectories(docsDir, 'docs directory')
    .filter(e => e.isDirectory() && !e.name.startsWith('.'))
    .map(e => e.name);

  return locales.flatMap(locale => {
    const localeSkillsDir = path.join(docsDir, locale, 'skills');
    if (!fs.existsSync(localeSkillsDir)) return [];

    const skillDirs = readDirectories(localeSkillsDir, `docs/${locale}/skills directory`)
      .filter(e => e.isDirectory() && !e.name.startsWith('.'))
      .map(e => e.name);

    return skillDirs.map(skillDir => ({
      skillMd: path.join(localeSkillsDir, skillDir, 'SKILL.md'),
      label: `docs/${locale}/skills/${skillDir}/SKILL.md`

View on GitHub (pinned to 8321021c54)