davila7/claude-code-templates · warning

Could not analyze skills:

Error message

Could not analyze skills:

What it means

YearInReview2025 skill analysis caught an error and returns empty skills data. Same degrade-gracefully pattern as the other analyzers: the report renders without the skills section.

Source

Thrown at cli-tool/src/analytics/core/YearInReview2025.js:758

          });

          // Only include 2025 skills
          if (installedAt.getFullYear() === 2025) {
            skillEvents.push({
              name: item,
              timestamp: installedAt
            });
          }
        }
      }

      return {
        skills: skills.sort((a, b) => b.installedAt - a.installedAt),
        total: skills.length,
        events: skillEvents.sort((a, b) => a.timestamp - b.timestamp)
      };
    } catch (error) {
      console.warn('Could not analyze skills:', error.message);
      return { skills: [], total: 0, events: [] };
    }
  }

  /**
   * Analyze installed MCPs
   * @returns {Promise<Object>} MCPs data
   */
  async analyzeMCPs() {
    const fs = require('fs-extra');
    const os = require('os');
    const path = require('path');

    try {
      const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
      if (!await fs.pathExists(settingsPath)) {
        return { mcps: [], total: 0, events: [] };
      }

View on GitHub (pinned to a0851ed10c)

Solutions

  1. Ignore — report continues without skills
  2. Verify skill folders have valid frontmatter (name/description) if you want them counted
  3. Fix permissions under the skills directory
  4. Update CLI for newer skill format support
Defensive patterns

Strategy: try-catch

Validate before calling

function validSkillDir(dir) {
  return fs.existsSync(path.join(dir, 'SKILL.md'));
}

Type guard

function isValidSkillMeta(m) {
  return !!m && typeof m.name === 'string' && typeof m.description === 'string';
}

Try / catch

try { return analyzeSkills(...); }
catch (error) { console.warn('Could not analyze skills:', error.message); return { skills: [], total: 0, events: [] }; }

Prevention

When it happens

Trigger: Scanning installed skills (~/.claude/skills or component skill dirs) for metadata/installedAt timestamps throws — missing fields, unreadable SKILL.md frontmatter, stat failures.

Common situations: Skills installed by older CLI versions lacking metadata; hand-copied skill folders without frontmatter; permission issues.

Related errors


AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28). Data as JSON: /api/errors/c7fff35c3134143e. Report an issue: GitHub.