mcpField
U
umbraco-skill-code-analyzer

umbraco-skill-code-analyzer

github.com/umbracoTesting & quality27375 installsUpdated 6w ago
Repository

About umbraco-skill-code-analyzer

A static analyzer for code examples in SKILL.md files in Umbraco projects. It checks backoffice imports, extension type values, deprecated patterns, and optionally TypeScript compilation, then writes a JSON report.

Key features

  1. 01Validate Umbraco backoffice import paths
  2. 02Check extension type values
  3. 03Flag deprecated code patterns
  4. 04Optionally compile TypeScript examples
  5. 05Write findings to a JSON report

Use cases

  1. 01Review skill examples before publishing
  2. 02Find outdated Umbraco code patterns
  3. 03Check TypeScript example syntax and types

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/umbraco/umbraco-cms-backoffice-skills --skill umbraco-skill-code-analyzer

After installing, type/umbraco-skill-code-analyzerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

scripts/
analyze-code.ts
package-lock.json
package.json

Details

From the project README

Umbraco Skill Code Analyzer

Static analysis tool that validates code examples in SKILL.md files.

What It Checks

  • Import paths - Validates @umbraco-cms/backoffice/* imports against known modules
  • Extension types - Checks type: values against known Umbraco extension types
  • Deprecated patterns - Flags outdated code patterns
  • TypeScript compilation - Optional syntax/type checking

Usage

cd .claude/skills/umbraco-skill-code-analyzer/scripts
npm install --silent
npx tsx analyze-code.ts
Environment Variables
VariableDefaultDescription
CHECK_TYPESCRIPTtrueSet to false to skip TypeScript compilation

Output

Produces code-analysis-report.json in project root with structure:

{
  "timestamp": "...",
  "skillsScanned": 69,
  "codeBlocksAnalyzed": 473,
  "issuesFound": 34,
  "skills": [
    {
      "skillPath": "...",
      "skillName": "...",
      "codeBlocks": 5,
      "issues": [
        {
          "line": 33,
          "type": "invalid-import",
          "value": "@umbraco-cms/backoffice/unknown",
          "message": "Unknown import path",
          "severity": "warning"
        }
      ]
    }
  ],
  "statistics": {
    "totalCodeBlocks": 473,
    "typescriptBlocks": 368,
    "importIssues": 16,
    "extensionTypeIssues": 21,
    "compilationErrors": 0,
    "deprecatedPatterns": 15
  }
}

Issue Types

TypeSeverityDescription
invalid-importwarningUnknown @umbraco-cms/backoffice/* module
unknown-extension-typewarningUnrecognized extension type: value
deprecated-patternwarningOutdated code pattern detected
typescript-errorerrorTypeScript compilation failed

Updating Known Values

The script maintains lists of known modules and extension types. To update:

  1. Edit analyze-code.ts
  2. Add to KNOWN_BACKOFFICE_MODULES set
  3. Add to KNOWN_EXTENSION_TYPES set

Comments

Markdown supported